Conversation
supportHi Condless team, I’m using the Unit Price for WooCommerce plugin on a WooCommerce store where some products are sold by meters with decimal quantities (e.g., 2.5 m). I have configured a minimum quantity and step correctly, and the quantity displays correctly on the product page and when adding to cart. Problem: When a customer applies a coupon, the cart updates automatically, and the quantity is rounded down to the nearest integer (e.g., 2.5 m becomes 2 m). This causes incorrect pricing and prevents customers from ordering the exact quantity. I’m currently using the following hooks in my functions.php : add_filter( ‘upw_skip_args_validation’, ‘__return_true’ ); add_filter( ‘upw_product_min_value’, ‘upw_set_min_value’ ); add_filter( ‘upw_variation_min_qty’, ‘upw_set_min_value’ ); add_filter( ‘woocommerce_update_cart_validation’, ‘upw_apply_min_quantity’, 10, 4 ); I suspect the issue occurs because WooCommerce recalculates cart quantities when a coupon is applied, and decimal quantities are rounded during this process. Could you advise on the correct way to preserve decimal quantities when the cart updates (especially after applying coupons)? Thank you in advance for your help! Best regards,
No comments were stored for this source.