beyond88 / default-quantity-for-woocommerce

The easy way to set default quantities in WooCommerce. The WooCommerce Default Quantity plugin does one thing, and it does it well. It changes the initial quantity value for specific products, categories, or your entire store.
https://wordpress.org/plugins/default quantity-for-woocommerce
1 stars 1 forks source link

Plugin prevents a product edit from saving #8

Open michael-at-boost opened 2 weeks ago

michael-at-boost commented 2 weeks ago

If a product's default quantity is set to 0 then saving the post (post.php) attempts to focus the dqfwc_default_quantity field. But dqfwc_default_quantity isn't visible (due to #inventory_product_data being display: none). So the operation throws an error which prevents the post save.

Thanks for the plugin, Please let me know if you need any more info on the exact config to reproduce.

beyond88 commented 2 weeks ago

Thanks for letting me know! Could you provide a screenshot or video showing the issue in action? This will help me replicate and troubleshoot the problem more accurately. If there are any specific configurations or steps you follow, sharing those would also be very helpful.

michael-at-boost commented 2 weeks ago

Is this any use?

https://github.com/user-attachments/assets/f1fac1c8-1658-4aee-830d-5df6703766de

beyond88 commented 2 weeks ago

Hi, I will fix it and let you know the update as soon as possible.

michael-at-boost commented 2 weeks ago

Amazing, thanks, very much appreciated !

beyond88 commented 2 weeks ago

Hi Michael, there seems to be a misunderstanding. The default quantity input field is located under the Inventory tab. To set the value, first click on the Inventory tab in the left-side panel, then you'll see the Default Quantity input field.

Screenshot 2024-11-08 at 6 39 49 PM

michael-at-boost commented 2 weeks ago

Ah I see. So the issue is if that field contains a 0 then you can't save the product (due to the JS error shown in the video). I guess manually setting the tab to inventory would fix the problem however the error only appears in dev tools so a regular user is going to have no idea why the post doesn't save or how to fix it.

beyond88 commented 1 week ago

I got it. I will fix it as soon as possible.