I have a need to be able to find out if a sales coupon exists for a product.
The reason is that we would like to show on a product page, that a coupon exists for it and if needed show the coupon code also.
From my research over past couple of days, it seems salesRule are attached to be quote. Having said that in the validatior code I can see the discounted being calcualated per item. So there must be some-code that figures out if the coupon exist for an item.
If that does, we can run a cron job on a regular basis to update the attribute of a product with coupon codes that can be applied to it.
Can someone give some pointer where I can find the code which either 1. for each sales rule, lists out the product which meets the condition or 2. For each product, list out which sales rules meets the conditon.
Thanks