Problems accessing subscription information at checkout (using checkout.liquid)

joelp
Visitor
2 0 0

Shopify Plus store dev here, just diving in to checkout.liquid modifications for the first time and I'm having trouble pulling subscription and metafield data out of checkout.line_items

 

I'd like to know if a product is being purchased on a subscription basis. However, line_item.selling_plan_allocation always seems to be nil, so the below outputs nothing. 

 

 

{%- for line_item in checkout.line_items -%}
  {%- if line_item.selling_plan_allocation != nil -%}
    {{ line_item.product.title }} has selling plan name {{ line_item.selling_plan_allocation.selling_plan.name }}.
  {%- endif -%}
{%- endfor -%}

 

 

How should I be accessing the selling plan information for products in the order? Thanks for any help.

Replies 0 (0)