I am programmatically adding a product to cart if a certain coupon code is applied to cart.

I would like to check this on every page so that the product only shows up when the coupon is applied and no issues with cookies, etc.

What event can I observe for this?


you can use controller_action_predispatch.
This event is dispatched for every page, before the action is executed.

  • or use the CatalogController if you're not comfortable with Observers :) Oct 1 '15 at 8:14
  • Thanks! I used controller_action_predispatch and works perfectly
    – blisstdev
    Oct 1 '15 at 9:09

In order to add an observer to an event on every page add this in config.xml of your module.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.