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

Getting PRBs to show up on the cart/checkout page for any subscription that has a free trial. #8152

Open
Tracked by #9983
AmeliaBriscoe opened this issue Feb 8, 2024 · 9 comments · May be fixed by #9309
Open
Tracked by #9983
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: checkout payments priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@AmeliaBriscoe
Copy link

Describe the bug

Customers are having trouble getting Apple and Google Pay buttons to show on the cart/checkout page for any subscription that has a free trial.

However, buttons show up on the product page when the subscription is a digital product. The buttons do not show when it's a physical product.

To Reproduce

  1. Go to Products > Subscriptions
  2. Create a subscription product with a free trial. Tick the 'Virtual' box
  3. Review the product page and add to the cart. Google and Apply Pay buttons are available
  4. Navigate to the Checkout page. No Google or Apple Pay buttons are unavailable
  5. Edit the subscription product and uncheck the 'Virtual' box.
  6. Review the product and checkout pages - the buttons on both pages will be unavailable.

Actual behavior

It's not clear on what the expected behaviour is supposed to be when it comes to products with a free trial. The behaviour seems to be inconsistent and is not clear to the customer in the documentation.

Additional context

@AmeliaBriscoe AmeliaBriscoe added the type: bug The issue is a confirmed bug. label Feb 8, 2024
@zmaglica zmaglica added component: alternative payment methods Issues related to Alternative Payment Methods component: wcpay subscriptions Issues related to Stripe Billing Subscriptions category: core WC Payments core related issues, where it’s obvious. labels Feb 12, 2024
@zmaglica
Copy link
Contributor

I am not sure who is the right team to work on this issue, so I will tag both @diegocurbelo from Quark and @FangedParakeet from Heisenberg. Could you please decide which team will work on this issue? As a Gamma porter, I will move this issue to Other Teams queue as a part of our triage process.

@FangedParakeet FangedParakeet added the component: checkout Issues related to Checkout label Feb 13, 2024
@FangedParakeet
Copy link
Contributor

@zmaglica, I think it makes sense for Heisenberg to take on this task. I've added it to our triage queue for maintenance issues.

@pierorocca
Copy link
Contributor

Definitely inconsistent behavior. Thanks @AmeliaBriscoe for raising this issue. @nikkivias fyi another example related to PRB buttons visibility inconsistency.

@pierorocca pierorocca added the priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. label Feb 14, 2024
@pierorocca pierorocca removed component: checkout Issues related to Checkout component: alternative payment methods Issues related to Alternative Payment Methods labels Mar 13, 2024
@AashikP
Copy link

AashikP commented Mar 22, 2024

Another report in 7883759-zd-a8c

@FangedParakeet FangedParakeet added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Mar 27, 2024
@bborman22
Copy link
Contributor

Just noting here that with the move to Express Checkout Element, we'll want to tackle this issue in that implementation if it is still present.

@bborman22
Copy link
Contributor

@ricardo
Copy link
Member

ricardo commented Jul 29, 2024

I don't recall the exact limitation for trial subscriptions that require shipping, but the button is hidden on purpose:

// Trial subscriptions with shipping are not supported.
if ( class_exists( 'WC_Subscriptions_Product' ) && WC_Subscriptions_Product::is_subscription( $_product ) && $_product->needs_shipping() && WC_Subscriptions_Product::get_trial_length( $_product ) > 0 ) {
return false;
}

The change has been there since the PRB implementation #1175

@thuautp
Copy link

thuautp commented Aug 7, 2024

also reported in 8484825-zen

@cesarcosta99 cesarcosta99 self-assigned this Aug 9, 2024
@cesarcosta99 cesarcosta99 linked a pull request Aug 22, 2024 that will close this issue
6 tasks
@cesarcosta99
Copy link
Contributor

We bumped the estimation from 2 to 3 because the scope/effort for this task was bigger than we anticipated.

The PRB buttons work on the product page because they pass the value of the product to the gateway when the user clicks on them. That value is displayed in the modal, but when the user pays, they're not charged, apparently. I confirmed the WC order total value is 0.

In the cart and checkout pages, the gateway receives a value of 0 because that's the cart total. Since the gateway doesn't allow 0, the current implementation is deliberately hiding the buttons.

I've opened #9309 to address this issue but the code still needs some hardening and there are a couple of gaps to be filled. The idea of that PR is to identify if there is trial subscription in the cart and inform the actual value of the subscription to the gateway, similar to what happens in the product page. That way the user will be able to use the PRBs to pay, but won't be charged initially.

One thing to be confirmed yet is whether this approach doesn't really generate a charge. If the user is not initially charged, we can proceed with the PR, otherwise, we may need to hide the PRB from the product page and declare PRBs incompatible with trial subscriptions.


I'll be pausing the work here due to priority changes, but plan to come back to this very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: checkout payments priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants