0

Magento uses the default process when product is “Add to Cart” from product detail page: product is added to cart and redirect to the cart page or user can stay on product page. We need user to be directed to the same page. And, also, display a message Above the "Add to Cart" button : "Product Added to Cart".

Please tell how to display this message.

Thanks in advance !

1

You can change message from code in cartController. Extend cartController into your local. In cartController find below code:

if (!$cart->getQuote()->getHasError()) {
            $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
            $this->_getSession()->addSuccess($message);
}

and change message. And if you want to redirect to same product page then system >> configuration >> sales >> checkout Expand "shopping cart" tab and set "NO" to "After Adding a Product Redirect to Shopping Cart".

1

For Magento 1

Go To

System > Configuration > Sales > Checkout > After Adding a Product Redirect to Shopping Cart set this option to No

In app/design/frontend///template/catalog/product/view.phtml move below line

<div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>

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.