Skip to content

Decimal Product Quantities are Reset to Integers #4030

@jeffdaigle

Description

@jeffdaigle

Describe the bug
Starting with version 9.2.0, when decimal product quantities are enabled, if there is a product with a decimal quantity set in the cart that quantity will get rounded down to the nearest integer if the user navigates from the cart to another page.

To Reproduce
Steps to reproduce the behavior:

  1. Install WooCommerce, WooCommerce Stripe Gateway, and a plugin that enables decimal quantities (in our case WPC Product Quantity for WooCommerce).
  2. Use the standard shortcode-based Cart and Checkout pages. Not tested with Block-based Cart and Checkout.
  3. Enable decimal product quantities
  4. Add a product to the cart with a decimal quantity set (i.e. 1.2, 0.75, etc)
  5. View the cart - the selected quantity will be correct
  6. Navigate to another page (Checkout, another product, etc.)
  7. The next time you view the product quantity either in the cart or Checkout, the quantity will have been rounded down to the nearest integer.
    Expected behavior
    Decimal product quantities should be preserved in the Cart and Checkout.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • WordPress Version: 6.7.2
  • WooCommerce Version: 9.7.1
  • Stripe Plugin Version: 9.2.0
  • Browser [e.g. chrome, safari] and Version: Tested on MacOS Safari 18.3 (20620.2.4.11.5) and MacOS Chrome 133.0.6943.142.
  • Any other plugins installed: WPC Product Quantity for WooCommerce 5.0.6, Storefront theme

Additional context
If the Stripe plugin is rolled back to 9.1.1 decimal product quantities work as expected.

SystemStatusReport_staging2.lancasterhomebrew.com_2025-03-07T15-03-57.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions