Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

peterwilsoncc
Copy link
Collaborator

@peterwilsoncc peterwilsoncc commented Sep 10, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

Modifies the configuration of API line items to account for partial quantities, these can be allowed by plugins such as Decimal Product Quantity for WooCommerce.

Closes https://linear.app/a8c/issue/SQUARE-156/a-critical-error-is-thrown-when-processing-orders-with-product
Closes #410

Steps to test the changes in this Pull Request:

  1. Install Decimal Product Quantity for WooCommerce
  2. Set up the site to use shortcode cart and checkout (required by plugin)
  3. Create a $2 simple product with the quantity options:
    • Minimum: 0.5
    • Default set: 0.5
    • Step change +/-: 0.5
    • Price unit label: Price per half (or anything really)
  4. Create a free shipping option
  5. Purchase the product using the free shipping option
  6. Ensure the purchase succeeds and does not trigger a fatal error

Noe: the fatal error happens in an ajax request so there's no white-screen-of-death on the front end of the site, the purchase fails with a generic error message.

Changelog entry

Fix - Fatal error when using partial product quantities via a plugin.

Copy link

This is linked to GitHub issue #410.

Copy link
Collaborator

@qasumitbagthariya qasumitbagthariya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Update ✅


I have verified this PR in the fix/SQUARE-156-fatal-partial-quatities branch, which has been fixed and is functioning as intended.

I tested the following on this branch:

  • Verified the flow with Decimal Product Quantity for WooCommerce - Test Pass
  • No fatal error triggered during the AJAX request. The purchase completed successfully without frontend issues.
Screen.Recording.2025-09-18.at.2.58.08.AM.mov

Testing Environment

  • WordPress: 6.8.2
  • Theme: Storefront 4.6.1
  • Theme: Twenty Twenty-Five 1.3
  • WooCommerce - 10.2.0
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: fix/SQUARE-156-fatal-partial-quatities

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready for UAT
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Issue for PR #409: Allow for partial product quantities.
3 participants