-
Notifications
You must be signed in to change notification settings - Fork 33
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
Do not unset package contents for Shipping Subscriptions with free trials #746
Conversation
c76a421
to
4aa8554
Compare
Hey @asumaran thanks for opening this PR and for all your investigation into this issue on WooPayments. I had to go through the history books to find our why we unset shipping packages and it looks like it's always been this way (since we introduced multiple subscriptions per checkout in v2.0). It also appears to be the intended behaviour as per our FAQ documentation, which states:
There's a few things changing with removing this block that I wanted to call out:
Warning This PR introduces a bug when you go through the block checkout. The order summary on the checkout page shows that flat rate shipping is "FREE" but then when you purchase the order, it's actually charged $10 for shipping. Ignoring the bug above. I'm not overly opposed to this change overall but it does change the fundamentals for how we've handled shipping on the initial order of trial subscriptions. I don't know why merchants would ship a free trial, but if it does need shipping, then there should probably be a shipping line item. This feels like it should be a whole setting on its own i.e. ask merchants if the trial period requires shipping. Our current approach of telling merchants to include a signup fee to record shipping costs feels very outdated and I'm assuming this wouldn't work well with shipping extensions that use shipping line items to do things like attach tracking numbers etc.
I think this will be confusing to customers and could potentially catch merchants by surprise. I don't think a merchant would want customers picking an Express shipping method for their trial product (which will be set to $0) and then some cheaper option for the recurring orders.
Similar to the above point. Regardless of the shipping method chosen, if the parent order is for a free trial, we set the cost to $0. Not sure if merchants may be confused seeing a new order come in with a shipping line item for Flat rate but no shipping was charged. There's another change coming in this PR that I would consider a bug/break.
Say a store sells a subscription product that's synced to the 1st of the month. We apply a mock trial period on the cart item for the period between purchase date and the synced payment date. When a customer purchased this product on the 15th, this order doesn't need shipping and shouldn't have a shipping line item. |
@mattallan, thank you for sharing your thorough feedback on my changes in this PR. I was uncertain about the simplicity and isolation of my changes. I’ll address each of your points but first, I want to focus on getting the WooPayments PR ready, and then I’ll shift my focus to this side of the issue. |
Closing this PR since Tokenized Carts is now the default implementation in WooPayments. This allows us to get the data we need more accurately. What we were previously doing here felt pretty hacky to prevent the removal of shipping options from the package when a subscription included free trial and a sign-up fee (by using a filter controlled from WooPayments). To be honest, I wasn’t very happy with that solution. However, with Tokenized Carts (which uses the Store API), the shipping options information is available in Closing this in favor of Automattic/woocommerce-payments#10099 |
Fixes Automattic/woocommerce-payments#9771
Description
Enables shipping options for variable subscriptions with free trial.
How to test this PR
To be tested along with Automattic/woocommerce-payments#9955