If you need to do this, you should query the commerce_order_total table - but really, this is a Field API table, and you shouldn't necessarily be writing direct queries against it unless you know what you're doing. : )
If you can, it's better to load the order and access it like this:
Comments
If you need to do this, you
If you need to do this, you should query the commerce_order_total table - but really, this is a Field API table, and you shouldn't necessarily be writing direct queries against it unless you know what you're doing. : )
If you can, it's better to load the order and access it like this:
<?php
$order = commerce_order_load($order_id);
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$total = $wrapper->commerce_order_total->amount->value();
$currency_code = $wrapper->commerce_order_total->currency_code->value();
?>
thank you
thank you
getting an error for that.
getting an error for that. tried to put it into a block and into a module.
This worked for me for the
This worked for me for the order total:
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$total = $wrapper->commerce_order_total->amount->value();