Link to home
Start Free TrialLog in
Avatar of ivn03
ivn03

asked on

How to display upsells_products block in success message in Magento

I am looking forward to add upsell_products block below my success message whenever a product is added to the cart.

Ex: if i add product A to the cart, then the success message should display "Product A added to your shopping cart. You May also like: Product B Product C Product D"

I believe I need to edit CartController.php but dont know the right way to do this.

Can anyone help me out with this?
Avatar of miked2004
miked2004
Flag of United States of America image

Yes in the cart controller you need to edit the following line(around line 197):
$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));


If you want to create a custom module and override the controller, here is a link with details on doing that.
http://www.magentocommerce.com/boards/viewthread/32979/
ASKER CERTIFIED SOLUTION
Avatar of ivn03
ivn03

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ivn03
ivn03

ASKER

after a lot of research and experimenting with the code I finally found the answer myself which got me the output the way I wanted. Hence I thought I should share it on the forum as well.