Hello,
Do you have your Woocommece Settings > Products > Enable AJAX add to cart buttons on archives unchecked/turned off?
I do facing similar issue where the CF is caching the add to cart Ajax request. Hence I have it turned off.
However, it seems like this issue is theme/plugin related. I have another website runs on different theme and identical plugins but with Ajax turned on. CF didn’t cache the Ajax request.
Use the page rule feature to set cache level: ‘standard’ or ‘bypass’ for the
https://example.com/cart/
this shall help.
Plugin Contributor
iSaumya
(@isaumya)
Hi @littleeloo,
When looking at your website thoroughly, I found a wired issue that there is no cache-control header being added to your pages: Screenshot: https://i.imgur.com/jFkAyUh.png
I can see the problem across all of your pages and this is what causing the issue as Cloudflare expects a cache-control header.
When you push the “acquire artwork” button you get the woocommerce error: “You cannot add another “xxxxxx” to your cart” Even when the cart is empty. (I have products that are sold once, 1 in stock or sold status).
– If you have limited stock then you should never cache the product page which shows all of your artwork as even after the item is sold and there is no stock left, it will continue showing the cached page. Inside the Third Party tab for woocomerce you can select the checkbox for is_product.
And last but not least. Images in the slider on the single product page are blurry (not the first but the others are).
– This is not related to the plugin as the plugin does not alter any image URL just ensures that the images are served over CDN.
It would be great if you enable the plugin properly on your site and then we can go page by page seeing the issues. Sorry for the delayed reply. I might not be available this week much, but will be available in the coming week.
Hi there,
Thank you all for having a look, I appreciate it!
@arusstel : Woocommece Settings > Products > Enable AJAX add to cart buttons on archives unchecked/turned off? Yes! This was and still is turned off.
Gulshan Kumar: I have added another page rule before to the cache al ru;e the plugin creates. This seems to help on first few checks. But it should be done by the plugin if I am correct?
@saumya Majumder:
I have done as you told, thank you.
The plugin was turned of. Now with plugin back on the cache control header is send. ( I had disabled all other caching as is advised in the plugin, but did not turn those back on after deactivating the plugin, that’s why I think no cache-control headers were send).
In the Third Party tab for woocomerce I have selected the checkbox for is_product.
I still get the message: “You cannot add another “xxxxxx” to your cart”.
Also after activating the plugin the slider is Blurry again with al images except the first one. Not sure what to do here.
I left the plugin on for now. Thank you so much.
I will deactivate the plugin later on today, my website images are blurry and seems to load slow now, so I am not comfortable leaving it like this for long 😉 .
Thank for the help! 🙂
Cheers,
Jessica
Plugin Contributor
iSaumya
(@isaumya)
Hi @littleeloo,
As you have turned on the plugin now as I can see all of your pages are being cached properly. Your /shop
page is also being cached. As well as your single product page.
When I click on square artwork, I do see the issue. Can you tur on Ajax Mode again? Just so that I can test?
BTW I’m not having any blurry image issue: https://i.imgur.com/UMJH5ir.png
-
This reply was modified 2 years, 3 months ago by
iSaumya.
Hi @saumya,
You mean ” Enable AJAX add to cart buttons on archives” woocommerce settings?
I jhust turned it on.
Thanks
Plugin Contributor
iSaumya
(@isaumya)
Hi @littleeloo,
As I do not know how you have coded the implementation of redirecting the user to the checkout automatically (as I have a similar thing on my site without any issue).
So, for your case without looking into anything further the easier option would be to turn off that Ajax Mode again and inside the plugin settings, under turd party tab for Woocommerce enable the option to not to cache is_product()
.
@saumya
I have turned Ajax back on and still in the Third Party tab for woocomerce I have selected the checkbox for is_product.
It still is giving the errors.
And the cart is still being cached I notice 🙁
Plugin Contributor
iSaumya
(@isaumya)
Please clear the cache after making the changes.
@saumya I did 😉 both plugin, and browser incognito
And the cart is still being cached I notice
Can I ask, what steps shall I follow to see that cached page?
So far, I can see like this
Request URL: https://www.example.com/cart/
Request Method: GET
Status Code: 301
Remote Address: [2606:4700:8d9e:12d5:6dd7:11f:cd88:32f3]:443
Referrer Policy: strict-origin-when-cross-origin
age: 390
cache-control: max-age=3600
cf-cache-status: HIT
Ref: https://i.imgur.com/EU0NTX7.png
Here, cf-cache-status: HIT
for 301 which sometimes appears is completely normal, if you really need to bypass cache for this redirect response then Page Rule what I suggested in first reply is a way.
Plugin Contributor
iSaumya
(@isaumya)
I’ll check tomorrow morning. It’s quite late here. It’s really hard to check it like this without having any internal access to the site and seeing the code & implementation.
I’ll take a look tomorrow morning and will let you know.
@thegulshankumar
I do not have a cart page. My cart and checkout are in a single page checkout.
Plugin I have for this: https://wordpress.org/plugins/add-to-cart-direct-checkout-for-woocommerce/
The cart page is disabled.
Single page checkout is enabled.
I have redirect on cart enabled, to page Checkout.
I have a page rule on cloudflare:
https://www.littleleloo.com/checkout/
Cache Level: Bypass
Thank you 🙂
-
This reply was modified 2 years, 3 months ago by
littleeloo.
Thanks again @isaumya
Sweet dreams 🙂
-
This reply was modified 2 years, 3 months ago by
littleeloo.