[Skip to main content](#vessel-content)

#   Hidden Variant Causing Issues

##

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 3 months ago [\#322507](#322507) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322507 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")* was created by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")*

I'm in a bit of a pickle and I'm not sure how to fix it.

Say I have a Small, Medium and Large item.

If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on "Small". This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.

So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.

If the user goes to the page and click "Add to Cart" without selecting a size, the DEFAULT variant is added to the cart.

How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?

Thanks!

- [ ![product-with-default-variant.jpg](/forum/attachment/50188) ](/forum/attachment/50188 "...lt-variant.jpg") [ ](/forum/attachment/50188?download=1 "...lt-variant.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

6 years 3 months ago [\#322542](#322542) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322542 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

What you could do is to edit the file product / show.php via the menu display&gt;Views and add a bit of code at the beginning to hide the add to cart button when the page is loaded: Code:

&lt;script&gt; window.hikashop.ready( function(){ document.querySelector('#hikashop_product_quantity_main .hikacart').style.display = 'none'; }); &lt;/script&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 3 months ago -  6 years 3 months ago [\#322559](#322559) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322559 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi nicolas,

So the code works perfectly for products that have variants but it does not work for products that do not have variants.

If you look at products in the "Preowned" section you will notice that the "Add to Cart" button is not showing because there is only one of each so I didn't have to use variants.

So maybe the code should be;
If there is variant hide the "Add to Cart" button until a selection is made, if no variant then don't hide it.

I will send the URL privately so you can see what I mean.

Thanks!

Last edit: 6 years 3 months ago by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

6 years 3 months ago [\#322561](#322561) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322561 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

Then you just need an additional check around that code: Code:

&lt;?php if(!empty($this-&gt;element-&gt;variants)) { ?&gt; &lt;script&gt; window.hikashop.ready( function(){ document.querySelector('#hikashop_product_quantity_main .hikacart').style.display = 'none'; }); &lt;/script&gt; &lt;?php } ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 3 months ago [\#322722](#322722) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322722 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi nicolas,

The website owner was saying that when the button is not visible customers may think that the product is out of stock. So she was asking if:

1) It's possible to disable the "add to cart" button and only enable it after they click on a size. Similar to what is done here:
[ www.roots.com/ca/en/cabin-slim-cuff-swea...emsourse=productlist](https://www.roots.com/ca/en/cabin-slim-cuff-sweatpant-38090185.html?selectedColor=10B&cgid=SweatsSweatpantsWomen&start=9&itemsourse=productlist)

OR

2) Keep the button enabled/visible but display a message if they click on "add to cart" without selecting a size. Similar to what is done here:
[ www.gapcanada.ca/browse/product.do?pid=5...3\_1#pdp-page-content](https://www.gapcanada.ca/browse/product.do?pid=596051003&cid=1028105&pcid=8655&vid=1&nav=meganav:Men:Categories:Joggers%20&grid=pds_2_13_1#pdp-page-content)

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

6 years 3 months ago [\#322733](#322733) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322733 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

Both are possible with some more complex custom coding.
If you want us to work on this for you, you can use our contact form to request a quote:
[ www.hikashop.com/support/contact-us.html](https://www.hikashop.com/support/contact-us.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 3 months ago -  6 years 3 months ago [\#322768](#322768) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322768 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Well I'm not sure what the cost will be..but I'm assuming it's not going to be cheap.

I think the option to have customers select a variant in order to add an item to the cart should be part of Hikashop software without having to pay extra to have it added as it's not a unique customization, this should have been a default feature from the start - other ecommerce softwares has it as part of their software, and not an added feature, eg: [ j2store.net/demo/index.php/shop/simple](https://j2store.net/demo/index.php/shop/simple)

I also had to purchase other extensions in order to improve Hikashop's functionality so having to pay for other extensions, pay for hikashop software, pay for a feature that I think should already be part of the software, sadly for me, I cannot afford at this time.

Thanks!

Last edit: 6 years 3 months ago by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

6 years 3 months ago [\#322784](#322784) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322784 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

> the option to have customers select a variant in order to add an item to the cart should be part of Hikashop software without having to pay extra"

That is already the case by default.
By default, the default variant is preselected. And thus, it is impossible to add a product to the cart without having a variant selected.
You changed the way it works to make it look like a variant isn't preselected and thus created that problem with the add to cart button being visible even though it's not a working one.
So having us fix that issue, which is specific to your website has to be an extra.
Now if instead you want us to add the capability to not have a variant preselected, we actually added that capability with the latest version with the "Characteristics dynamic display" setting. However, this works only when the product has more than 1 characteristic. And that's why I proposed another solution to do what you want here:
[ www.hikashop.com/forum/feature-request/9...-variant.html#322632](https://www.hikashop.com/forum/feature-request/900525-prevent-adding-product-to-cart-without-selecting-a-variant.html#322632)
This would be possible without any coding (just a bit of CSS).

So basically there is one choice:
- you follow my advice and you're done with a bit of CSS and product / variant configuration
- you do it your way and it requires a bit of javascript coding
- you stay with the default system available and wait for us to implement some improvement to the system in the future

I'm not here to try to get more money from you. I'm proposing solutions that you can have directly on your website, without having to wait for us to improve HikaShop in the future. I actually gave you some simple code propositions but it seems you want something more complex to code. At that point it requires proper development, and thus money for the time spent.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 3 months ago [\#322815](#322815) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322815 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

I definately was not implying that you were trying to get more money from me - I'm sorry if that's how it came across. I was just saying that I had no money at the moment for this. I thought this feature should have been something that is already part of the software. If you say it is, and I missed it - I apologize.

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

6 years 2 months ago [\#322824](#322824) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322824 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

No worries. But you didn't came back to me on this other thread where I provided a solution which should suit your needs:
[ www.hikashop.com/forum/feature-request/9...-variant.html#322632](https://www.hikashop.com/forum/feature-request/900525-prevent-adding-product-to-cart-without-selecting-a-variant.html#322632)
Did you try it out ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago [\#322844](#322844) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322844 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

I will take a look and try it out. Thanks ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago -  6 years 2 months ago [\#322882](#322882) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322882 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi nicolas,

After reading through your solution, although I prefer not to hide the "Add to Cart" button, I think I'll stick with the code that you provided for now and hopefully this improvement can be implemented to the system in the near future. It looks like, and I'm hoping, that with the code provided I don't have to add a HIDDEN default variant to the products anymore - that would save me some time ![:)](/media/kunena/emoticons/3.png ":)")

There seems to be some inconsistency with the products though, it works well with some products and not so well with others. I was trying to figure out why but I'm not seeing it.

I sent you a message with the URL of the products that works well and the ones that don't. Please let me know if there is something that I need to do differently when adding products or maybe the code needs some revisions.

Thanks I truly appreciate your help with this.

Last edit: 6 years 2 months ago by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 2 months ago -  6 years 2 months ago [\#322905](#322905) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322905 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hello,

Just a word to say that if you provide your **2 url link** via Pm directly to Nicolas, he is actually on vacations, if you want to advance your subject without having to wait for his return, and in general to send us information use our **[ Contact us](https://www.hikashop.com/support/contact-us.html)** form.
And don't forget to add an **Url link** to this topic in your message.

Regards

Last edit: 6 years 2 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago [\#322975](#322975) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322975 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

I sent the email via the contact form.

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 2 months ago -  6 years 2 months ago [\#322996](#322996) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#322996 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hello,

Can you provide backend access via our [ **Contact us**](https://www.hikashop.com/support/contact-us.html) form please, because so far we don't understand why there are variations from products to another.
Don't forget to add as usual an Url link to this topic.
Awaiting news from you to progress on your subject.
Regards

Last edit: 6 years 2 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago [\#323047](#323047) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#323047 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

I sent the email. Thanks in advance for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 2 months ago -  6 years 2 months ago [\#323070](#323070) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#323070 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hello,

Everything is worked as expected, products that pre-selected a variant are just product which you didn't create a "select size/default" variants and define it as the default HikaShop default variant.
image missing https://i.imgur.com/B6dcr0J.png
**Note :** Click to see picture details.

See the result in your product page, [ **here**](https://www.pungles.com/DEV/categories/product/40-true-religion-cotton-vneck-short-sleeves-black-tee.html)

You have just to reproduce this idea for all your product.
Regards

Last edit: 6 years 2 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago [\#323136](#323136) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#323136 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hi,

I disagree. Unless I'm misunderstanding what you are saying.

If you look again at the 2 URLs that I sent in the email I explained that one has a default, like the example you provided above, and one does not. Yet the button is hidden for both of them on the details page.

I attached a photo of the two products for your information. Their URLs were sent in the email.

I would much prefer the option to NOT have to add a default.

Thanks!

- [ ![hikashop-default.jpg](/forum/attachment/50332) ](/forum/attachment/50332 "...op-default.jpg") [ ](/forum/attachment/50332?download=1 "...op-default.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

6 years 2 months ago -  6 years 2 months ago [\#323142](#323142) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#323142 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Hello,

Now, I get it and do the required modification to all your product follow me step by step :
**1.** In your product backend setting, **Specifications** part, I add this Characteristic that you create for this purpose
image missing https://i.imgur.com/8VSSoTm.png

**2.** In your **frontend Css file** I add a **custom css** to hide the Characteristics in order to be clear on the frontend side.

Without huge custom, it's a little tricks and that can be perfect but it's seems to be close to your needs.
I let you test by yourself if it fit your needs.
Regards

Last edit: 6 years 2 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")**
- [![MyWorld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/862-myworld "View MyWorld's Profile") Topic Author
- [ Offline](/forum/user/862-myworld)

Less More

- Posts: 966
- Thank you received: 11
-
-

6 years 2 months ago [\#323197](#323197) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Hidden Variant Causing Issues](/forum/26-product-category-display/900499-hidden-variant-causing-issues#323197 "I'm in a bit of a pickle and I'm not sure how to fix it.  Say I have a Small, Medium and Large item.  If the Small is SOLD OUT, when the customer goes to the page, they see the SOLD OUT message without clicking on &quot;Small&quot;. This is deceiving as it appears that all of that product is sold out. Please see the URL added in this post.  So what I usually do is create a default variant and add it as the first one, then use CSS to hide it to get rid of the issue stated above. See example attach.  If the user goes to the page and click &quot;Add to Cart&quot; without selecting a size, the DEFAULT variant is added to the cart.  How can I avoid getting the DEFAULT/(Hidden) variant added to the cart?  Thanks!")*

Sorry I created another characteristic and name it "Default" so that it's obvious as to what it's for. The other one that I was using was just to test.

Regarding Nicolas' solution below, how do I get the default characteristic to be selected automatically, so that the 2nd characteristic will show? As you can see, as per the attached image, it's not selected.

[ www.hikashop.com/forum/feature-request/9...-variant.html#322632](https://www.hikashop.com/forum/feature-request/900525-prevent-adding-product-to-cart-without-selecting-a-variant.html#322632)

[ ![default-characteristic.jpg](/forum/attachment/50360) ](/forum/attachment/50360 "...acteristic.jpg")

- [ ![default-characteristic.jpg](/forum/attachment/50360) ](/forum/attachment/50360 "...acteristic.jpg") [ ](/forum/attachment/50360?download=1 "...acteristic.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDA0OTktaGlkZGVuLXZhcmlhbnQtY2F1c2luZy1pc3N1ZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.206 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
