I want to add a product to cart when a coupon is applied. I created an observer on event controller_action_predispatch_checkout_cart_couponPost. But I don't get the applied coupon code in observer.

Can anyone tell me how to get it? Any help will be greatly appreciated..

1 Answer 1


In your execute() method of your observer you can call the following code to get the coupon code:

$controller = $observer->getControllerAction();
$couponCode = $controller->getRequest()->getParam('coupon_code');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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