I can’t get WPAI to import _stock_status
-
Hi, I am using WPAI with WooCommerce add-on with a simple logic. If my
{stock[1]}
XML node is 0, then I set the Stock status to'outofstock'
, else I set it to'instock'
.This is the function call in my WPAI import settings for Stock status field (set with XPath):
[custom_stock_status({stock[1]})]
And this is the function:
function custom_stock_status($stock) { if($stock > 0) { return 'instock'; } else { return 'outofstock'; } }
It works well on first run, but every other run of the import seems to completely ignore Stock status.
These are my custom fields import settings:
Custom fields -> Update only these Custom Fields, leave the rest alone: _stock_status
However, the plugin is displaying this red notice:
“As of WooCommerce 3.0 stock status is automatically updated when stock is updated.”
I think it has to do something with the notice. It’s probably somehow trying to set the stock status automatically, but I am not setting exact stock values, I also have Manage stock set to “No”. Also, in the import log I don’t see any messages regarding ‘_stock_status’ whatsoever.
What is the issue here?
- The topic ‘I can’t get WPAI to import _stock_status’ is closed to new replies.