I'm using Octolooks Scrapes plugin for scraping products and automatically importing them to customers website. All imports are working fine, also publishing them and updating them automatically every hour... The only problem is stock!
- Products are imported correctly with meta "0" or "1" to _stock field in Woocommerce.
- Inventory managenet set on "yes".
But stock data is not recognized correctly when products are automatically published.
- Out of stock products are hidden from Shop page, but they are still counted in categories in sidebar for an example.
- Also they can not be sorted by stock in Woocommerce products dashboard...
BUT WHEN I update or in another words re-publish these same products again in Woocommerce, then all stock is set as it suppose to be. And If I would find solution to update products after they were published, It would do the trick.
On 1. image below it can be seen that product count is "0", but stock is "In stock (0)":
On 2. image - stock correctly set "Out of stock (0)" and correct product count "0" recognized also in categories
Additional info:
- It doesn't help to regenerate Lookup table
- It doesn't help to clear the product/shop transients cache