Prevent Add to cart button from showing for a second when disabled

You are here:
Estimated reading time: 1 min

When you choose to hide Add to cart button in the app, it takes ~< 1 second to load the app script (depending on the internet connection also). During this time period, the Add to cart button still shows because it has not been intervened yet.

In order to improve this problem, please follow our instruction here

1. Search for product template in the theme. It often is file product-template

2. Define the position of Add to cart button in this file. If you cannot find this file, it may be in a subfile named product-form (or similarity)

3. Add the following code snippet before the Add to cart button

{% assign isAuction = false %}

{% assign isRunning = false %}

{% for tag in product.tags %}

{% if tag == ‘auction’ %}

{% assign isAuction = true %}

{% endif %}

{% if tag == ‘running’ %}

{% assign isRunning = true %}

{% endif %}

{% endfor %}


After that, wrap Add to cart button (Buy now button or both) in the following tag to make sure your theme does not contain the element that you wrapped while products are being auctioned

If you cannot figure it out, don’t hesitate to contact us via email We are happy to help!

Was this article helpful?
Dislike 0
Views: 255