• Resolved thomasv85

    (@thomasv85)


    Hi There,
    Is it possible to clear the cache after a customer has bought a product?
    Other wise a product that is out of stock is still available on the shop.
    Because it is still in the cache

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    This is related to Woocommerce settings rather than W3 Total Cache. Woocommerce does a great job when it comes to working with Caching plugins.
    The answer should be in Woocommerce settings so you should change the settings for quantity in stock on the product page.
    Also, please check their FAQ page related to your question.
    Thank you!

    Thread Starter thomasv85

    (@thomasv85)

    Hi Marko,
    That is not the problem.
    If 1 have 1 product in stock.
    A costumer buy that product. Then the stock is 0.
    If i look the page with no cache then don’t see the product anymore (if i’m in admin).
    If i look the page with cache on, i still see the product. But the stock is 0.
    So i don’t wanne see the product.
    Is there a option that the plugin purge the cache after a costumer buy a product?

    And is there a option the set a cronjob to clear the cache everyday at 01:00 en make a new cache automatically on 01:30?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    Thank you for the information.
    Still, I believe that this can be solved in Woo settings. But yes, of course, you can just add a custom action which is called by a cronjob. That custom action contains a call to w3tc_flush_all();
    As for the new cache, you can use Cache Preload in Performance>Page Cache and you can also create a custom cronjob to prime the cache.
    Thank you!

    Thread Starter thomasv85

    (@thomasv85)

    Marko,
    The link you earlier send is for the plugin Product Bundles. Or i’m wrong?
    What do you think must be the solution?

    En do you know the wright setting for the cronjob in cpanel tot purge the cache every night en preload the cache ever night?

    i already set some settings for your preload in your plugin.
    Is this the wright way?
    https://prnt.sc/s2rds6

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    For more assistance with the Woo settings, I would suggest that you drop them a note and check how this can be solved.
    You should check with your host as they can assist you with the corn job on the server.
    As for the Cache Preload, yes those settings are fine (default). Still, you need to add the sitemap to the Sitemap URL: it can be generated from Yoast.
    Thank you!

    Thread Starter thomasv85

    (@thomasv85)

    I just set the site map.
    w3tc flush all(); is to clear the cache.
    wich command can i use to make the preload in a cron job?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    Thanks for the info.
    No command needed, the preload starts when the page is visited so simply create a cronjob to run every E.G. 10 mins to visit the page:
    */10 * * * * wget -q -O - https://www.example.com/ >/dev/null 2>&1
    Thank you!

    Thread Starter thomasv85

    (@thomasv85)

    then i have to make a cron for every page?

    and what must be the cron for w3tc flush all();

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    No not for every page. When the corn is filled the Preload will start.
    As for the cache flush the best thing is to use wp-cli command:
    wp w3-total-cache flush all
    and trigger WP-CLI Commands to Run from Cron from your wp folder
    Please check with your host regarding the location of the folder. The command should be something like this:
    * 1 * * * /usr/local/bin/wp --path=/var/www/html wp w3-total-cache flush all

    Thank you!

    Thread Starter thomasv85

    (@thomasv85)

    What do you mean with;
    No not for every page. When the corn is filled the Preload will start.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @thomasv85

    Sorry, it was a typo. When a cron is fired the preload will start.
    Thanks!

    Thread Starter thomasv85

    (@thomasv85)

    So i only have to visit the home page en then all the pages will be cached?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    No, the cron will do that for you so you do need to wait for the cache to be cleared.
    Thanks!

    Thread Starter thomasv85

    (@thomasv85)

    Hi Marco,
    Unfortunately we can’t get the cron set.
    The host says it probably doesn’t support the wp-cli plugin.
    How can I make this work?

    Thread Starter thomasv85

    (@thomasv85)

    Marko,

    Is there a option to exclude a js file in browser caching / page caching?

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Woocommerce after sell’ is closed to new replies.