cancel
Showing results for 
Search instead for 
Did you mean: 

Cart "continue shopping" return URL problem

Options
dragon-fire
Contributor
Posted on

I have a site where I have a form set up to add items to a cart which works fine, but once the item is added to the cart and I'm taken to the cart page to view the cart, when the "Continue Shopping" button is clicked, I'm taken back to the home page of the site instead of returning to the shopping form page. I've tried several things with no success, including using the shopping cart form URL in both a return command and a redirect command ( <input type="hidden" name="redirect" value=" <Removed> " /> ), as well as using base target of "_self" in the <head> of the page that the shopping form is on.

PayPal used to return me to the shopping page but it seems something has changed on the PayPal end so that that no longer happens, returning me instead to the index/home page. Any suggestions on why, and, more importantly, how to remedy the situation?

6 REPLIES 6

Cart "continue shopping" return URL problem

Options
marpleweb
Contributor

I have just started having this problem too on several sites that were working fine and I haven't changed anything.

 

What can be done to fix this urgently please?

Cart "continue shopping" return URL problem

Options
Tatt00edAngel
New Community Member

Me too! Help!!!

Cart "continue shopping" return URL problem

Options
dragon-fire
Contributor

Finally came up with a solution. I added a small script to the head portion of the index page (site landing page) that redirects to the PayPal form submission page after the initial visit to the index page:
<script ="javascript" type="text/javascript">
var url = 'https://www.SOMEURL.org/Paypal-Form2021.html'; // you need to know where you want to redirect to before hand
if (window.history.length > 2) {
window.location.href = url;
}
</script>

Works like  a charm!

Cart "continue shopping" return URL problem

Options
marpleweb
Contributor

Good to see someone trying to fix this!

 

I don't think that will work for me as it will mean that every second visit to the home page will redirect to the shop page, which will spoil the experience for those who are using the site in other ways. Is there a way that you can invoke the redirect only if the previous page is a paypal one?

Cart "continue shopping" return URL problem

Options
dragon-fire
Contributor

There may well be. I'll see if I can figure out how to code it that way. As is, on the site I have, the index page is only landed on at the bewigging of the session. After that, all visits to the page are as the "home" page which is identical except for the redirect code and a note as to when the site was last updated.  That is to say, the visitor first arrives at the SOMEURL.org page (the index page with the code) and from then on arrives at the SOMEURL.org/Home page. 
I have a vehicle service appt today that will take most of the day, but will have a look this evening.

Cart "continue shopping" return URL problem

Options
dragon-fire
Contributor
The code I used only serves to redirect if it's not the first visit to the site at URL: SOMEUURL.org 
If you can copy all the code on your home page to a new page (i.e. saving the copy as an html file such as Home.html), and ensure that the original home page is index.html, and have any links on the site redirect to SOMEURL.org/Home, it can provide all the information and links that the original SOMEURL.org page had (given that SOMEURL.org is actually SOMEURL.org/index even though that full URL doesn't appear in the URL browser address bar).
With the code I provided in the index.html page ONLY, PayPal's redirects to your index page will in turn be redirected to your PayPal form page.
You can then navigate your site as usual since the user won't see the index page again until they close the browser and open the link to your site (SOMEURL.org [which is actually SOMEURL.org/index]) at which point the code won't redirect since the window.history.length is less than 2. Once they've been on the site, any returns to your home page are to the home page at SOMEURL.org/Home which doesn't have the redirect code on it.

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.