• Resolved jwjo

    (@jwjo)


    Hi there,

    I just wanted to say thank you for such an excellent and easy to use plugin.

    I recently noticed that the product stock status is not updated even after the product is actually out of stock. On the website (front end), it’s still showing the product as ‘available’ although it’s already sold out. But when a user tries to add the product to cart, it won’t work, saying the product is out of stock.

    I guess this problem is due to the cache? Is there any way for the cache to be refreshed when a product has sold out to prevent confusion amongst customers? At the moment, I’ve manually purged the cache to force it to generate a fresh copy.

    Please advise… thank you.

    Kind regards,
    E

Viewing 5 replies - 1 through 5 (of 5 total)
  • @jwjo

    You’ll have to use the filter outside the hook function call.

    
    add_filter( 'wpo_purge_all_cache_on_update', '__return_true' );
    

    So it will purge all the cache whenever you update the post/page or create a new post/page.

    If you have any more questions, please feel free to write back to us.

    Thread Starter jwjo

    (@jwjo)

    Hi Harshad,

    Thank you so much for your quick reply.

    But I am using Woocommerce to manage my products and inventory. When it’s sold out, it’ll automatically change the stock status to ‘out of stock’ or ‘unavailable’. I’m not actually updating/creating a new post/page.

    Hope I am making sense.

    Thanks again.

    Kind regards,
    E

    @jwjo I think in this case you’ll have to manually purge the cache from WP-optimize > Cache.

    Thread Starter jwjo

    (@jwjo)

    Hi Harshad,

    Thanks for your reply. You mean to say that each time a product sells out on my shop, I will need to manually purge the cache?

    Wouldn’t your plugin be able to automatically force the cache to be purged, so that the user sees the most updated stock status and not the outdated cached version?

    Thank you.

    Kind regards
    E

    @jwjo It usually updates the stock and shows updated inventory, but in your case its not working, so i suggested you to manually purge the cache each time the stock in updated.

    Have you performed a conflict test yet?

    Try deactivating all plugins except for WP-Optimize and WooCommerce and see if it is resolved.

    If so, reactivate each plugin one at a time until you find the culprit. You can check for the issue between activating each plugin, so you can see which one is causing problems.

    Please let us know your findings.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product stock status not updated’ is closed to new replies.