I have made two simple shopping cart rules from backend.
The first has action which is based 'SKU is one of'.
The second has action based on 'Brand contains'.
I have made a custom function to display discount code and amount on details page.
But on listing page for Rule 1, I am seeing the Promo Code and Discount Amount of Rule 2.
Alternatively, pls suggest me how to get rule id of a shopping cart rule for Brand and SKU.
Best Answer
This is taken from a StackOverflow question that I participated in, but modified for your question.
This iterates through all of the Shopping Cart rules in the
rule_collection
, compares the product sku on the view page and echos the Coupon Code. Based on this code you can modify it to also get the coupon code for Brand.