> For the complete documentation index, see [llms.txt](https://help.smartrr.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.smartrr.com/docs/getting-started/implementation/installing-smartrr-on-a-custom-shopify-theme-guided-install.md).

# Installing Smartrr on a custom Shopify theme (Guided Install)

Implementing Smartrr on storefronts with modified Shopify themes or custom liquid themes

{% hint style="info" %}
Coming from our app? [<mark style="color:blue;">Click here</mark>](#guided-install) to skip directly to guided install instructions.
{% endhint %}

{% hint style="warning" %}
**Note:** Before implementing Smartrr, it's important to [review Shopify's subscription requirements](https://help.shopify.com/en/manual/products/subscriptions/setup#eligibility-requirements) to determine your eligibility for offering subscriptions on your storefront. You must also have [<mark style="color:blue;">inventory tracking</mark>](https://help.shopify.com/en/manual/products/inventory/transfers/enable-tracking) enabled for a product to be subscription-eligible.
{% endhint %}

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FGNWaQ2vkmeMEuzGNnhbj%2Fimage.png?alt=media&amp;token=1652cb18-3658-4d13-935f-c7bc1d84a94c" alt="Table listing considerations for subscription products (sales channel support, discounts, payment gateways, draft order restrictions) and the five supported payment gateways: Shopify Payments, PayPal Express, Authorize.net, Adyen and Stripe."><figcaption></figcaption></figure>

If your store is using [<mark style="color:blue;">one of Shopify’s 2.0 free themes</mark>](https://themes.shopify.com/themes/dawn/styles/default), and have not [<mark style="color:blue;">made any customizations your your theme’s source code</mark>](https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/edit-theme-code), you’re eligible for our simple one-click automated install of Smartrr via our in-app Setup page.

{% hint style="info" %}
As of 2023, Shopify has begun offering **New customer accounts** as a setting option. New customer accounts are not compatible with apps; please ensure you are using **Classic customer accounts** with Smartrr in order to display our <mark style="color:blue;">Modern Account Portal</mark> where your customers will be able to access and manage their subscriptions. However, you can render our **Modern Account Portal** on its own page, and link it to a menu in the **New customer account** portal, or the store's main menu list.

![The customer account settings page in the Shopify admin. Shopify's new customer account doesn't provide a liquid file for the Smartrr customer portal to inject into. Instead, the Smartrr customer portal needs to be rendered on its own page and added to Shopify's customer account portal's menu options.](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FwBEi2G2QrcDlsYq7BLbH%2FScreenshot%202023-02-24%20at%2008.39.57.png?alt=media\&token=23c62ad1-efb9-48b4-84b9-354faa56f51d)
{% endhint %}

Within the Smartrr app navigate to **Setup** under RESOURCES in the left-hand menu.&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2Fghw4DkxZse2SWhXKigrp%2Fsubscription-setup.png?alt=media&amp;token=b9300045-5fc5-4afc-8cd5-291126466d34" alt="There are two parts to Smartrr setup: Subscription setup and On-site setup. Each has its own tab with required steps to get Smartrr up and running."><figcaption></figcaption></figure>

## Subscription setup

### 1. Set up a subscription program

Subscription Programs are the heart of the Smartrr app. If you're just getting started with subscriptions, we can create a demo program for you by clicking **Use a demo program**. This will automatically create a "Subscribe & Save 10%" program for your shop.&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FIl6XPcUdzBHkn94FpnU9%2Fuse-demo-program.gif?alt=media&amp;token=bd3bfb47-2baa-46fd-ac4a-ad18e15d51a6" alt="Gif highlighting the steps to create a demo subscription program."><figcaption></figcaption></figure>

Alternatively, you can create a new program from scratch by pressing **Create my own program**. You'll be redirected to our Subscription Program tab to complete this step. [<mark style="color:blue;">Learn more about setting up a Subscription Program here.</mark>  ](/docs/support/subscription-setup/subscription-programs.md)

### 2. Select subscription products

Now that your Subscription Program is created, your next step is to assign a product/s to this program.&#x20;

Similarly to above, Smartrr can create a demo product for you if you press **Use a demo product**. This will create a *Smartrr Snack Cookie (Demo)* in your Shopify shop. You can use this demo product for previewing purposes, and will be able to delete it at a later date directly within your Shopify admin.&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FNSJ4zqLaNFDRWgMQyk4s%2Fuse-demo-product.gif?alt=media&amp;token=753f2b7d-1f68-4d1c-8a8f-29573d7a154f" alt="Gif highlighting the steps to add a demo product."><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** If you select to create a Demo Product, it won't appear in previews or in your storefront until you go to your Shopify admin and set the product sales channel availability to "Online Store".&#x20;
{% endhint %}

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2Fx6rYy32NV8pNTrS2j2xk%2Fmanage-sales-channel.gif?alt=media&amp;token=b4334007-d2ea-4717-ba2d-211b881d91c5" alt="Gif highlighting the steps to add the newly created demo product to your Shopify store&#x27;s &#x22;Online Store&#x22; sales channel."><figcaption></figcaption></figure>

If you want to start with one of the existing products in your shop, press **Select from existing products**. You can select one or multiple products from the modal that appears.&#x20;

{% hint style="warning" %}
**Note:** We recommend always using [<mark style="color:blue;">variants</mark>](https://help.shopify.com/en/manual/products/variants) for your Shopify products when offering subscriptions, even if there is only one option for your product. Shopify auto-assigns a "Default variant" to a product that does not have any variants associated with it. If you decide to add variants to a product at a later date, and subscriptions are already running with the "Default variant", then those subscriptions will fail and will need to be re-mapped.&#x20;
{% endhint %}

### *Optional:* Smartrr optimizations

Now that you've completed the required Subscription setup steps, explore the remaining cards on this tab for ways you can further optimize your subscription business:&#x20;

* [<mark style="color:blue;">Setup subscription loyalty rewards & referrals</mark>](/docs/support/admin-portal/loyalty.md)
* [<mark style="color:blue;">Create dedicated shipping profiles for subscription purchases</mark>](/docs/support/subscription-setup/shipping-methods.md)
* <mark style="color:blue;">Customize the look and feel of your customer account portal</mark>
* [<mark style="color:blue;">Enable a passwordless login experience</mark>](/docs/support/admin-portal/passwordless-login.md)
* [<mark style="color:blue;">Set rules around failed payment attempts</mark>](/docs/support/transactions/failed-payments.md)
* [<mark style="color:blue;">Integrate with the ecosystem’s best</mark>](/docs/support/integrations/available-integrations-with-smartrr.md)

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FSOGWJVl218MJYFShmT8r%2Fsmartrr-optimizations.png?alt=media&amp;token=dbb563cb-e9bc-4cf9-be94-5421157b48a3" alt="The Smartrr dashboard&#x27;s setup view, showing the &#x22;Optional: Smartrr optimizations&#x22; list."><figcaption></figcaption></figure>

## On-site setup

### 1. Install Smartrr snippets

{% hint style="warning" %}
**Warning:** To prevent Smartrr from showing up on your site before you're ready to launch, we recommend navigating back to Shopify’s Themes to duplicate a copy of your current theme (Actions > Duplicate). Name it something that is easily recognizable, such as **\[Your Store] Smartrr Integration Copy \[Date]** so that when you modify the below code, you know you are updating the correct theme.

![Display of the "Duplicate" option in the Shopify theme's action items.](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FIThbxrXwc01bsOzTfVqY%2FScreen%20Shot%202022-03-18%20at%2011.22.44%20AM.png?alt=media\&token=6516717d-6ec9-469b-8a0e-92267f10bbd2)
{% endhint %}

Select the Shopify theme you'd like Smartrr snippets to be in stalled on. Smartrr Snippets are files that are injected into your code base and will *not* modify any existing liquid files. These are required in order to render Smartrr on your storefront. There are five files that will be added under the **Snippets** section in your theme's liquid code.

{% hint style="info" %}
Note: If you're planning on using [<mark style="color:blue;">Smartrr's subscription widget</mark>](#2.-add-smartrr-subscription-widget), leave the ***I'm planning on using Smartrr's subscription widget box*** checked. If you're *<mark style="color:red;">not</mark>* using a liquid Shopify theme compatible with app blocks, *<mark style="color:orange;">and/or</mark>* are planning to manually render subscription options on your shop's PDPs with the assistance of a developer, uncheck this box. \
\
If you're unsure, no worries. You can always duplicate a clean version of your Shopify theme and re-install Smartrr snippets again.
{% endhint %}

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FbUF9NaQpP0D3PjgFEAmF%2Finstall-snippet.gif?alt=media&amp;token=939e3f89-810b-4190-a9c5-f6832da418aa" alt="Gif highlighting the steps to install Smartrr snippets on a Shopify theme."><figcaption></figcaption></figure>

### 2. Add Smartrr subscription widget (Guided install)

Smartrr's subscription widget is an app block that can be added to your Default product page from your Shopify theme's online customizer. However, if you're *<mark style="color:red;">not</mark>* using a liquid Shopify theme compatible with app blocks, *<mark style="color:orange;">and/or</mark>* are planning to manually render subscription options on your shop's PDPs with the assistance of a developer, you'll need to use our guided install process.

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FuI1XzKEdTTvH7FLalU1m%2FScreenshot%202023-04-12%20at%2019.21.19.png?alt=media&amp;token=0f77d0d6-abe0-4a08-919b-2be9de0f677f" alt="On this same setup page, the &#x22;Guided install&#x22; button is the last option shown at the end of the page. Scroll down and click this button to start the guided installation."><figcaption></figcaption></figure>

#### 1. Modifying the Product Page

In your duplicated theme’s liquid code files, find the liquid file where your site’s product form information is being stored. This is usually called **main-product.liquid** or **product.liquid**. This file is typically located under either the **Sections** (for Online Store 2.0) or **Templates** (for older Shopify themes) heading.

<img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FzQBXhsaYF7nxQdpV95So%2FSmartrr%20Help%20Docs%20%E2%80%93%206.jpg?alt=media&amp;token=58159c79-52c1-4a84-9589-5fb4571b7297" alt="Locate the theme file responsible for building the product form (includes variant pickers and the add to cart button). This is could be the snippets/main-product.liquid or snippets/buy-buttons.liquid files." data-size="original">

Once you’ve opened the file, search for the product form {%- form 'product'}, paste the following Smartrr snippet inside the form. We typically recommend placing between the variant selector and the quantity selector, but you can place in any order you see fit.&#x20;

```
{% render 'smartrr-product' %}
```

When added, the product form should look something like this:&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FwMSThbnxbYRUq55KgJtZ%2FSmartrr%20Help%20Docs%20%E2%80%93%207.jpg?alt=media&amp;token=de47868e-0223-4344-ba51-f637a888a7e3" alt="Render the Smartrr widget within the product form using the line {% render &#x27;smartrr-product&#x27; %}."><figcaption></figcaption></figure>

Save the file. You should be able to preview Smartrr on your site upon successfully modifying this product form. Having trouble? Skip to [**Troubleshooting**](#troubleshooting) steps.

#### 3. Modifying the Customer Account Page

In your duplicated theme’s code base, find the liquid file for your store’s account page. This is usually called **main-account.liquid** or **customers/account.liquid**. This file is typically located under either the **Templates** heading.&#x20;

At the very beginning of the file, paste the following snippet:

```
<!-- BEGIN SMARTRR SNIPPET -->{% render 'smartrr-account' %}<!-- END SMARTRR SNIPPET -->
{{ 'customer.css' | asset_url | stylesheet_tag }}
```

The file should look like this:&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FGA2d6aqITWxEE2huu0ur%2FSmartrr%20Help%20Docs%20%E2%80%93%208.jpg?alt=media&amp;token=9a0ea82b-325f-4e38-aff0-6b77d08b838c" alt="For legacy Shopify customer account portals, you can render the Smartrr customer portal instead by including {% render &#x27;smartrr-account&#x27; %} at the top of the customer account liquid file (usually named account.liquid). For Shopify&#x27;s new customer account portal, you&#x27;d want to create a page template, add the render line there, create a page and connect that page to the template. You can link that page to a menu (the store&#x27;s main menu or the customer accounts portal menu list)."><figcaption></figcaption></figure>

Save the file.&#x20;

#### 4. Modifying the Order Status Page

If you would like to display a link to your customer’s Account Portal from the order status page, please email us at [hello@smartrr.com](mailto:help@smartrr.com) and we will assist you.

## Troubleshooting

#### Why don't see Smartrr on my theme once I preview?

Whether you've created a demo Subscription Program or made a new program from scratch, you may need to double check and make sure your program details have been successfully "saved". To do this, go to **Subscription Programs** > **Manage Program**. Check and see if there is a Discard / Save banner at the top, and click the green **Save** button.

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FEbJextTYappmOn100Tqw%2Fsave-subscription-program.png?alt=media&amp;token=69be3b6d-2792-4e33-a6d9-c13bdf65fab4" alt="If the Smartrr widget doesn&#x27;t render, be sure to confirm your subscription program is created, includes products and is saved."><figcaption></figcaption></figure>

{% hint style="info" %}
Still having trouble installing and don’t have access to a developer? We partner with a handful of excellent agencies. We also offer full white-glove onboarding support with our [<mark style="color:blue;">Grow and Excel plans.</mark>](http://smartrr.com/pricing)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.smartrr.com/docs/getting-started/implementation/installing-smartrr-on-a-custom-shopify-theme-guided-install.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
