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

[ECE] On Pay for Order page only pass an order subtotal to express payment method and pass line item data if opted into #3552

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

james-allan
Copy link
Contributor

Fixes #3479

Changes proposed in this Pull Request:

This PR brings the pay for order page ECE buttons in line with how line items are handled on the cart and checkout pages.

By default, the Express payment buttons will only display a breakdown by line item if you hook onto the wc_stripe_payment_request_hide_itemization and return false.

For example:

Default Returning false
Screenshot 2024-10-28 at 5 28 29 pm Screenshot 2024-10-28 at 5 30 36 pm

Testing instructions

  1. Enable ECE via the _wcstripe_feature_ece option in the database.
  2. Go to WooCommerce → Orders → Add order
  3. Add your current user as the customer
  4. Add multiple line items with various quantities (including x1)
  5. Click the pay order link.
  6. On the Pay for Order page click the Link, Google Pay or Apple Pay button.
  7. In the popup, expand the order details.
    • On develop you will see the line item breakdown (with no qty data).
    • On this branch it should say Subtotal with a single total.
develop This branch

Screenshot 2024-10-28 at 5 55 38 pm
The line item breakdown is shown by default without the qty which is inconsistant

Screenshot 2024-10-28 at 5 47 22 pm
  1. Add the following code snippet.
add_filter( 'wc_stripe_payment_request_hide_itemization', '__return_false' );
  1. Refresh the Pay for Order page.
  2. Click the Link, Google Pay or Apple Pay button.
  3. In the popup, expand the order details you should now see the item breakdown with correct qty data.

Screenshot 2024-10-28 at 5 51 17 pm
The line item breakdown is now shown including quantities

---
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

Copy link
Contributor

@Mayisha Mayisha left a comment

Choose a reason for hiding this comment

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

This is working correctly and showing the itemized entry depending on the wc_stripe_payment_request_hide_itemization filter.

Default
Screenshot 2024-11-15 at 6 55 06 PM

With wc_stripe_payment_request_hide_itemization filter set to false

Screenshot 2024-11-15 at 6 55 51 PM

@Mayisha Mayisha merged commit a3e888c into develop Nov 15, 2024
33 of 35 checks passed
@Mayisha Mayisha deleted the fix/3479-add-qty-labels-for-ece branch November 15, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ECE] Display the line item quantity label in item list
2 participants