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

Fix missing order attribution metadata when using ECE #3629

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Nov 28, 2024

Fixes #3022

Changes proposed in this Pull Request:

This PR fixes the inclusion of order attribution metadata when purchasing using express payment methods (with both Payment Request Buttons, PRB, and Express Checkout Element, ECE), both block checkout and shortcode checkout.

The solution consists in rendering the <wc-order-attribution-inputs> tag (native WooCommerce tag for this specific purpose) and populating it with data coming GET request. Then, merge the data with the existing order information (POST).

Testing instructions

  • Checkout and build this branch on your development environment (fix/order-attribution-meta-missing-from-ece)
  • Connect your Stripe account
  • Enable express payment methods
  • Create a shortcode checkout page
  • As a shopper, add the following query string to your cart URL to simulate a source attribution: ?utm_source=Facebook

ECE Enabled

  • You can force the feature by hardcoding is_stripe_ece_enabled to true.

Block Checkout

  • As a shopper, add a product to your cart
  • Go to the block checkout page
  • Complete the purchase using any ECE button
  • As a merchant, open the new order page
  • Confirm you can see the correct attribution on the sidebar:
    Screenshot 2024-11-29 at 09 53 39

Shortcode Checkout

  • As a shopper, add a product to your cart
  • Go to the shortcode checkout page
  • Complete the purchase using any ECE button
  • As a merchant, open the new order page
  • Confirm you can see the correct attribution on the sidebar

ECE Disabled (PRB)

  • You can force the feature as disabled by hardcoding is_stripe_ece_enabled to false.

Block Checkout

  • As a shopper, add a product to your cart
  • Go to the block checkout page
  • Complete the purchase using any PRB button
  • As a merchant, open the new order page
  • Confirm you can see the correct attribution on the sidebar

Shortcode Checkout

  • As a shopper, add a product to your cart
  • Go to the shortcode checkout page
  • Complete the purchase using any PRB button
  • As a merchant, open the new order page
  • Confirm you can see the correct attribution on the sidebar

  • 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

@wjrosa wjrosa self-assigned this Nov 28, 2024
@wjrosa wjrosa marked this pull request as ready for review November 29, 2024 12:55
@wjrosa wjrosa requested review from a team and annemirasol and removed request for a team November 29, 2024 12:55
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.

Express Checkouts break order attribution metadata
1 participant