Skip to main content

How to display the subscription plan name and price on the cart page?

By default, when a customer adds a subscription product to their cart, Shopify displays the subscription frequency and price on the cart page directly under the product details (as shown below).

However, this approach may not work for older themes, and you may need to add the following code snippet to your theme to have it displayed:

{% if line_item.selling_plan_allocation %} 
<p class="selling-plan">{{line_item.selling_plan_allocation.selling_plan.name }}
</p>
{% endif %}

To also display the subscription price, you can use this code:
​

{% unless item.selling_plan_allocation == nil %}
<p class="cart__product-meta">
{{ item.selling_plan_allocation.price | money }}
</p>
{% endunless %}

To show compare_at_price, per_delivery_price etc, read Shopify’s official documentation.
​
This code comes directly from Shopify's own documentation, which you can read more about here. If you are not sure on how to set it up, please reach out to us and we can help you with that.

Did this answer your question?