I am trying to sort products by price, display products that are on sale, and hide out of stock products.
I am using a plugin to bulk import products ( BrandSync), and I have a cronjob set up that updates only the stock quantity after a period of time.
However, I cannot do any of those because WooCommerce Views filter fields
WooCommerce Product Price
Product On Sale Status
Product In Stock Status
are empty.
If i go to edit a singular product and just update it, without making any changes, to some products it does fill these fields, but on some it doesn't.
I want to let the user sort products by price(ascending/descending), to hide the out of stock products, and in a separate view to display only the products that are on sale.
What could be done in order to make any of these work?
Hi, if you go to Toolset > WooCommerce Views you will find some settings that control how these fields are updated. We have some documentation about the different options here: https://toolset.com/documentation/user-guides/woocommerce-views-calculated-fields-and-batch-update/
Let me know if you have additional concerns about that.
I've used both the Manually, and WordPress cron options. There are products which have 0 stock in all variations, but still show appear in stock. e.g. : hidden link
I've left a debugging note after the product's description which shows if a product is in stock or not, and it shows that the product is in stock, even if the product has 0 stock.
Let me get the most accurate information about this. Our documentation doesn't describe in detail how variable products in-stock status is calculated, if at all. I'll let you know what I find out.
https://toolset.com/documentation/user-guides/woocommerce-views-calculated-fields-and-batch-update/#wcv-use-calculated-filters
Based on the information I have received, the calculated Product In Stock status should be 0 if none of the variations are in stock. I can see it's not behaving this way on your site. If you approve, I can make a clone of the site using the Duplicator plugin and run some additional tests on my local environment. We can try to determine if there is a bug or a conflict with another system.