The default Magento allows the admin to add shopping cart price rules.
He can offer coupon codes to avail the discounts.
However, sometimes you may want to set conditions based on which discounts are offered.
For example, the admin wants to offer a specific payment method only for certain scenarios.
To implement this, the admin needs to check which shopping cart rule is applied to cart in Magento.
The below solution can be used for the same:
Method to Check Which Shopping Cart Rule is Applied to Cart in Magento:
Add the below code.
$appliedRuleIds = Mage::getSingleton('checkout/session')->getQuote()->getAppliedRuleIds();
$appliedRuleIds = explode(',', $appliedRuleIds);
By adding this code, you will be able to check which shopping cart price rule has applied to quote.
If you have queries regarding this post, feel free to ask in the Comment section below.
I would be happy to answer your questions.
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.