Skip to content

Add Support for Decimal Quantities #207

Description

@emarufh

Currently the plugin only allows whole numbers for minimum, maximum, and step values. For stores selling products measured in units such as weight, length, or volume, decimal quantities are required to enforce accurate quantity rules.

Use Case:
Stores that sell items in fractional units (for example weight based products like 0.5kg, 1.25kg, 0.75kg) need the ability to set minimum, maximum, and step quantities that accept decimal values rather than only integers. This improves flexibility and allows enforcing rules like:

Minimum order quantity of 0.5

Maximum order quantity of 10.5

Step quantity of 0.25

This request is inspired by existing implementations such as the solution shown here:
https://codeastrology.com/min-max-quantity/decimal-quantity-in-simple-product/

Current Behavior:
At present, the plugin accepts only integer values for:

Minimum quantity

Maximum quantity

Step quantity

Entering decimal values is not allowed or does not function correctly.

Expected Behavior:
The plugin should allow decimal values for the following fields:

Minimum quantity

Maximum quantity

Step quantity

The decimal support should function properly on both Simple and Variable products, and integrate with cart validation and error notifications.

Example Scenarios:

Product sold by weight needs:

Min = 0.5

Max = 5.0

Step = 0.25

Product sold by volume needs:

Min = 0.1

Max = 2.0

Step = 0.1

Benefits:

Support for fractional quantities for products sold by weight or other non-integer units

Better customer experience and flexible quantity enforcement

Expand use cases for the plugin

Reference:

Decimal quantity support: https://codeastrology.com/min-max-quantity/decimal-quantity-in-simple-product/

Similar plugin example: https://wordpress.org/plugins/woo-min-max-quantity-step-control-single/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions