Soo.. I’ve created CRON script, that each 1 minute retrieves an actual stock systems data, converts it for WordPress/Woocommerce database table and updates stock.
On database side everything looks right and works (see 1st screenshot), but in WP Admin Panel only parent/main variable product inventory data shows as updated – it SUMS all variation STOCK quantities (see 2nd screenshot). However he STOCK quantity data in Variations section for different sizes doesn’t seem to be updated (see 3rd screenshot).
Soo I was wondering.. is there some kind of Caching that WooCommerce is using? And if so.. how can I clear it? Because so far I’ve cleared all the cache there is, but Variation stock still stays 0.
Screenshots & Descriptions
Database after update – Stock CRON script updates Variation stock (double checked, works for all Variations and main parent Variable product Inventory STOCK – it sums all Variations STOCKS)
Product variation after update – Stock CRON DID update this value, but it still shows 0.
Variable/Parent product after update – Stock CRON did update the stock – SUMS up all variations STOCK quantitys and updates it here.
I’ve double checked everything. CRON script is fine – as you can see from screenshots it does update data in database. The issue here is only that it doesn’t show it in front for Variations of products.
A help would be much apreciated! 🙂 Thanks in advance.
1 Answer
After some hours of investigation I deactivated W3 Total Cache plugin. Still no changes. And then I noticed WP Redis plugin.. soo I searched for Redis Object Caching on serverside and found it. When I flushed the cache, the stock showed updated stock quantity.
Soo.. always double-check your caching. 😀