Cart "continue shopping" return URL problem

dragon-fire
Contributor
Contributor

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?

Login to Me Too
9 REPLIES 9

marpleweb
Contributor
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?

Login to Me Too

Tatt00edAngel
New Community Member

Me too! Help!!!

Login to Me Too

dragon-fire
Contributor
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!

Login to Me Too

marpleweb
Contributor
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?

Login to Me Too

dragon-fire
Contributor
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.

Login to Me Too

dragon-fire
Contributor
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.
Login to Me Too

clayman2
Contributor
Contributor

i have two url's one is my home page and one is for my newsletter group specials.. problem is when customer adds a product to cart from nl group page and they hit 'continue shopping' to add another product it takes them to my home page instead of nl group page..  problem because the home page has lost its add to cart buttons AND has some different prices than the nl group page.. plus customer can't complete their order... how to redirect the continue shopping click to my newlsetter group page .. and do i do it in my paypal account , if so , how, or do i need to call go-daddy? please advise as i am losing sales due to this and paypal merhant services did reply with how to but can't figure out how to do what they say...  paul   and email is 

Login to Me Too

dragon-fire
Contributor
Contributor

Hi Paul,
What I did was put this script like this in the header of the home page:
<script ="javascript" type="text/javascript">
var url = 'https://www.[your-nl-page.html]"

if (window.history.length > 2) {
window.location.href = url;
}
</script>

In your situation, you would replace the [your-nl-page.html] with the URL of your nl page.
Once someone has been to your site's home page, this script will redirect  (or forward) any returns to that page to that newsletter page.
There may be another way to do this through the PayPal site, but this works just fine without the hassle of trying to find out where to do that on their site.
If the home page is not the page that PayPal returns you to, simply put this code in the header of whatever page PayPal returns you to. That will see that the browser ends up back at your nl page.
Good luck!
Art

Login to Me Too

clayman2
Contributor
Contributor

thanks, Art and I will try this later today or tomorrow and let you know how it comes out- paul 

Login to Me Too

Haven't Found your Answer?

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