How do you set the URL that the continue shopping button sends the user to from the Shopping Cart page, On my installation it goes back to the /index.php page.
There is a call to $this->getContinueShoppingUrl() in cart.phtml, which looks like it calls getData with “continue_shopping_url”, not sure where this goes.
Did you find a solution for this issue?
I encounter the same problem. The “continue shooping” button redirects to the index page instead of the product last viewed.
The file outlined here is different than the one included in version 1.1.6. Does anyone have details for a solution in the current version?
In certain cases the continue shopping button takes me to the home page of the site and other times it takes me to an item details page. I want it always to go to a specific category page.
The file outlined here is different than the one included in version 1.1.6. Does anyone have details for a solution in the current version?
In certain cases the continue shopping button takes me to the home page of the site and other times it takes me to an item details page. I want it always to go to a specific category page.
These notes refer to 1.1.8, but may help other versions.
If you have a valid session, the getContinueShoppingUrl() value will be the page that you were on prior to adding something to your cart. If you add an item to your cart from the product’s page, you’ll return there. If you added an item from a catalog view, category or filtered list, you should return there as well.
If you click into your shopping cart using the top links or other path that does not include adding an item to your cart, then by default the “continue shopping” button will take you back to the site home page. If you want to change that behavior to go to a specific page, you’ll need to modify the following file:
app/code/core/Mage/Checkout/Block/Cart.php
If, for instance, you want to direct visitors to your “Products” category, defined with the URL string “products”, modify the getContinueShoppingUrl() values to look like the one shown below:
public function getContinueShoppingUrl() { $url = $this->getData('continue_shopping_url'); if (is_null($url)) { $url = Mage::getSingleton('checkout/session')->getContinueShoppingUrl(true); if (!$url) { $url = Mage::getUrl('products'); } $this->setData('continue_shopping_url', $url); } return $url; }
The change is to this line:
$url = Mage::getUrl(’products’); to include “products” where it was formerly blank.
The file outlined here is different than the one included in version 1.1.6. Does anyone have details for a solution in the current version?
In certain cases the continue shopping button takes me to the home page of the site and other times it takes me to an item details page. I want it always to go to a specific category page.
These notes refer to 1.1.8, but may help other versions.
If you have a valid session, the getContinueShoppingUrl() value will be the page that you were on prior to adding something to your cart. If you add an item to your cart from the product’s page, you’ll return there. If you added an item from a catalog view, category or filtered list, you should return there as well.
If you click into your shopping cart using the top links or other path that does not include adding an item to your cart, then by default the “continue shopping” button will take you back to the site home page. If you want to change that behavior to go to a specific page, you’ll need to modify the following file:
app/code/core/Mage/Checkout/Block/Cart.php
If, for instance, you want to direct visitors to your “Products” category, defined with the URL string “products”, modify the getContinueShoppingUrl() values to look like the one shown below:
public function getContinueShoppingUrl() { $url = $this->getData('continue_shopping_url'); if (is_null($url)) { $url = Mage::getSingleton('checkout/session')->getContinueShoppingUrl(true); if (!$url) { $url = Mage::getUrl('products'); } $this->setData('continue_shopping_url', $url); } return $url; }
The change is to this line:
$url = Mage::getUrl(’products’); to include “products” where it was formerly blank.
Hope this is helpful!
Careful with that one ... it’s if there is no URL, so if users are coming from a product page to the cart and click “continue” they will be redirected back to the product page anyway [because they have a return url] this way does work for users who click on the “my cart” then continue - then they are redirected to whatever page you specify here....
So if you want them to always goto a different page - remove the conditional.
I see the issue here has been resolved, but under System -> Configuration -> Web -> Unsecure tab, couldn’t you just change the “Base Link URL”? It seems nicer to do that than go all the way into the code. The only issue i’m seeing is you have to have the Search Engines Optimization -> Use Web Server Rewrites turned on.
Nevermind, i see that changing that Base Link URL breaks links to things like the checkout, etc.