Tagging the Subscription Manager

Add a link to the Ordergroove Subscription Manager on your Shopify customers/account page

View as Markdown

You can update your customers/accounts page to include a link to Ordergroove’s Subscription Manager. If your customers/accounts page supports blocks where you want the link to be, check out our streamlined process for Online Store 2.0 at Convert your customers/account page to support Online Store 2.0.

Platform

This article is only applicable for stores on Shopify.


Before You Start

Ordergroove’s enrollment offer may not appear correctly if there are code snippets from other subscription programs present. To prevent this issue, please ensure that your theme is clean of other code snippets before installation.


Add the Subscription Manager Code

  1. Open the theme code editor on Shopify.
  2. Search in the list of files for a file called ordergroove_subscription_interface_link.liquid. If it exists, skip ahead to the Add link to the Subscription Manager section below.
  3. If it doesn’t exist, go to the Snippets folder and add a snippet called ordergroove_subscription_interface_link.liquid. In the blank new file, paste the following code:
customers/account.liquid
1{% comment %}
2
3Please add following code in customers/account.liquid at the end.
4
5{%- render 'ordergroove_subscription_interface_link' -%}
6
7{% endcomment %}
8
9{% if customer %}
10 {% assign secret_key = shop.metafields.ordergroove.themeHashKey.value %}
11 {% assign customer_id = customer.id %}
12 {% assign timestamp = "now" | date: "%s" %}
13 {% assign signature = customer_id | append: "|" | append: timestamp | hmac_sha256: secret_key %}
14 <p><a href="/apps/subscriptions/manage/?customer={{customer.id}}&customer_signature={{signature}}&customer_timestamp={{timestamp}}" class="btn btn--small">Manage Your Subscriptions</a></p>
15{% endif %}

  1. Open the theme editor on Shopify.
  2. Find the file for the accounts page (the most common file is customers/account.liquid).
  3. Add the following line of code to your customer account page:
1{%- render 'ordergroove_subscription_interface_link' -%}

Here is an example in the Debut theme’s customers/account.liquid:

This line of code will create a button that takes the user to the Subscription Manager. You can move that line of code to change where the button is placed on this page.