-
Notifications
You must be signed in to change notification settings - Fork 69
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 buttons not rendered for variable subscription products on the product details page #9771
ECE buttons not rendered for variable subscription products on the product details page #9771
Comments
Noting that the product shown in the screenshot actually has a $1 signup fee. I didn't intend that but the behavior is the same if it's $0 signup fee. The button doesn't render on PDP. |
Hey team! Please add your planning poker estimate with Zenhub @asumaran @cesarcosta99 @lovo-h @rafaelzaleski @reykjalin @ricardo |
@pierorocca On which site can the product described in the issue be viewed? Locally, it works for me with the same type of product. I’d like to see if there’s any different configuration on your site. |
Proccaatomic.wpcomstaging.com |
@pierorocca I see; in this case, it’s due to the free trial. Here’s the check which disables ECE on the product page for subscriptions with free trial. woocommerce-payments/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php Line 766 in 6cff322
|
A couple of things to consider. With the sign-up fees, even with the free trial it's not a $0 purchase. For free trials in general where a payment will happen, if there are no technical limitations, they should be supported by express checkout as a payment will happen. The question is by using Apple or Google Pay do we still get a card on file and are able to process the future payment when it comes due? |
The |
I'll see the Stripe documentation to see if we can add support for free trials. The checks we currently have in place seem a bit outdated. |
Is that true? The product can be virtual and a variation - e.g. 3 Month, 6 Month, 1 Year digital subscriptions. |
@pierorocca Yes, I was referring to the current check we have in place. For regular subscriptions We need to update the check to not use
Correct, it looks like we have a bug—we’re not retrieving the correct amount for subscription variations with free trials. I’ll keep investigating. |
Got it thank you. |
@pierorocca, I’m encountering issues with getting subscriptions with free trials to work with ECE, and it seems this has been a long-standing problem (see p1623899346401100/1623869290.383200-slack-C01BZUL57SQ). The issue appears to stem from the WC Subscriptions core. Subscriptions don’t have packages defined, which prevents us from retrieving shipping options, ultimately resulting in an error on the payment sheet. This also makes it impossible to calculate the total amount. @diegocurbelo, do you have any insights on this? |
Nice find. Fixing core gaps if it can be done adds value well beyond WooPayments. |
Wow nice digging on this @asumaran! There's a lot of variables at play here (pun intended 😆), so I'd just want to narrow it down a bit on what we're actually trying to solve here. In the original issue title this would be for ECE buttons missing on variable subscription products which would definitely be a high priority bug to fix. But if I'm reading this correctly the issue is actually only with variable subscription products with a free trial is that right? I mention this because we also have this issue about ECE and subscriptions with free trials, but also a sign up fee and I don't want things to get too tangled. I was wondering if it would be helpful to break down a list like the following:
You can just edit my comment to mark the expected and actual results with Yes for display ECE and No for don't display ECE. This could help us narrow down which cases we actually need to solve for. @asumaran would you be able to start by filling in the Actual column by running through some quick tests in each scenario? |
@bborman22 I tested sixteen combinations of simple and variable subscriptions. The case this issue aims to address is case 16. In general, since we have a check for subscriptions with shipping and a free trial, all free trial subscriptions with shipping are currently unsupported. Please review the observations column for additional info. The question is, should I focus only on case 16? Judging by the quick debugging I’ve done, this doesn’t seem straightforward to fix—at least not on WooPayments scope. It seems we need to address the following issues:
|
I forgot to mention that to support $0 purchases for subscriptions (free trials without signup fees), it seems we need to use Stripe’s Setup Intents API, as we currently do in case 7. |
That makes sense since it's getting the payment information for a future charge that's merchant not shopper initiated. |
Thanks so much for putting this together @asumaran @bborman22 ! My notes are below: Case 3. The physical product requires shipping and once the free trial ends, the shopper will be billed. I'd expect ECE to be an option and show, so the shopper doesn't have to provide both shipping and card information through the checkout form. There is a future payment once the trial ends so the setup intent for a future payment can be created. Case 4. The physical product that requires shipping and has a payable immediate signup fee, agree it should show. The signup fee is billed immediately and the setup intent created for the future payment once the free trial ends. Case 5: For this virtual product that does not require shipping, if the product is $0 and on an ongoing basis it's free, I'd expect the button to not show. There's no shipping, no payment, and no future payment. If it's >$0, as marked it should show. Case 7: Perfect. Cases 11 & 12: Like 3 & 4 above. Case 15: Agree. Case 16: Agree. |
FYI there were many tickets opened as a result of my p4ya8V-bv0-p2 related to ECE and subscriptions. #9776 covers case 16 and #9771 covers case 15. Solving for these two should also address cases 3, 4, 11 & 12? Subscriptions are hugely important. More than a 1/3rd of the use cases identified here plus #9806 and #9799 issues, there's a really good opportunity to improve the product quality, and increase share of express checkouts. |
Thanks so much for putting this together @asumaran this really helps me understand the problem better. Somewhat repeating @pierorocca's comments tying issues to cases here, but I was thinking of solving in this order / granularity:
Let me know if this breakdown makes sense and what a good next step might be. To me addressing 15 and 16 seems the most straight forward for fixing a bug and fixing 4 and 12 seems like the lightest lift by just modifying a conditional to take sign up fees into account. |
After discussing this issue internally with @bborman22, I’m going to focus on cases 15 and 16, which should work similarly to cases 7 and 8, respectively, with the only difference being the variable subscription. To address the issue gradually, I’ll first fix the incorrect check here, which is being done against the subscription instead of the variation. After that, I’ll focus on enabling ECE for cases 15 and 16. FYI: @pierorocca @bborman22 |
Thanks @asumaran and @bborman22. Nice work dissecting this into smaller deliverables. |
@pierorocca @bborman22 I just realized that adjusting the check enables ECE for variable subscriptions of virtual products with free trials, whether or not they include a sign-up fee—and it works! The only thing to note is that the amount displayed in the payment sheet is either the subscription price (in the case of free trials) (Case 15) or the subscription price plus the sign-up fee (if a sign-up fee was added to the variation) (Case 16). I believe @cesarcosta99 is already addressing this in #9799? It’s worth noting that in Case 15, the amount displayed in the payment sheet is the subscription price, but the charged amount is $0, as it uses Setup Intents for $0 charges 🎉. In case 16, the displayed amount is the subscription price + the sign-up fee, but the charged amount is only the sign-up fee, which is the expected behavior. The only adjustment needed is to fix the amount displayed in the payment sheet, which César is currently working on. |
I’ll stick to the plan and create a PR to refine the check. Then, I’ll work on another PR to enable ECE for cases 15 and 16, as leaving the condition open would enable ECE for cases 11 and 12, which don’t work and are not my current focus to resolve. |
@bborman22 @pierorocca I managed to get ECE working for Case 4, but the fix needs to be applied in the WC Subscription Core repository. As expected, the payment sheet shows incorrect amounts; however, the charged amount is accurate. We need to remove this block of code, which specifically excludes packages for subscriptions with free trials that require shipping. I'll run more tests and will submit a PR in their repository. |
Nice work and ownership of the fix @asumaran |
Describe the bug
ECE buttons not rendered for variable subscription products on the product details page.
To Reproduce
Actual behavior
Screenshots
The text was updated successfully, but these errors were encountered: