Stock management bug
-
Hey, seems like there is a bug when saving a product if you previously managed stock with this plugin.
It does not respect the “manage stock” setting, and will set the product back to “out of stock” if the fields are empty.
I have implemented a small fix. Add the following code at the top of the “update_product_meta” function within trait-slw-stock-locations-tab.php (line 277). This prevents the product meta from being updated if stock is not managed for the product.
277: public function update_product_meta($id, $product_stock_location_terms, $terms_total): void { 278: //Check whether should run $manage_stock = get_post_meta($id, '_manage_stock', true) === 'yes'; if (!$manage_stock) { return; } //... rest of method
If you can integrate this that would be great! Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Stock management bug’ is closed to new replies.