Ankita P.
Ankita P.

Reputation: 478

How to get discount applied on cart line item individually?

How can I get the discount applied on cart line item individually?

Is this possible to get total unit price after applying discount?

Upvotes: 4

Views: 4819

Answers (1)

Slimshadddyyy
Slimshadddyyy

Reputation: 4073

To discount applied on cart line item you can use

$item->getDiscountAmount();

To calculate the price subtracting the discount amount $item->getDiscountAmount(), use below

$price = $item->getPrice() - $item->getDiscountAmount();

This will give you the total unit price after discount.

Upvotes: 5

Related Questions