Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect total discount for inital cart pseudo coupon if there are multiple subscriptions in cart #755

Open
2 tasks done
annemirasol opened this issue Jan 1, 2025 · 0 comments
Labels
type: bug The issue is a confirmed bug.

Comments

@annemirasol
Copy link
Contributor

Describe the bug

Initially reported in p1735654651089199-slack-C7U3Y3VMY

When the cart has a pseudo coupon applied (i.e. by manually deducting from the cart total in wp-admin), and the cart contains more than 1 subscription, the total discount amount gets incorrectly treated as "per sub" instead of "per cart".

In the example below, a 10.00 cart discount was manually applied. The Pay for Order page redirects to the checkout page which creates a pseudo coupon for 50.00 instead of 10.00.
Image

To Reproduce

  1. In WooCommerce > Subscriptions, manually crate a new subscription.
    • Select an existing shopper that you can log in as.
    • For Quantity, enter a number > 1, e.g. 5.
  2. Under Order Actions, click "Create pending parent order".
  3. Go to the parent order.
  4. Edit the cart total, subtracting a few dollars from it. Do not make the total 0.00.
  5. Copy the "Customer payment page" link.
  6. As the logged in shopper in a separate browser, open the payment link.
  7. You will notice that the cart total is incorrect. (The cart discount has been multiplied by the subscription quantity.)
  8. Go back to the parent order page in wp-admin and refresh it.
  9. You will see a "discount_intial" coupon has been added to the order. Hover over the coupon and notice that the coupon amount is incorrect.
Image

Expected behavior

The cart discount should not be multiplied by item quantity.

Actual behavior

The cart discount gets multiplied by item quantity, leading to an incorrect cart total.

Product impact

  • Does this issue affect WooCommerce Subscriptions? yes
  • Does this issue affect WooCommerce Payments? no
@annemirasol annemirasol added the type: bug The issue is a confirmed bug. label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

1 participant