March has been a busy month for everyone and if you have been keeping your plugins updated then you will have noticed the few silent releases recently that I have been pushing out.
This particular release however will be making a change to the quantity parameter.
The value type for quantity by default in WooCommerce is integer meaning that it only allows numeric values to be used in order to add or update an item to the cart.
The change requested by @metemaddar makes the value type a float allowing decimal values to be passed.
In order for this to work the `woocommerce_stock_amount
filter must also be changed to validate the float value. This has been done for you.
It’s important that this release is validated as it affects total and tax calculations and I do not wish to break those who are using the default value type.
This is the first community contribution and I hope there will be more in the future. I urge you to test only on a local or staging site.
To test CoCart 2.0.13 RC2, download the release candidate here (zip).
If you find a problem, please report the bug.
FYI
Since 2.0.13 is in a release candidate stage, only bug fixes will be made.
For Developers: A new filter has also been added for sold individual products. cocart_add_to_cart_sold_individually_quantity
this matches the filter in the core of WooCommerce – woocommerce_add_to_cart_sold_individually_quantity
If you use the filters, both values must match.
Happy testing!