Elzo Valugi
Elzo Valugi

Reputation: 27886

Magento order tax information

I see that tax information is kept at order level but I cannot see any setters/getters for it.

It could be related with Quote Items or even with Shipping addresses?

Anybody knows how tax is related to order?

Upvotes: 1

Views: 5632

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27119

There are fields on the sales_order table for taxes after they've been calculated:

| tax_refunded                | decimal(12,4)
| tax_canceled                | decimal(12,4)
| base_tax_refunded           | decimal(12,4)
| base_tax_canceled           | decimal(12,4)
| tax_invoiced                | decimal(12,4)
| base_tax_invoiced           | decimal(12,4)
| shipping_tax_amount         | decimal(12,4)
| base_shipping_tax_amount    | decimal(12,4)
| shipping_tax_refunded       | decimal(12,4)
| base_shipping_tax_refunded  | decimal(12,4)

When you have an order object, you can use the normal Magento getters to obtain this data. E.g.

$taxRefunded = $order->getTaxRefunded();

Hope that helps.

Thanks, Joe

Upvotes: 10

Related Questions