Solved

Cannot access sellings plans on checkout.liquid

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!

Accepted Solution (1)

jbourassa
Shopify Staff
11 2 2

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,

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

View solution in original post

Replies 7 (7)

jbourassa
Shopify Staff
11 2 2

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,

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

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.

 

PaulVomberg
Tourist
14 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. 

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!

PaulVomberg
Tourist
14 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 

JAS_Technology
Shopify Expert
86 0 56

Hi there! Has there been any progress on including selling_plan_allocation details in the line_item records of a checkout object in liquid? We are trying to have the page behave a bit differently if one of the line items belongs to a subscription of a certain frequency with a certain price value. Doing this in liquid will be SO much better than the only other way I can think of which is to make an ajax call out to some app logic that inspects the line items of the current checkout record. 

 

Thanks for any info. 

Happy to hear about your crazy ideas.
bredowmax
Shopify Partner
86 1 126

@jbourassa any updates since your post almost 10 months ago?

I'm also hitting this roadblock as I'm trying to add a warning message about delivery charges for subsequent subscription deliveries in the checkout, since Recharge doesn't correctly display subscription delivery charges.

It would be great to have access to this. There was no mentioning in the documentation that this is supposed to be not available in the checkout