> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supercycle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Show recurring payments in the cart

> Add Liquid code to display plan details and total recurring costs for selling plan products.

When using membership or subscription plans, you can show more detail in the cart, including each product's plan name, first payment, recurring payment, and the total recurring amount for all items.

This helps customers understand what they'll be charged now and on a recurring basis.

## Add Liquid to your cart template

Add the following Liquid blocks to your cart template or snippet (for example, `main-cart-items.liquid`) to show recurring payment information.

<Steps>
  <Step title="Open your cart template">
    In your Shopify theme editor, open the file where your cart line items are rendered.
  </Step>

  <Step title="Add the total recurring payment block">
    Paste the first block below the cart items to show the total monthly recurring payment.
  </Step>

  <Step title="Add the plan details block">
    Paste the second block inside your cart item loop to show details for each plan.
  </Step>

  <Step title="Save and test">
    Add a membership or subscription product to your cart and confirm the correct payment amounts display.
  </Step>
</Steps>

### Total recurring payment

Add this block below your cart item loop to calculate and display the total recurring payment for all items in the cart.

```liquid theme={null}
{%- assign total_recurring_payment = 0 -%}
{%- for item in cart.items -%}
  {%- if item.selling_plan_allocation and item.selling_plan_allocation.selling_plan -%}
    {%- assign adjustments = item.selling_plan_allocation.selling_plan.price_adjustments -%}
    {%- for adjustment in adjustments -%}
      {%- if adjustment.order_count == null -%}
        {%- assign recurring_payment = adjustment.value | divided_by: 100 -%}
        {%- assign total_recurring_payment = total_recurring_payment | plus: recurring_payment -%}
      {%- endif -%}
    {%- endfor -%}
  {%- endif -%}
{%- endfor -%}

<p>Monthly recurring payment: {{ total_recurring_payment | money }}</p>
```

### Line item plan details

Add this block inside your cart item loop to show each product's plan name, first payment, and recurring payment.

```liquid theme={null}
{%- if item.selling_plan_allocation and item.selling_plan_allocation.selling_plan -%}
  <div class="cart__item--details">
    <p>Plan: {{ item.selling_plan_allocation.selling_plan.name }}</p>

    {%- assign adjustments = item.selling_plan_allocation.selling_plan.price_adjustments -%}
    {%- for adjustment in adjustments -%}
      {%- if adjustment.order_count == 1 -%}
        <p>First payment: {{ adjustment.value | divided_by: 100 | money }}</p>
      {%- elsif adjustment.order_count == null -%}
        <p>Recurring payment: {{ adjustment.value | divided_by: 100 | money }}</p>
      {%- endif -%}
    {%- endfor -%}
  </div>
{%- endif -%}
```

## Notes

* **Placement:** The plan details block must sit *inside* the `{% for item in cart.items %}` loop.
* **Formatting:** If your prices appear incorrect, remove the `| divided_by: 100` filter — this depends on how your theme handles price formatting.
* **Non-plan products:** Items without selling plans are automatically skipped.
* **Accessibility:** Use clear labels like "First payment" and "Recurring payment" so customers and screen readers can easily understand the charges.

<CardGroup cols={2}>
  <Card title="Membership setup" icon="user-plus" href="/documentation/methods/membership/plans-setup">
    Learn how to set up membership plans and selling plan products.
  </Card>

  <Card title="Membership product setup" icon="tag" href="/documentation/methods/membership/product-setup">
    Configure membership products in your store.
  </Card>
</CardGroup>
