I have created 3 catalog rules for category.
- Shoes Category: 5% Off , Catalog Rule Name: Shoes Offer
- Toys Category: 10% Off, Catalog Rule Name: Toys Offer
- Fashion Accessories: 8% Off, Catalog Rule Name: Fashion Acc. Offer
So all the product of that categories are showing discounted price in category.
On cart page i want to show which catalog rule is applied to item.
Is there any way to check on cart item that which catalog rule is applied to it?
How can i check which catalog rule is applied to item and how much discount is applied?
Any help would be appreciated.
Best Answer
We can use
\Magento\Quote\Model\Quote\Item $item
to check the applied rules.vendor/magento/module-sales-rule/Model/Quote/Discount.php
See a good example here: vendor/magento/module-sales-rule/Observer/SalesOrderAfterPlaceObserver.php
In database, we should take a look at
quote_item
table.