Skip to content

Conversation

@wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Nov 19, 2025

Fixes STRIPE-715

Changes proposed in this Pull Request:

Our current implementation of the Express Checkout Element does not support free-trial subscriptions that require shipping. I am adding support for that here.

We are basically removing the constraint for physical products from the backend. Until now, we could not find reasons why this could break (and was prevented).

Testing instructions

  • Checkout and build this branch on your test environment (add/include-support-for-physical-free-trials)
  • Connect your Stripe account
  • Enable some express payment methods
  • Install the subscriptions extension
  • Create a physical subscription product with a free trial period
  • As a shopper, access the store using a public-accessible URL
  • Add this subscription to your cart
  • Go to any checkout page
  • Confirm express checkout buttons are shown
  • Confirm you can complete the purchase
  • As a merchant, confirm you can renew the subscription in the WP-Admin

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Nov 19, 2025
@wjrosa wjrosa marked this pull request as ready for review November 19, 2025 19:27
@wjrosa wjrosa changed the title Includes support for physical free trial subscription products with ECE Including support for physical free trial subscription products with ECE Nov 19, 2025
@wjrosa wjrosa requested review from a team, Mayisha and daledupreez and removed request for a team November 19, 2025 19:39
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.

@wjrosa do you see the following error for a free trial subscription with ECE? I see this error when I click the Google Pay button on both product and checkout pages. Works fine for simple products and subscriptions without a free trial for the same address.

Screenshot 2025-11-20 at 12 27 51 PM

I can continue and pay, but was wondering if this will be an issue in live mode.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

I am seeing the same issue as @Mayisha when computing shipping options in both Google Pay and Apple Pay.

@wjrosa
Copy link
Contributor Author

wjrosa commented Dec 3, 2025

I did some deep debugging today and found out the issue is due the subscriptions extension. We have this filter there:

		// Remove any subscriptions with a free trial from the initial shipping packages
		add_filter( 'woocommerce_cart_shipping_packages', __CLASS__ . '::set_cart_shipping_packages', -10, 1 );

It does what the comment says. If I comment out this filter, it works just fine. That must be why we blocked physical free trials in the first place. I will ask the team about it

@wjrosa
Copy link
Contributor Author

wjrosa commented Dec 3, 2025

Asked the Chronos team about it in p1764795994520959-slack-C0866MKN6H1

@wjrosa
Copy link
Contributor Author

wjrosa commented Dec 4, 2025

@Mayisha @daledupreez I decided to remove the filter above in 860684e. Per the discussion in p1764795994520959-slack-C0866MKN6H1, I believe it makes sense. I did some testing, and things are working fine for me. Let me know what you think

@wjrosa wjrosa requested review from Mayisha and daledupreez December 4, 2025 15:26
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.

4 participants