Loop's subscription widget displays subscription options on your product pages, letting your customers choose delivery frequency, discounts, and other benefits before adding a product to cart. It appears alongside the one-time purchase option, so your customers can see both choices in one place.
The image below illustrates how the Loop widget appears on the storefront.
This article will guide you through the steps required to enable Loop’s subscription widgets on your online store. While we’ve streamlined and automated most of the process, some themes may still require manual adjustments. If that’s the case, feel free to reach out to us at [email protected]
Installation methods
There are two ways to implement the Loop subscription widget on your store:
App-block based widget: The quickest method if you use Shopify theme 2.0. No coding is required, and you can set it up in under 2 minutes. Ideal for most stores.
Manual installation: Recommended if you use Shopify 1.0 or custom themes and need a highly customized subscription widget. This involves developer effort to manually embed and modify the widget code.
App-block widget setup (stores that joined Loop after July 23, 2024)
Follow these steps to complete the process.
Navigate to Loop admin > Acquire > Widget, then click Create new widget.
Enter the widget name, select the widget type and frequency selector layout based on your requirements. You can configure additional settings through the Preferences, Styles, and Texts tabs. Once all configurations are complete, click Save widget.
Click Change next to "Shopify themes mapped" to see the list of all product page templates for the selected theme.
Ensure the app block is added to the required template. If you don't see all the templates where you want to add the subscription widget, click Add more templates and select the ones that aren't checked yet.
To add the app block to a template, click Add app block. This opens the Shopify theme editor and automatically adds the Loop widget. Place the widget where you want it and click Save
Switch to Loop admin and click Refresh status to fetch the latest app block status for the selected theme templates.
Select all the product pages where you want to display the widget design and click Map.
Verify the newly added widget on the product page.
Disclaimer: If you publish a new theme on your storefront, make sure the app block is added to all product page layouts and a Loop widget template is mapped to all product page layouts. This ensures your Loop widgets continue to function across all product pages after the theme update.
Manual installation for custom widget
Use this method when you need a highly customized subscription widget with specific design elements or behavior that the standard widget configuration does not support. Developer intervention is required to manually embed and configure the widget on your store.
Installation process for existing stores that joined Loop before July 23, 2024
This installation method generally works for themes that are not custom. You can add all the relevant subscription widgets across different parts of your online store with one click.
Follow these steps to complete the process.
Navigate to Loop admin > Acquire > Widget installation, then select the theme and follow the steps shown to install the widget.
You can also configure various settings by navigating to the subscription widget section, including custom settings.
Note: If you’ve followed all the steps but the subscription widget still isn’t visible on your product page, click here to view the troubleshooting guide for additional checks and solutions.
Manual/Custom installation
Some themes require manual installation of specific snippets to resolve different issues. Follow all the steps below in order to cover as many scenarios as possible.
Follow these steps to complete the process.
Before starting the installation process, create a duplicate theme to avoid any damage to your live theme.
Select Edit code under actions to open the editor screen.
To install the Loop widget in your theme, download the following widget files and upload them to the respective folders of your theme.
Snippets: loop_subscriptions.liquid, loop_loader.liquid, loop_widget_standard.liquid, loop_widget.css, customer_portal_link_v2.liquidAssets: loop_widget.js
Go to the
theme.liquidfile and replace</head>with the following snippet. This allows the subscription widget to render on the product page.<script type="text/javascript" id="loop-subscription-script" src="{{ 'loop-widget.js' | asset_url }}"></script>
</head>
<style class="loop-style"> {% render 'loop-widget.css.liquid' %} </style>Now you need to make changes to the product page. Find the files that contain the
add_to_cartorformcode and add the Loop snippet there.The files that generally contain the required code are:
product-template.liquid,product.liquid,product-form.liquid,product-info.liquid, ormain-product.liquid.To locate the exact file where the Loop widget code needs to be rendered, look for the class of the "Add to Cart" button on the product page.
Now we need to install the widget in that file that contains the button class and also has the form product code which starts with - form 'product'
Search for the form product code that starts with
{% form 'product'and check if the button class is present in the same liquid file. This identifies the file where the Loop widget code needs to be rendered. Please look at the screenshot below in which the product code is shown and our loop code is placed just below that code.Start your search with product-form.liquid: If you find this file and it contains the form code, make the changes here. Otherwise, move to the next file.
Click on this file to modify the code and now paste the widget code mentioned below before any button location, like we did for ‘quantity’ as an example. This will place the subscription widget above the quantity button on the product page.
{% render 'loop-subscriptions', type: 'product-widget', product: product %}Search with product-template.liquid: If you are unable to find the product-form.liquid file or the form code, then look for the other product files as mentioned. Search for - % form 'product’ and find the line of code for the form button. Paste the widget code mentioned below before the button location. This will place the subscription widget above the “Add to Cart” button on the product page. Now save these changes and preview to check if the widget is working or not.
If you are not able to find the { % form ‘product’ in the above file, then search for the same using this extension and it will easily search for all the files having form product code.
Sometimes rendering the widget code below the { % form ‘product’ renders the widget somewhere else on the product page instead of rendering on the top of the "Add to cart button". In that case, we have to just remove the widget render code i.e {% render 'loop-subscriptions', type: 'product-widget', product: product %} that was placed below { % form ‘product’ and put the widget render code above the add to cart button which is already there in the same liquid file.
How to verify the widget is working?
After installation, follow these steps to confirm the widget is set up correctly.
Go to any product page on your store.
Select the Subscribe and Save option.
Proceed to the checkout page.
Check that the line property shows the subscription details and that the recurring billing total is displayed correctly.
Widget not showing on your store?
If the widget is not visible on your product page after installation, it is usually due to one of the following reasons:
The storefront widgets master switch in Loop admin is turned off.
The specific widget mapped to the product page is not set to active.
The widget is not mapped to the correct theme or product page template.
The Loop subscription widget app block is missing, hidden, or deleted from the product template in the Shopify theme editor.
The product is in draft state or not available on the online store sales channel.
The product is not mapped to any selling plan in Loop or Shopify.
The product is not assigned to the correct product template where the widget is hosted.
The selling plan mapped to the product is not set to be available on storefront touchpoints.
The "Hide the subscription widget if only one selling plan is available" preference is enabled, and the product has only one selling plan.
The "Hide bundle selling plans on individual product pages" bundle preference is enabled, and the product is part of a bundle with a single selling plan.
Two selling plans with the same name are mapped to the product, and one of them is hidden from the storefront.
Custom code has been added to hide the widget in specific markets or countries.
For a detailed explanation of each issue and how to resolve it, refer to the widget troubleshooting guide.
Customising the widget
You can customise the following aspects of the widget to match your brand and storefront experience:
Widget layout: choose from radio group, button group, or checkbox.
Frequency selector: display frequency options as a dropdown or as buttons.
Preferences: control default selection, purchase option order, discount badge visibility, strikethrough pricing, selling plan description display, subscription details popup, prepaid plan pricing display, and more.
Styles: adjust background colour, border colour, border width, border radius, margins, padding, and other visual properties for each section of the widget. You can also add custom CSS.
Texts: Customise the default text labels on the widget to match your brand tone, including button text, plan names, and descriptions.
For a full walkthrough of every configuration option, refer to the widget configuration guide.
FAQs
Can we test the Loop widgets without making any changes to our live theme?
Can we test the Loop widgets without making any changes to our live theme?
Yes, you can install the Loop widgets on a non-live (unpublished) theme to experiment and play around with the subscription set-up on your store before going live with the Loop.
Navigate to Loop > Acquire > Widgets > Select the created widget and choose an unpublished theme where you would like to install the Loop widget.
Can we customise the Loop subscription widgets?
Can we customise the Loop subscription widgets?
Yes, you can fully customise the loop subscription widgets to match your brand's look and feel.
Do I have v1 or v2 widget installed on my Loop?
Do I have v1 or v2 widget installed on my Loop?
If your Loop > Acquire menu shows 'Subscription Widget', it's a v1 widget. If the menu says 'Widget' only, you have the v2 widget enabled on your Loop Admin.
Which version of the Loop widget is compatible with the region-specific selling plans?
Which version of the Loop widget is compatible with the region-specific selling plans?
The latest V2 version of Loop is Compatible with the region-specific selling plans.
Does the widget show on draft templates?
Does the widget show on draft templates?
You can not see the widget on the draft template on the live store, but you can preview it on the draft theme by clicking the preview button on the same widget page.
How do I make Loop work with my custom widget? I need to pass Loop's selling plan to the custom widget created by my developer.
How do I make Loop work with my custom widget? I need to pass Loop's selling plan to the custom widget created by my developer.
Process of Adding "App ID Check" and "Passing Selling Plan ID" in Shopify is as follows (Considering Shopify's LOOP APP_ID for custom widget is 5284869):
App ID Check:
Purpose: Ensure the correct app is loaded and functioning properly within your Shopify theme.
Steps:
Identify the App ID: Obtain the App ID from the app's documentation or admin panel.
Add a Check in the Theme Code:
Locate the relevant liquid files (
theme.liquid,product.liquid, orproduct-template.liquid).Add a conditional check to ensure the app is loaded properly:
liquid
{% if shop.app_id == 'your_app_id' %} <!-- Your app-specific code here -->
{% else %} <!-- Fallback or error message -->
{% endif %}
Test the Integration: Verify that the app ID check works as expected and the app features load correctly.
Passing Selling Plan ID:
Purpose: Link products to specific subscription plans, enabling Shopify checkout to recognise subscription options.
Steps:
Retrieve Selling Plan ID: In the Loop Subscriptions admin, navigate to the selling plans section to find the ID associated with each subscription plan.
Modify the Product Form: Edit the product page's liquid template (product.liquid or product-template.liquid).
Add a hidden input field within the product form to pass the Selling Plan ID:
liquid
<input type="hidden" name="selling_plan" value="{{ your_selling_plan_id }}">Dynamic Selling Plan Selection: If offering multiple plans, use JavaScript to dynamically update the hidden input based on user selection:
javascript
document.querySelector('#your-plan-selector').addEventListener('change', function() {
document.querySelector('input[name="selling_plan"]').value = this.value;
});
Test the Subscription Flow: Ensure the correct Selling Plan ID is passed to the checkout when customers select subscription options.
Confirm how the code looks:
{
% liquid assign selected_selling_plan = null if product.selected_selling_plan and product.selected_selling_plan.selling_plan_group.app_id == "5284869"
assign selected_selling_plan = product.selected_selling_plan else for group in product.selling_plan_groups if group.app_id == "5284869"
assign selected_selling_plan = group.selling_plans.first break endif endfor endif %
}
Need help?
No worries - we're here for you!
If you have any questions or need assistance, feel free to email us at [email protected] or chat with us using the support beacon at the bottom right of your screen.
Regards,
Loop Subscriptions Team 🙂












