How to get an order item's discount amount programmatically?

You can use the getBaseDiscountAmount() and the getDiscountAmount() methods of the \Magento\Sales\Model\Order\Item class:


The getBaseDiscountAmount() method returns a discount amount in the store’s base currency.
The getDiscountAmount() method returns a discount amount in the order’s currency.

You can also directly use the base_discount_amount and discount_amount columns of the sales_order_item table:



See also:

Is this a typo? Instead of…

The getBaseDiscountAmount() method returns a discount amount in the store’s base currency.
The getBaseDiscountAmount() method returns a discount amount in the order’s currency.

…did you mean…?

The getBaseDiscountAmount() method returns a discount amount in the store’s base currency.
The getDiscountAmount() method returns a discount amount in the order’s currency.

…or something else?

1 Like

Yes, you are right, I have corrected the article.