Forums / General Questions / "Continue Shopping" link not working when coming from the product listing page

"Continue Shopping" link not working when coming from the product listing page

Locked

Started by nigelt74 on 30 Jul 2007, 8:37 AM · Views: 5,080

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
30 Jul 2007, 8:37 AM
#1
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

"Continue Shopping" link not working when coming from the product listing page

"Continue Shopping" link not working when coming from the product listing page,

exactly that,

If I select some products on the products listing page and add them to the cart and then press the continue shopping button I get taken to the shops index page,

If i go to a product page and add it to the cart and then click continue shopping I get taken back to that products page

Is there someway to fix this

as I can't figure out why it isn't passing the referring url to the button

Any help would be massively appreciated

Webzings Design
Semi retired from Web Design

31 Jul 2007, 3:25 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

The Continue shopping returns to the previous page when the navigation knows where to go ... if it gets lost, then it returns to the home page ...

If you click on a few Categories then do a listing ... you will probably find the navigation is working ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Jul 2007, 5:52 AM
#3
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Hi Ajeh

I hate say this

But

no matter what I try I cannot get the Cart to return to the "product listing" page it came from

The cart always returns to a product page if it has come from one with no problems

Just in case i am messing up the terminology and not calling the page by it's correct name

What i refer to as the product listing page is the one were multiple products are listed

eg
Product listing page click

What i refer to as a product page is the page that has only the one product on it

Product page click

What is the variable I should be checking to see what/if anything is being passed to the cart in regards to the referring page

Webzings Design
Semi retired from Web Design

31 Jul 2007, 6:42 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: "Continue Shopping" link not working when coming from the product listing page

What version of Zen Cart?
What addons/contributions have you installed?
What versions of Zen Cart have you upgraded from?
What customizations have you made to your site?
What version of PHP are you running on your server?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Jul 2007, 8:23 AM
#5
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

What version of Zen Cart?
1.3.7
What addons/contributions have you installed?
Image handler
wishlist
google sitemaps
Captcha
What versions of Zen Cart have you upgraded from?
I haven't this was a fresh install
What customizations have you made to your site?
No changes on the product listing or cart page
None on the product listing page
What version of PHP are you running on your server?
PHP Version 4.4.7
MySQL 4.1.22-standard

Thanks

Webzings Design
Semi retired from Web Design

1 Aug 2007, 9:42 PM
#6
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Ok I'm back and i still haven't managed to sort this problem out yet

I have found that it isn't just me

I looked at a couple of stores in the showcase

monkeying around

and

Wotatime

and they both had the same issue and from what i can tell from the front end there doesn't appear to be any commonality between the mods installed (at least those that you can tell on the front end)

Webzings Design
Semi retired from Web Design

10 Sep 2007, 2:00 AM
#7
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Hi Dr Byte, Ajeh

what piece of code/variable handles this function and could I possibly get a link to a site that this works correctly on, as all the sites i have tested seem to have the same issue

I am not sure if it is a case of me explaning this badly or i am misinterpreting how the function is supposed to work but...
The page i am calling the Products listing page is the one that appears when you click on a category and it has a list of multiple products with a little box next to each product where you specify the amount you want of the product and then you click the add selected products to cart button (located above the products list) and it adds those products to the cart, then once you are in the cart you click on the Return to shopping link and instead of taking you back to the product listing page it drops you on to the sites index page.

Surely i am not the only person who is having this problem, personally I never noticed it until a couple of people contacted me about it and now it frustrates me, don't get me wrong I am not trying to have a go at anyone but i can't figure this out

I am assuming that the shopping carts return to shopping function is reliant on the referring page sending a Product id, which will work when you come from a product page but not if you come from a product listing page where there is no actual product id in the referrer

My semi-cunning plan is that if there is no product id, I will make it instead use the category ID, however that is probably fraught with issues because if the products listing covers multiple pages, they will always end up on the first page

Webzings Design
Semi retired from Web Design

18 Sep 2007, 9:53 PM
#8
sirbuck avatar

sirbuck

Zen Follower

Join Date:
Jan 2007
Location:
Carlsbad, CA
Posts:
161
Plugin Contributions:
0

Re: "Continue Shopping" link not working when coming from the product listing page

Im having the same issue with this. From the product detail page, its fine. But from the product listing page...no go!

Any assistance on this would be greatly appreciated.

-Buck

9 Nov 2007, 12:26 AM
#9
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: "Continue Shopping" link not working when coming from the product listing page

I have a client reporting exactly this problem - did anyone come up with a solution?

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

14 Nov 2007, 12:32 AM
#10
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Hi Ryk

I am afraid i drew a blank when trying to solve it, i haven't actually seen a Zen cart site where this doesn't happen

sorry I couldn't help

Webzings Design
Semi retired from Web Design

14 Nov 2007, 6:48 AM
#11
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Yes you're right my site also has this bug.

I have not look throughly yet but my bet is that it has something to do with:

function zen_back_link() in general

or the value assignment for $_SESSION['navigation'] in shopping_cart module

I hope its the latter though (easier to fix). Will check on it later on this week if it hasn't been resolved by then...

Good luck in resolving this issue ;)

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

14 Nov 2007, 1:52 PM
#12
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: "Continue Shopping" link not working when coming from the product listing page

Turns out that this is a known bug - but if someone can resolve it, I'm sure that the dev team would love to have the solution. :wink:

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

19 Nov 2007, 7:49 AM
#13
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Ok I've found the problem:

Apparently there's a small logic mistake in includes/functions/functions_general.php in function zen_back_link.


HOW TO FIX

change

if (sizeof($_SESSION['navigation']->path)-2 > 0) {

to

if (sizeof($_SESSION['navigation']->path)-2 >= 0) {

EXPLANATION

the $_SESSION['navigation'] stores your link history with this structure (simplified for ease of reading):

link 0
link 1 --> the link we want to go back to
link 2 --> your current link

and zen-cart uses this code to go back to link 1:

// sizeof($_SESSION['navigation']->path) returns 3
if (sizeof($_SESSION['navigation']->path)-2 > 0) {
  //go back to sizeof(yada2) - 2 which is link 1

it looks all good, but consider this situation:

we have this history in our $_SESSION['navigation']:

link 0 --> the link we want to go back to
link 1 --> your current link

with this situation, sizeof($_SESSION['navigation']->path) will return 2, thus if we subtract that value with 2, become 0 and the link doesn't work.


NOTE

I hope this explanation is clear and easy to follow. Its not a big problem, but if you found it disturbing just follow the step I've given above.

Cheers,

Jay

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

19 Nov 2007, 9:45 AM
#14
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

btw if dev team have any feedback I'd like to hear... was the code were made like the existing for a purpose?

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

19 Nov 2007, 8:29 PM
#15
cjmarley avatar

cjmarley

Zen Follower

Join Date:
May 2004
Posts:
96
Plugin Contributions:
2

Re: "Continue Shopping" link not working when coming from the product listing page

I'm seeing the same issue. I tried the changes you gave above but it didn't change anything.

19 Nov 2007, 10:42 PM
#16
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

Oops forgot to tell you, its under function zen_back_link (). You might have changed the other function's code.

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

19 Nov 2007, 10:44 PM
#17
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

jaycode:


HOW TO FIX

change

if (sizeof($_SESSION['navigation']->path)-2 > 0) {

> 
> ```
if (sizeof($_SESSION['navigation']->path)-2 >= 0) {

The code above are located under function zen_back_link() alright

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

23 Nov 2007, 9:43 PM
#18
bifficus avatar

bifficus

New Zenner

Join Date:
Sep 2007
Location:
Vancouver, CA
Posts:
87
Plugin Contributions:
0

Re: "Continue Shopping" link not working when coming from the product listing page

I have a similar issue, but it seems to only affect me if accessing the "add to cart" button from a Review. The product goes in the cart, but when the page tries to refresh, I get a "Sorry, product not found" message and an otherwise blank center column.

I tried your suggestions, but no luck in my case. I will keep digging around, but if you have ideas... love to hear it!

You can test it here if you want: http://www.pccapital.ca/reviews/etanker-6d-portable-power-plant-14/customers-review-1.html

Thanks!

23 Nov 2007, 9:45 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: "Continue Shopping" link not working when coming from the product listing page

bifficus:

I have a similar issue, but it seems to only affect me if accessing the "add to cart" button from a Review. The product goes in the cart, but when the page tries to refresh, I get a "Sorry, product not found" message and an otherwise blank center column.

I tried your suggestions, but no luck in my case. I will keep digging around, but if you have ideas... love to hear it!

You can test it here if you want: http://www.pccapital.ca/reviews/etanker-6d-portable-power-plant-14/customers-review-1.html

Thanks!

That's a bug in your SEFU module.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Nov 2007, 2:00 PM
#20
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: "Continue Shopping" link not working when coming from the product listing page

yeah, thats not even a 'similar issue'... sorry but I never used SEFU module, can't do any bug tracking to it. You might want to start a new thread? (and cross your fingers)

good luck, no, really, good luck

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation