You may want to display the subscription frequency below each product on the cart page. This guide provides the code to add to your cart.liquid file to show the frequency.
Note: This feature is only available for Shopify merchants who installed ReCharge before November 2nd, 2020, and are using the ReCharge Checkout.
View an example
Before you start
- This feature will require advanced HTML and Shopify Liquid knowledge.
- This customization is not supported by ReCharge as per our design policy since it requires custom coding.
Install the code
- Under Sales Channels in your Shopify Admin, click Online Store.
- Locate your theme and click Actions and select Edit code.
- Open the cart.liquid file and search for the section of code that runs the properties of each product in the cart. It will generally look like this:
- Between the
{% endunless %}
and{% endfor %}
, add the following lines of code.{% assign recurringchecked = "false" %} {% for p in item.properties %} {% if p.first == 'shipping_interval_frequency' %} {% assign frequency = p.last %} {% assign recurringchecked = "true" %} {% endif %} {% if p.first == 'shipping_interval_unit_type' %} {% if frequency == '1'%} {% if p.last == 'Days' %} {% assign frequency_unit = 'Day' %} {% elsif p.last == 'Months'%} {% assign frequency_unit = 'Month' %} {% elsif p.last == 'Weeks'%} {% assign frequency_unit = 'Week' %} {% endif %} {% else %} {% assign frequency_unit = p.last %} {% endif %} {% endif %} {% endfor %}
- Add the following code above the last
{% endif %}
to show the text:{% if recurringchecked == "true" %} Recurring Delivery every {{frequency}} {{frequency_unit}}. Change or cancel anytime
{% endif %} - Click Save.