[rest-api] setting product stock status to a custom status
-
Hello,
I am using the REST API (through PHP package) to update/create new product.
I defined in a filter function a new custom stock_status.
But trying to update to this new status is not possible.In
WC_Product::validate_props, the status is always (re)set:if ( $stock_is_above_notification_threshold ) { $new_stock_status = 'instock'; } elseif ( $backorders_are_allowed ) { $new_stock_status = 'onbackorder'; } else { $new_stock_status = 'outofstock'; } $this->set_stock_status( $new_stock_status );So, how can I add my custom status ? Is there a safe way to do that without using a standalone plugin ?
Thank you, Nicholas.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘[rest-api] setting product stock status to a custom status’ is closed to new replies.