Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 New order - zero items in cart loop
Author « Topic »  

Bird on the Hand
New Member

91 Posts

Posted - 03/25/2023 :  03:37:14  
I had a call from a customer who couldn't complete his purchase. He had got into a loop that kept saying zero items in cart although if he went back and added more he could see the number and value of items increasing on the summary screen after adding another item.

I managed to replicate this by selecting a product, selecting options then pressing the checkout button at the top right before selecting "add to cart"

Ecommerce Plus PHP v7.4.11
I see there is an update available. Has this been fixed.

feel free to try it on product https://www.birdonthehand.co.uk/proddetail.php?prod=falconryadven

Vince
Administrator

42466 Posts

Posted - 03/26/2023 :  06:08:01  
Hi there
Looking at the headers it seems that there is caching on the cart page as here...
http://tools.seobook.com/server-header-checker/?url=https%3A%2F%2Fwww.birdonthehand.co.uk%2Fcart.php&useragent=8&protocol=11
Cache-Control: max-age=2482,

What I did to test this was add products to the cart and I see nothing on the cart page. But then if I add a parameter to the query string it makes the browser believe that it's a different page so doesn't use the cache...

https://www.birdonthehand.co.uk/cart.php?a=1

Now I can see the cart items. Could you get in touch with your host and see if they can sort this out for you?

Vince


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Bird on the Hand
New Member

91 Posts

Posted - 03/26/2023 :  06:42:37  
I wondered if it was cache - we have just started using w3 total cache

They have an option:
Never cache the following pages:

wp-.*\.php
index\.php
proddetail\.php >>> Ihave added the last two.
/.*proddetail.*

Always ignore the specified pages / directories. Supports regular expressions (See FAQ)

I have purged the cache and tested. first time through it is ok, closed the tab and started again and get the problem.

Can you suggest a "regular expression" that will encompass all product pages or do I need to raise it with W3

Their FAQ details

Examples (Never cache the following pages):

Do not cache page/directory and sub pages: /directory*
Do not cache pages under a directory: /directory/.+
Do not cache pages that contain specific text: /.*text.*
Do not cache pages that is named child in directories: .+/child
Do not cache any pages named child */child
Note: To disable page caching of specific theme templates or plugin files you need to add define('DONOTCACHEPAGE', true); to it.

I thought that your support team being so clever might just know the regular expression to use. Any suggestions I can try and test them.

Thanks Andrew

Bird on the Hand
New Member

91 Posts

Posted - 03/26/2023 :  06:49:44  
I think I have fixed it by also adding the line
cart.php

to the
Never cache the following pages:

Thanks for your help

Vince
Administrator

42466 Posts

Posted - 03/26/2023 :  09:09:08  
Hi there
I think that is a good step to put the cart.php page in the never cache. But really, for a dynamic website you are asking for all kinds of problems when you start caching. Maybe for amazon with the millions of hits it gets per minute it would be worth it but for most sites just set all *.php page to not cache.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Bird on the Hand
New Member

91 Posts

Posted - 03/26/2023 :  09:15:26  
Hi Vince

Thanks
I'm not great on these regular expressions. Would
.*/.php
be correct?

Vince
Administrator

42466 Posts

Posted - 03/29/2023 :  00:11:30  
quote:
I'm not great on these regular expressions. Would
.*/.php
be correct?
I think that should probably be something more like...

.*\.php

Vince


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000