Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Can "Continue Shopping" Button be linked to what they visited last?
Tagged: continue shopping, shopping, shopping cart
- This topic has 12 replies, 5 voices, and was last updated 9 years, 2 months ago by shinzen.
-
AuthorPosts
-
December 13, 2010 at 3:15 pm #2382lovinwordpressMember
Hello, it seems you need to provide a “Product Page” for the Continue Shopping button to work. Can it instead be linked to the last product page they were looking at? And if so, how or what code should I be inputting into the “Product Page”? Thank youc
December 14, 2010 at 1:31 am #27393amin007ParticipantUpdate: There is now an option to easily achieve this without modifying eStore code. Simply add the following code to your theme’s functions.php file and that will do it:
add_filter('eStore_cart_continue_shopping_url_filter','eStore_continue_shopping_url_mod');
function eStore_continue_shopping_url_mod($continue_shopping_url)
{
$continue_shopping_url = $_SESSION['eStore_last_item_add_url'];
return $continue_shopping_url;
}=====================================
There is no option in the settings to do this but a code tweak should do the job. I will look into it.
December 14, 2010 at 8:55 am #27394lovinwordpressMemberthank you, can’t wait:)>
January 28, 2011 at 5:52 pm #27395lovinwordpressMemberhello amin007,
Still interested in the code tweak you were talking about:)>
January 29, 2011 at 4:50 am #27396amin007ParticipantOpen the “eStore_cart.php” file and search for the following:
<a href="'.$products_page.'">
When you find it replace it with the followoing:
<a href="'.$_SESSION['eStore_last_item_add_url'].'">
February 1, 2011 at 11:03 am #27397lovinwordpressMemberHi Amin,
thank for getting back to me on this, much appreciated
I’ve found that there are 2 lines where that code exists so I’ve replaced them both with the new line of code.
However, it is working on the product link that was last added to the the shopping cart but not on the “continue shopping” button itself.
Probably just need to place the code somewhere else? thanks again
February 2, 2011 at 3:21 am #27398amin007ParticipantYou only need to change the ones that are inside the following if statement which will only affect the continue shopping part:
if (get_option('eStore_display_continue_shopping'))
February 9, 2011 at 10:44 am #27399lovinwordpressMemberHello Amin,
Thanks again for your help.
Yes, I have done what you’ve mentioned and even checked to make sure it only applied for the:
if (get_option(‘eStore_display_continue_shopping’))
but it seems to be applying it to the items under “Item Name” and not the “Continue Shopping” button which is what I intended.
hmmm…I wonder what’s going wrong…
Thanks again
February 25, 2011 at 7:15 am #27400lovinwordpressMemberhello again,
The request of having the “Continue Shopping” to be linked to the last page they’ve visited still hasn’t really been fulfilled yet. I suppose it’ll be all too confusing if I can’t show it.
Please visit:
[www.thepharmacyoutlet.com.au]
and click on any of the product’s “buy now” button on the homepage and you’ll see what I mean…
The method seems to work but it is showing up at the “Item Name” and not at the “Continue Shopping” button itself. Here’s a screenshot of what I mean:
I sort of given up and wanted to just revert back to how it was since it wasn’t working out…but then now I can’t seem to revert back to how it was originally whereby when you clicked on the product name in the cart, it’ll take you to the product’s page. But now when you clicked on the product link in the cart it takes you the last page that a buyer has clicked the “Add to Cart” from.
Here’s the scenario:
My products are categorised and are displayed on category pages and on the home page as well using the shortcodes supplied by wp_estore.
I also use the “Extra shortcodes plugin”.
Therefore, the same product can appear in 3 separate pages, with an “buy noe” button. One at the home page, one at the category page and another on its own individual product page.
Therefore if someone clicked on the “buy now” button in the category page, the page will reload and they will see their product added in the cart. However, the product name doesn’t go directly to the individual product page anymore, it links back to the category page. And if someone clicked on the “buy now” button from the homepage, the product name links back to the homepage instead of the individual product page.
I don’t know what is going on but I’ve used Firebug to see what’s up and hopefully will make sense to you because it doesn’t to me:
[http://i349.photobucket.com/albums/q391/testcubaan/firebugindicationfromproductlinkoncategorypage.jpg]
I’ve even upgraded to the latest wp_estore 4.9.6 to see if it would revert if I reset the settings but that didn’t help. I’m also using wp_emember with this plugin.
Ideally I would still want the “Continue Shopping” button to reflect the last page they had visited but if that can’t be done please help to restore the product name link to link to its own individual product page.
thank you again!
February 26, 2011 at 1:50 am #27401amin007ParticipantIt is beyond our capability to guide you through custom modifications. We do give our customers indication of what file to modify for a tweak but it is impossible for us to support a plugin with custom modification because too many things can go wrong when some code is modified in the plugin.
The easiest way to get back to square one is to get a fresh build of eStore from here:
https://support.tipsandtricks-hq.com/update-request
Then use the “Reset eStore settings to default” option from the “Admin functions” menu.
March 3, 2012 at 10:34 am #27402sourceflixMemberI was searching the forum for a solution to the same thing this previous poster requested: “continue shopping” button to return to last page instead of product page. I followed the instructions you gave to the original poster and it worked for me. There were two instances where I needed to change the code in the php file. I’m using WP eStore version 6.4.8. Just for anyone else searching for a solution to this problem. It works!
December 14, 2013 at 4:53 pm #27403mssbeeMemberI inserted the code from the Update in my child theme and the continue shopping button still directed to the products/shop page. I am missing a step?
September 24, 2015 at 8:23 pm #27404shinzenMemberHello! But if you want the continue shopping button be linked to what they visti last? not the last product link, but yes the last page or post visit. maybe you have a category products list in a page and the customer press the button add to cart in a product listed. I want to linked the continue shopping cart to this last page visit.
Any help?
-
AuthorPosts
- You must be logged in to reply to this topic.