Skip item that not in stock, instead of using the ‘Hide Product’ feature
-
Hi Ido,
First, as I said in my review – thanks for ur great plugin, works perfectly!
I have a question that I need ur help with products that aren’t in stock in shop, hope u can help me with that.
I’m trying to automate the get_products() function and to get the stock status from Woo, then to use this value to skip this product programmatically in the function if the product is out of stock, instead of ticking the checkbox ‘Hide Product’ per product.I can get the stock status with get_stock_status(), and I believe I need to make this checking in get_products() function, before creating the XML function as I don’t want to send this specific product to the XML.
Can u help me with the placement of this If statement to achieve this idea in ur code?
I believe it should be placed near line 523, as I can see ur checking if item is disabled:'meta_query' => array( 'relation' => 'OR', array( 'key' => '_wc_zap_disable', 'value' => 'yes', 'compare' => '!=' ), array( 'key' => '_wc_zap_disable', 'compare' => 'NOT EXISTS' ) )
Thanks a lot!
Ofir.
- The topic ‘Skip item that not in stock, instead of using the ‘Hide Product’ feature’ is closed to new replies.