Invalid variant selection doesn't disable "Add to Cart" button in Craft theme

Solved

Invalid variant selection doesn't disable "Add to Cart" button in Craft theme

vicfinearts
Tourist
6 1 0

Hi,

 

I'm facing a very basic issue (at least I think its basic)

https://vicfinearts.com/products/enchanting-rose-dress-girl-painting?variant=49907903332628

 

In this url, as you see - "36x48" option is disabled when Type "Metal Gloss Print" is selected, even then Add to cart isn't disabled and you can click that. But eventually, if you your cart, actually it adds default variant i.e. "Stretched Canvas". I simply want to disable the "Add to cart" button. I'm using Craft theme.

 

This is a very urgent issue. Kindly help.

Accepted Solution (1)
vicfinearts
Tourist
6 1 0

This is an accepted solution.

Hey, so sorry, I thought a while ago that I'll post here, but then forgot to do so. Shopify wasn't able to solve the issue. So I came up with a decent hack that works for me.

 

So if I've 'Art type': canvas, print, Size: 8x10, 24x36

Let say I don't sell variant combination: 'Print, 24x36' , initially I was not creating that as a variant. Now, I create that variant but assign available quality as 0. This means, Add to cart btn will be disabled for this combination. This is quite robust as no theme can allow selling an item which isn't available. Drawback is: this creates over 100 variants (including unavailable ones) and exceeds Shopify's max variant limit. I brought down #variants to keep them under 100 for now. So, unless you've too many variants, this might work for you.

 

Please let me know if this works for you.

 

@Viewsofjavi @jorgecanto 

View solution in original post

Replies 15 (15)

Viewsofjavi
Tourist
10 0 1

Hi! I've run into the exact same issue with my store. I noticed after I attempted to integrate Facebook and Instagram with my shop. Did you try integrating Facebook and Instagram as well?

 

vicfinearts
Tourist
6 1 0

Thanks for your reply. No, I didn't integrate them. So how did you fix this issue? Kindly let me know. 

This is so frustrating. I'm unable to make my store live. 

Viewsofjavi
Tourist
10 0 1

I haven't been able to fix the issue actually, I've been talking to Shopify's technical support.

 

vicfinearts
Tourist
6 1 0

It's ridiculous how long they take to resolve such a critical issue. Kindly post the solution once you find one. I'll do the same.

Viewsofjavi
Tourist
10 0 1

I know I didn't realize it would take this long. It seems to be that the code is allowing for "selected, first available, or default" variant selection when it comes to disabling/enabling the add-to-cart/buy buttons instead of checking for availability only for the selected variant. If the selected variant has no stock availability OR is not a configured variant, the add-to-cart/buy buttons shouldn't allow the customer to add anything to the cart. They either haven't gotten to it or they haven't figured it out yet. I have an open ticket with them shown as escalated but haven't gotten an update.

jorgecanto
Shopify Partner
3 0 0

Hi,

Did you fix the error?

Can you tell us how you did it?

 

Thanks

vicfinearts
Tourist
6 1 0

This is an accepted solution.

Hey, so sorry, I thought a while ago that I'll post here, but then forgot to do so. Shopify wasn't able to solve the issue. So I came up with a decent hack that works for me.

 

So if I've 'Art type': canvas, print, Size: 8x10, 24x36

Let say I don't sell variant combination: 'Print, 24x36' , initially I was not creating that as a variant. Now, I create that variant but assign available quality as 0. This means, Add to cart btn will be disabled for this combination. This is quite robust as no theme can allow selling an item which isn't available. Drawback is: this creates over 100 variants (including unavailable ones) and exceeds Shopify's max variant limit. I brought down #variants to keep them under 100 for now. So, unless you've too many variants, this might work for you.

 

Please let me know if this works for you.

 

@Viewsofjavi @jorgecanto 

Viewsofjavi
Tourist
10 0 1

They told me to do this too but that 100 limit prevented me from doing so. I have too many variants I wish to sell.

 

vicfinearts
Tourist
6 1 0

yeah, it sucks. A few people say to list 2 products to overcome the 100 limit and sometimes iss better to split anyway as people as red shirt with all sizes and green shirt with all sizes. But you know your usecase better. This 100 limit is stupid.

Viewsofjavi
Tourist
10 0 1

Yeah I might have to split each product and categorize them according to how I have my variants set up unfortunately.

jorgecanto
Shopify Partner
3 0 0

Hello,

 

I finally solved it by purchasing a paid theme that does solve this issue with variants. It seems that what we are talking about in this post is a general problem with free Shopify themes. If you want to try it out, all themes have a demo version so you can configure it before buying.

 

Anyway, thank you very much for your quick and detailed response.

vicfinearts
Tourist
6 1 0

That's great. Which theme did you use?

Viewsofjavi
Tourist
10 0 1

I've only checked one so far, "Next" is the theme name. Only 100 bucks. But I'm sure others will work.

 

jorgecanto
Shopify Partner
3 0 0

It depends on the theme you use. It seems to be something that is managed from the front end. You can check all the themes in the Shopify store.

 

https://themes.shopify.com/themes

Viewsofjavi
Tourist
10 0 1

You're right. I just checked. That'll save a lot of time.