Solved

"Add to cart" button disappears sometimes.

Daniel25
Shopify Partner
10 1 3

Hello,

 

I noticed that the add to cart button disappears and appears on the product detail page. If you load the page the button is visible for a second and then it's gone.

If you reload the page a couple of times it appears and disappears. Anyone an idea? The page is shop.avoseedo.com

 

Thanks,

Accepted Solution (1)
Daniel25
Shopify Partner
10 1 3

This is an accepted solution.

I found the issue and fixed it. For anyone else who may have this, it was caused by an app I had installed and uninstalled some time ago. 

The app was: Advanced PreOrder(Partial Pay) it added a class to the button sometimes which made it disappear. It left a javascript call in the header.

<script src="https://shinedezign.tk/preorder/js/preorder.js"></script>

 

After deleting it everything was normal again.

Thanks!

View solution in original post

Replies 12 (12)

Propero
Shopify Partner
895 101 160

@Daniel25 

Are you using some apps to show inventory availability? The code is loaded dynamically and it makes it appear late. But functionally no issue. if the code was inline instead of being loaded through javascript you won't see any lag.

Hope it helps.

- Was my reply helpful? Click Like or Click Accept as Solution
To hire: email us at shopify@propero.in
checkout our app https://apps.shopify.com/picamaze
Daniel25
Shopify Partner
10 1 3

Hi,

@Propero 

thanks for your reply. No I don't use any apps to show inventory I just use the Shopify inventory management that comes with. 

I also checked the product.liquid template I couldn't find anything obvious. Here is the button code:

 

 

            <div class="purchase-section{% if product.variants.size > 1 %} multiple{% endif %}">
              {% unless product.available %}
              <p>Out of stock</p>
              <p>Notify me when item is back in stock</p>
              {% else %}
              <p>In stock</p>
               <div class="product-single__quantity{% unless settings.product_quantity_enable %} is-hidden{% endunless %}">
                <input id="minus" class="qtyminus" type="button" value="-">
                <input type="number" id="Quantity" name="quantity" value="1" min="1" class="quantity-selector">
                <input id="plus" class="qtyplus" type="button" value="+">
              </div>
              <input type="submit" class="btn addtocart" name="add" value="Add to cart" id="add-to-cart" />
              <div id="cart-animation" style="display:none">1</div>
              <input type="hidden" name="return_to" value="/checkout" />
              {% endunless %}
            </div>
        <!-- End product options -->
          {% if product.available %}
        </form>
          {% endif %}

 

Propero
Shopify Partner
895 101 160

@Daniel25 

Ok, any app for product options? If the answer is no, I will have to login to your admin panel through collaborator access to check. Direct message me if needed.

 

- Was my reply helpful? Click Like or Click Accept as Solution
To hire: email us at shopify@propero.in
checkout our app https://apps.shopify.com/picamaze
Daniel25
Shopify Partner
10 1 3

This is an accepted solution.

I found the issue and fixed it. For anyone else who may have this, it was caused by an app I had installed and uninstalled some time ago. 

The app was: Advanced PreOrder(Partial Pay) it added a class to the button sometimes which made it disappear. It left a javascript call in the header.

<script src="https://shinedezign.tk/preorder/js/preorder.js"></script>

 

After deleting it everything was normal again.

Thanks!

TOA
Visitor
1 0 0

Worked. This has been an issue for the last year. Thank you!

CordersOutpost
Visitor
1 0 0

Worked for me as well. Thank you.

Ivi_Kyratzi
Visitor
1 0 0

Hi there. This happened to me to. Where did you find this code in order to delete it?

Propero
Shopify Partner
895 101 160

@Ivi_Kyratzi ,

It may not be same code/script which is causing for you but something else. Can be looked at by logging in.

 

- Was my reply helpful? Click Like or Click Accept as Solution
To hire: email us at shopify@propero.in
checkout our app https://apps.shopify.com/picamaze
Daniel25
Shopify Partner
10 1 3

Go to Sales Channels -> Online Store -> Themes > customice -> on the left on the bottom Theme actions -> edit code and then theme.liquid should have the code snippet somewhere at the top between the <head> 

YoungTrend
Visitor
1 0 0

so if I delete this code from the theme it will solve the issue?

<script src="https://shinedezign.tk/preorder/js/preorder.js"></script>

 

I am apprehensive to delete this in case anything happens? 

Thanks  

Daniel25
Shopify Partner
10 1 3

If you don't want to use this add-on anymore you can remove it without any issues. Also, you can add it again if you see something has changed. 

richmelis
Visitor
2 0 0

This solved my missing ATC button issue too. YAY! Thanks so much!