Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Add condition to CartController addAction - best strategy? 
 
zburnham
Member
 
Avatar
Total Posts:  69
Joined:  2007-11-07
Westborough, MA
 

I would like to add a condition to addAction in Mage_Checkout_CartController.  If the condition is met, the user should be redirected to a specified URL before a product is added.

I considered using an Observer class to accomplish this, but I ran into trouble when I tried to figure out how to get a redirect back to the user’s browser.  Would I be better off overriding Mage_Checkout_CartController instead of doing something with the Observer?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top