Solved

[BUG] Order Status Page has incorrect data in `Shopify.Checkout`

Brian_S
Shopify Partner
153 19 39

The requirements of subscription apps include links to the customer portal in the post-purchase Order Status page as well as emails.  In order to only show this navigation to customers who purchased a subscription we rely on the `Shopify.Checkout` object.  That object has a field `hasSellingPlan` which would be true if the order contained a line item with a selling plan or not.  That seems to have broken recently. Now it's always false when I test, which means I either need to show the Customer Portal link to all customers or no customers.  Its been a very helpful link to our merchants' customers so we'd like to be able to add it conditionally as I think Shopify originally intended it to be. 

 

Could anybody take a look at this for me? You're welcome to make a test purchase with the 4242 credit card here: https://awtomic.shop/products/classic-subscription?selling_plan=804389093

 

Once you checkout just open the dev console and check the variable `Shopify.Checkout.hasSellingPlan` and you'll see that it's false even though you just purchased an item with a selling plan. 

 

See the images below for what I'm seeingXnip2022-11-23_20-59-10.pngXnip2022-11-23_21-00-59.png

 

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
Accepted Solution (1)
darrenjung
Shopify Staff (Retired)
2 1 2

This is an accepted solution.

@Brian_S @jvh @ericute 
Letting you know that the fix has been merged this morning, and this field should give you the correct value now!
cc: @diegolippel 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 8 (8)

diegolippel
Shopify Staff
19 4 6

Hey Brian,

 

I was able to reproduce this issue, and have reported the error internally so that we can handle this as soon as possible.

Thank you for reporting it!

To learn more visit the Shopify Help Center or the Community Blog.

ericute
Shopify Partner
55 3 7

Is there an update to this bug? 

jvh
Shopify Partner
5 0 9

Hi Brian,

 

For what it's worth (and new bug aside), `Shopify.Checkout` and `Shopify.checkout` data are not available in other contexts where we might want to display the link. For example, the order status page for subscription orders doesn't seem to have a similar helper method because it's not a checkout. We've resorted to liquid templates to output whether an order is subscription-related to solve this.

 

Maybe that approach is helpful to others looking for alternatives.

Brian_S
Shopify Partner
153 19 39

Bump on this one @jvh  - we've actually had this brought up to us now in an app review by Shopify's review team as a potential reason for getting delisted : /

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
Brian_S
Shopify Partner
153 19 39

Sorry .. not jvh.. @diegolippel  any updates? 

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
darrenjung
Shopify Staff (Retired)
2 1 2

Hi Brian!

Apologies on late reply, we're currently working on the issue and my guess is to ship the fix on sometime next week (hopefully by early half). Sorry for delay and I will follow up once the fix is there. Thank you!

To learn more visit the Shopify Help Center or the Community Blog.

darrenjung
Shopify Staff (Retired)
2 1 2

This is an accepted solution.

@Brian_S @jvh @ericute 
Letting you know that the fix has been merged this morning, and this field should give you the correct value now!
cc: @diegolippel 

To learn more visit the Shopify Help Center or the Community Blog.

Brian_S
Shopify Partner
153 19 39

Thanks @darrenjung - looks like its there again

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic