Overview
SC Sales Motivator only requires a liquid code installation if you are planning on offering a free gift to your customers while on the Premium Plan, or your theme uses an AJAX cart. With AJAX, a cart will update without going to the actual cart page. The liquid code will be needed to ensure the banner and free gift update correctly.
We offer a few different options to help you complete this installation on your store:
- The ability to request a professional installation from our team
- A step-by-step guide on completing this manually
Before you start we highly recommend creating a Duplicate version of your Shopify theme to ensure you have a copy without our code installation.
Table of Contents
Alert
If you are planning on offering free gifts to your customers, you will need to reach out to our Merchant Success team to enable a feature on the backend once the installation has been completed.
Request a SC Sales Motivator Install
Alert
To maintain the security of your Shopify account, we ask that you do not proactively send us a staff account invite for access to your shop. Instead, our team will request collaborator access to your shop.
- From within the Motivator admin, select Need Help?
- Select Liquid Installation.
- Select Request Motivator Premium Liquid Install.
- Select the theme you would like us to install the Liquid code onto.
Note: You can specify any additional instructions for our installs team in the text field below.
- Select Looks Good! Send Away!
Manual Install
Step 1: Edit theme.liquid
- Under Layout, select theme.liquid.
- Copy and paste this code directly above the tag:
{% if product.metafields.inventory.ShappifyHidden == "true" %} <meta name="robots" content="noindex"> {% endif %}
- Select Save.
Step 2: Edit collection.liquid
- Under Templates, select collection.liquid.
Note: If your theme contains sections, you will instead need to select the collection-template.liquid section instead.
Find the following code:
{% for product in collection.products %}
Note: This line may appear more than once in the theme file. You will need to add the line of code for each instance.
Copy and paste this code directly below each instance:
{% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 3: Edit index.liquid
Alert
If your theme does not have an index.liquid file, you can skip this step.
- Under Templates, select index.liquid.
Find the following code:
{% for product in collection.products %}
Note: This line may appear more than once in the theme file. You will need to add the line of code for each instance.
Copy and paste this code directly below each instance:
{% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 4: Edit related-products.liquid
- Under Snippets, select related-product.liquid.
Note: If the theme does not have the file related-product.liquid, proceed to the next step.
Find the following code:
{% for product in collection.products %}
Note: This line may appear more than once in the theme file. You will need to add the line of code for each instance.
Copy and paste this code directly below each instance:
{% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 5: Edit search.liquid
- Under Templates, select search.liquid.
Note: If you are not able to find this within the search.liquid file, you may find this code in a similarly titled file instead.
Find the following code:
{% for item in search.results %}
Note: This line may appear more than once in the theme file. You will need to add the line of code for each instance.
Copy and paste this code directly below each instance:
{% if item.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 6: Edit product.liquid
- Under Templates, select product.liquid.
Note: If your theme contains sections, you will need to select the product-template.liquid section instead.
- Paste this code at the top of the file:
{% if item.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 7: Edit cart.liquid
- Under Templates, select cart.liquid.
Note: If your theme contains sections, you will instead have to look for this code within the cart-template.liquid under Sections.
- Find a line that starts with <input, ends with />, and contains value="{{ item.quantity }}".
Copy and paste:
{% if item.product.metafields.inventory.ShappifyHidden == 'true'%} readonly {% endif %}
right before the />.
It will look similar to this:
<input value="{{ item.quantity }}" {% if item.product.metafields.inventory.ShappifyHidden == 'true'%} readonly {% endif %} />
- Select Save.
Manual Install (Dawn Theme)
Step 1: Edit main-collection-product-grid.liquid
- Under Sections, select main-collection-product-grid.liquid.
- Copy and paste this code inside the product loop:
{% if product.metafields.inventory.ShappifyHidden == "true" %} <meta name="robots" content="noindex"> {% endif %}
- Select Save.
Step 2: Edit featured-collection.liquid
- Under Sections, select featured-collection.liquid.
- Copy and paste this code inside the product loop:
{% if product.metafields.inventory.ShappifyHidden == "true" %} <meta name="robots" content="noindex"> {% endif %}
Select Save.
Step 3: Edit main-cart-items.liquid
- Under Sections, select main-cart-items.liquid.
Copy and paste the following code inside the cart item input:
{% if item.product.metafields.inventory.ShappifyHidden == 'true'%} readonly {% endif %}
Wrap the following code around the cart update buttons:
{% if item.product.metafields.inventory.ShappifyHidden != 'true'%}
{% endif %}
- Select Save.
Step 4: Edit main-search.liquid
- Under Sections, select main-search.liquid.
Inside the item loop, copy and paste this code:
{% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Step 5: Edit main-product.liquid
- Under Sections, select main-product.liquid.
Copy and paste the following code to the top of the file:
{% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}
- Select Save.
Code Removal
If you would like to remove the liquid code from your theme, the liquid code can be removed by deleting code mentioned in the instruction steps above.
You can otherwise request a code removal by contacting our Merchant Success team.
Pro-Tip
If you are experiencing issues with performance on the storefront with SC Sales Motivator after completing the steps above, we recommend requesting an expert installation, as your theme may require further liquid code changes. See previous step Request a Motivator Install for more information.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article