Disable add to cart button on sold out products

Disable add to cart button on sold out products

adammahon
Shopify Partner
35 0 7

Hello all. I am attempting to grey out and disable the add to cart button when you select a sold out variant. I have tried so many different liquid variables and other various ways of achieving this but none of them seem to work.

I have linked here one of my products (https://deauxofficial.myshopify.com/products/script-logo-tee). The variable 'M' is out of stock, but the button does not grey out when 'M' is selected. I appreciate anyone who could help.

 

Thanks! 

Replies 8 (8)

CH23
Visitor
2 0 0

Under Products, navigate to your product and you will see the variant options.  Select the variant and choose edit.  Scroll down to where is says inventory and Select Track quantity and the next option that says Continue selling when out of stock needs to be deselected or not selected.  I hope that helps. 

adammahon
Shopify Partner
35 0 7

Hi @CH23, I appreciate you coming back to me. This is looking like a custom code issue rather than a settings issue. I appreciate your efforts though!

Skye
Shopify Staff
1122 99 201

Hi, @adammahon 

 

Greetings, and thanks for posting.

 

Stopping the sale of sold-out products should not require adjusting the theme liquid. When creating your products, if you want to prevent customers from purchasing products that are sold out, you will need to track the products inventory, and make sure to select 'Continue selling when out of stock.'

 

If you have this selected for each of your products, and customers are still being able to add the products to the cart, it could be your coding that has caused the issue. I recommend setting testing on a fresh theme. This means a theme that is freshly downloaded to your theme library and has not had any customizations done to it.

 

In the meantime, it looks like your store is password protected. If you can provide the password I would love to take a look and see what additional feedback I can provide. 

Skye | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
adammahon
Shopify Partner
35 0 7

Hi Skye. I appreciate your response.

Yes customers can still add this product to the cart when I have those options selected as mentioned. Also, when I select these options the text no longer switches to 'Sold out' on the sold out variants.

I will add my store password so you can take a closer look: rahdro

Skye
Shopify Staff
1122 99 201

Hi, @adammahon 

 

Thanks for providing the password, the site is beautiful so far! I especially like the footer. 

 

That being said, if you have the correct settings enabled in your Shopify Admin, and the products are not being listed as 'sold out,' then the issue is with your theme. Which theme are you using?

 

To fix this, you would need to correct the coding adjustments you have made. If you're unsure of how to do that, the best course of action is to download a fresh version of the theme and compare the codes between your customized version, and the fresh version. Another option would be to roll back your theme to before you made the customizations. 

 

In the meantime, as I can see the store is still under development, the only advice I can provide at this point is to adjust the announcement bar from overlapping the logo. Other than that, it looks great! 

Skye | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
adammahon
Shopify Partner
35 0 7

Hi Skye, I appreciate your help.

I am using a custom theme here as I am a web designer by trade. I am confident this is a custom coding issue but the usual code fixes don't seem to be working.

 

I also appreciate your kind feedback on the look and feel of the website!

tigrisjewelryco
New Member
9 0 0

Hello @adammahon 

 

Were you able to fix this issue? Im new and currently having the same issue. Thanks!

CH23
Visitor
2 0 0
Yes. For individual products I had to add an amount for inventory and then select not sell once there was not any inventory of that product.