Stock scarcity allows a merchant to increase sales by developing a sense of urgency for rare, limited, and scarce products.

Once you have set up the app and have made all the desired customizations, you can easily change the position of the app. Though the app is positioned in the rightful place, however, you can easily change it according to your needs.

Steps to change the position of Stock Scarcity

If you wish to change the "Stock Scarcity" position, then simply follow the below steps:

Step 1: From your online admin, go to Online Stores > Themes

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

Step 3: Search "product-template.liquid" in the search field and open that file.

Step 4: Now paste the below code in "product-template.liquid" file at the desired position and click Save.

Note: Make sure the below code is wrapped in the product form tag.

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 it will look:

When you click on the Save button, the changes will be embedded instantly and the position of Stock Scarcity will be changed to a new one.

Did this answer your question?