Many a time customers want to integrate special apps in their featured products. This is simply done to draw the attention of customers and simultaneously sell scarce and limited stocks.

Let’s understand how you can integrate such an app with featured products!

Steps to integrate Stock Scarcity with Featured Products

With the help of screenshots, you can easily integrate Stock Scarcity with featured products:

Step 1: From your online admin, go to Online Stores and then move to “Themes”.

Step 2: Now, click on the “Edit Code” option.

Step 3: Search "featured-product.liquid" or "featured-product-template.liquid" in the search field. Open the file that is applied to the present theme.

Step 4: Now paste the below code in "featured-product.liquid" file and click Save.

window.xt_stc_{{}} = {{ product | json }};
{% for variant in product.variants %}
window.xt_stc_{{}}.variants[{{ forloop.index }} - 1].inventory_quantity = {{variant.inventory_quantity }};
{% endfor %}
<div class='xoot_stockscarcity_static' data-id="xt_stc_{{}}"></div>

Here's how the embedded code will look like:

When you have clicked on the Save button, the enabled changes will be instantly made in your store and the app will be integrated with Featured Products.

Did this answer your question?