Magento – Add to cart redirect

addtocartcartmagento-1.7redirecturl

How can redirect to a CMS page when the "add to cart button" (on a product view page) is clicked?

I have already disabled the redirect to the cart page after the "add to cart" button is clicked. Now I need to know what code edits to make to direct the browser to a new page.

Best Answer

Edit template for product view page YOUR_THEME/template/catalog/product/view.phtml

Replace this:

<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

With this:

<form action="<?php echo $this->getSubmitUrl($_product, array('return_url' => 'YOUR CMS PAGE URL')) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
Related Topic