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.
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.
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.
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 : /
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!
@Brian_S_1@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