• Resolved jamalalloh

    (@jamalalloh)


    hello

    thank you for the great job.
    when visitor add a product to cart is showing confirm adding but its not found in cart page. if the user logged in there is no issue.
    after disable the pages cache from this plugin all work ok for visitors and logged in users.
    can you help to solve it and get pages cache working.
    please note that cart page excluded from caching in third party settings/woocommerce.

    • This topic was modified 3 years, 4 months ago by jamalalloh.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    It seems your site has been coded in a way which uses cookies to store and fetch the items that users has been added to cart: https://i.imgur.com/AGSnGko.png

    Instead of using ajax to do that it it has been done in the Storefornt theme and is recommended by Woo Team. Take a look at: https://woocommerce.com/document/show-cart-contents-total/

    But when caching is involved things changes if you are relying on cookies. For example if a page has cookies in it from the beginning CF won’t cache that page as soon as it sees the page response has set-cookie.

    But when a page loads without any cookies in them like your product pages, CF will cache them. Then someone clicks on add to cart which creates the cookies but as the page is still cached in Cloudflare, it will still provide the cached page.

    You can try enabling the Worker Mode inside the plugin as it will solve most of your issues but it is not 100% free as Cloudflare provides 100,000 requests per day for free after that it is chargeable. Know more here: https://developers.cloudflare.com/workers/platform/pricing
    https://workers.cloudflare.com/#plans

    Thread Starter jamalalloh

    (@jamalalloh)

    hi saumya
    thank you very much for the great information.
    i enabled “use Ajax with add to care” on woocommerce settings then i enabled page caching and tried.
    essentially its worked well i will monitor that and update you later.
    kind regards

    Thread Starter jamalalloh

    (@jamalalloh)

    i did test cache now i got the following error: (`Page caching seems not working for both dynamic and static pages.

    Error on dynamic page (https://lazared.com): Cache status: DYNAMIC – The resource was not cached by default and your current Cloudflare caching configuration doesn’t instruct Cloudflare to cache the resource. Instead, the resource was requested from the origin web server.

    Error on static resource (https://lazared.com/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Unable to find the Cache-Control response header.` )

    i inspected the site its showing cf-cache-status: DYNAMIC.
    any advice please to get test pass again?
    thank you
    kind regards

    Plugin Contributor iSaumya

    (@isaumya)

    Hi, can you share a screenshot of your Cloudflare Dashboard Page rules section?

    Thread Starter jamalalloh

    (@jamalalloh)

    look here please

    View post on imgur.com

    • This reply was modified 3 years, 4 months ago by jamalalloh.
    Plugin Contributor iSaumya

    (@isaumya)

    where?

    Plugin Contributor iSaumya

    (@isaumya)

    OK. I saw the screenshot and it is not the rule that the plugin has added. Delete that rule as you don’t need it. Then inside the plugin settings page click on Disable Page Cache and then Enable Page Cache so that the plugin can create it’s own page rule that is needed. Do not tinker with the page rule that the plugin adds. You probably won’t need any other page rule beside the one the plugin adds.

    Thread Starter jamalalloh

    (@jamalalloh)

    got it thank you i will do it now

    update
    all completed and working well. thank you for all efforts.

    kind regards

    • This reply was modified 3 years, 4 months ago by jamalalloh.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Add to cart not working’ is closed to new replies.