Cannot access sellings plans on checkout.liquid

Solved
6453mike
New Member
4 0 0

Hello,

I've been trying to access selling plans via Liquid on checkout, but the properties don't seem to exist. Elsewhere
on the site, I can access selling plan info through the cart object.

Below is an example of how I am trying to access selling plan data on checkout (this doesn't work):

{% for item in checkout.line_items %}
    {{ item.selling_plan_allocation.price }}
{% endfor %}

 

And here is an example of how I am accessing the same data elsewhere (this works):

{% for item in cart.items %}
    {{ item.selling_plan_allocation.price }}
{% endfor %}


Here is another post with the same issue: https://community.shopify.com/c/Shopify-Discussion/Selling-plan-not-in-checkout-line-items/m-p/12158...

Any help would be much appreciated.

Thanks!

0 Likes
jbourassa
Shopify Staff
Shopify Staff
9 1 1

This is an accepted solution.

Hey 6453mike,

You're right, this is not currently supported on the Checkout line item drop, but is supported on the Order and Cart line item drops. I don't think this is intended; I'll bring this to the team for visibility.

Out of curiosity, would you mind explaining your usecase?

Thanks,

0 Likes
6453mike
New Member
4 0 0

Hey @jbourassa,

Thanks for the quick reply!

At a high level, I need to detect the presence of a subscription line-item so that I can show a different flow to the customer.

As a work-around, I am fetching the Cart via the AJAX API and detecting the presence in that way.

 

0 Likes
PaulVomberg
Tourist
11 0 0

Hey @6453mike

What are the different flow's you're trying to show to the customer? Generally speaking, modifying the path to purchase inside the checkout.liquid cannot be modified very much. 

0 Likes
6453mike
New Member
4 0 0

Hey @PaulVomberg,

We have embedded a Chargebee hosted checkout page within an iframe for Shopify carts that include subscriptions.

Thanks!

0 Likes
PaulVomberg
Tourist
11 0 0

I’ve seen that done before, too bad it doesn’t work with Shop Pay! https://www.shopify.ca/blog/shop-pay-checkout 

0 Likes