Goal: Add a “Subscribe & Save” button under the Add to cart button, but only on selected product pages in the Shopify Sense theme (example: Kale Krush).
Proposed approaches:
Metafield + Liquid (code edit): Create a product metafield (e.g., custom.subscription_button) and in main-product.liquid conditionally render a button below Add to cart when the metafield has a value. Alternative variant checks specific product handles.
Separate template + Custom Liquid block (no global code edit): Create a dedicated product template, assign it to chosen products, then add a Custom Liquid block with the button’s HTML and link.
JSON template path: Since products use JSON templates, one suggestion is to add a new button block in the JSON template, tie its link to a metafield value, and use conditional visibility, then enable the block in the Theme Editor. A screenshot was shared showing adding blocks; the requester asked what exact code to place.
Key terms: Metafield (custom product field for per-product data), product handle (URL-friendly product ID), JSON template (config-driven product layout).
Status: No confirmed solution yet; the requester needs concrete code for their JSON template setup.
Summarized with AI on December 16.
AI used: gpt-5.
Hi! How would I add the ability to have a button below my Add to cart button on SOME (not all) of my product pages? I want to link people to a page to subscribe and save on certain product pages…
Hello @talsworld ,
To add a “Subscribe and Save” button below the “Add to Cart” button on specific product pages in your Shopify store using the Sense theme, you can follow these steps. This requires editing the theme’s liquid code and adding a condition to display the button only on certain product pages.
Steps:#### 1. Identify the Template File for Product Pages
In Shopify, product pages are typically rendered using the product.liquid or main-product.liquid template (depending on your theme). The Sense theme might have a specific file structure, but the goal is to find the template where the “Add to Cart” button is located.
2. Navigate to Your Shopify Theme Editor1. From your Shopify Admin, go to Online Store > Themes.
Find your Sense theme and click Actions > Edit code.
Find the Product Template
Look for the file where product pages are rendered. In most cases, it’s under:
Sections/product.liquid
Sections/main-product.liquid
You will find the code for the “Add to Cart” button there.
4. Add a Custom Button Below the Add to Cart Button1. Locate the code for the “Add to Cart” button. It should look like this:
Right after this code, add the following custom HTML for the “Subscribe and Save” button:
{% if product.handle == 'kale-krush' or product.handle == 'another-product-handle' %}
Subscribe & Save
{% endif %}
Replace /pages/subscribe-and-save with the actual URL of your “Subscribe and Save” page.
Use the correct product handles in the if condition. You can find the product handle in the URL of your product page (e.g., for your page kale-krush).
Style the Button (Optional)
If you want to style the button to match your theme, you can add custom CSS. Either modify existing styles or create new ones. Here’s an example:
Add this CSS to your theme’s stylesheet (theme.css or theme.scss.liquid).\
Save Your Changes
Once you’ve made these changes, click Save.
Final Result:
On the specific product pages where the condition matches (like “Kale Krush”), a “Subscribe and Save” button will appear below the “Add to Cart” button, linking users to the subscription page.
Sure! Since you’re using the Sense theme with individual JSON templates, we can still add the button by using product metafiled and a bit of customization within the product templates. The approach involves adding a block to your product template and using conditional visibility in Shopify’s theme editor.
Follow these steps:
Set Up a Metafield to Control the Button’s URL:
Go to Setting > Custom data > Product in your Shopify admin.
Click Add Defination.
Name it something like Subscribe Button URL.
Set the Namespace and key to custom.subscribe_button.
Set the Content type to Single line text.
Save the metafield definition.
Assign the Metafield Value to Relevant Products:
Go to Products in Shopify and open the product you want (e.g., Kale Krush).
Scroll down to Metafield.
In the new Subscribe Button URL metafield, paste the subscription page link you want (leave it empty for products where no button should appear) and save the product.
Add a Button Block to the Product Template via JSON File
Since you’re using JSON-based templates, we can add a block that dynamically displays based on the metafield.
Online Store > Themes > Edit Code
Open the relevant product template, e.g., product.kale-krush.json.
Find the section or block where the “Add to Cart” button is located (likely in main-product or a product form block).
Add a new block entry for the button inside the section. Here’s an example: