giovanni
giovanni

Reputation: 11

magento programmatically get the shipping tax from an order

how can i programmatically get the shipping tax from an order increment_id in magento?

I try this script, but seems not to work.

$order = Mage::getModel('sales/order')->loadByIncrementId("increment_id");
$taxRefunded = $order->getTaxRefunded();

Thanks

Upvotes: 1

Views: 2086

Answers (1)

Gerard de Visser
Gerard de Visser

Reputation: 8050

You can retrieve tax information from order with following code, returning an array. You can parse and use this array to get the shipping tax ammount.

$order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('increment_id', 100000166)->getFirstItem();
$taxRefunded = $order->getFullTaxInfo();
var_dump($taxRefunded);

E.g.: to retrieve tax percent:

$tax_percent = $taxRefunded[0]['percent'];

Upvotes: 2

Related Questions