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

#   \[SOLVED\] Not defined variants returns free product

##

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 1 month ago -  14 years 2 weeks ago [\#69991](#69991) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  *[\[SOLVED\] Not defined variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#69991 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")* was created by *[protorob](/forum/user/5729-protorob "View protorob's Profile")*

Given that you have two characteristics:

\#1 Color: Blue, Red
\#2 Size: Small, Big

And you have a Product in tree variants:

\#1 Product: Blue, Small
\#2 Product: Blue, Big
\#3 Product: Red, Big

There is something that i think is a problem:

\#4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.

I can live with the fact that the variant can be selectable but there's something that i don't understand:

- The price of that selection (Product: Red, Small in this case) is set to "Free" as default thus creating confusion in the user.
This can be edited in the language file with changing the "free" field with "The variant you selected is not available" and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore

Despite the fact that the product fortunately gets "Out of stock" message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the "free" price tag.

It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.

So, my question is, how can i override that "free" price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?

Thanks in advance.

Last edit: 14 years 2 weeks ago by [protorob](/forum/user/5729-protorob "View protorob's Profile"). Reason: This is a SOLVED Issue

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#70100](#70100) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#70100 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

You could edit the view "product / listing_price" and add a check on the variable: "$this-&gt;row-&gt;product_published".
For example: Code:

if($this-&gt;row-&gt;product_published == 0){ echo JText::_('NOT_ON_SALE'); ?&gt;

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 1 month ago [\#70137](#70137) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#70137 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

This can be an excellent solution.
Could you please help me understanding where exactly in the view "product/listing_price" file should i add the line of code you suggest.
That file is pretty complex.
I don't want to mess everything up.

Thanks in advance

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#70143](#70143) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#70143 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

At the top of the file, replace the lines: Code:

if(empty($this-&gt;row-&gt;prices)){ echo JText::_('FREE_PRICE'); }else{

By: Code:

if($this-&gt;row-&gt;product_published == 0){ echo JText::_('NOT_ON_SALE') } elseif(empty($this-&gt;row-&gt;prices)){ echo JText::_('FREE_PRICE'); }else{

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 4 weeks ago [\#70791](#70791) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#70791 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

You're awesome.
Thanks a lot.

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 3 weeks ago [\#71924](#71924) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#71924 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Excuse me, don't know why but it is not working.

First let me make a little mistake in the code you gave me, there was a semicolon missing at the end of ('NOT_ON_SALE')

so the right one should be:
Code:

if($this-&gt;row-&gt;product_published == 0){ echo JText::_('NOT_ON_SALE'); } elseif(empty($this-&gt;row-&gt;prices)){ echo JText::_('FREE_PRICE'); }else{

This way the modification makes me open the website, without that semicolon everything crashes.

****

I have made the mod but i still get free price instead of non available....

What am i doing wrong?

Thanks in advance. If you need i can give you access to backoffice/front end

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 3 weeks ago -  14 years 3 weeks ago [\#72084](#72084) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72084 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

My apologize, for the variants you have to edit the view "product / quantity" and replace the line: Code:

echo JText::_('NO_STOCK');

With the code: Code:

$productClass = hikashop_get('class.product'); $variant = $productClass-&gt;get($this-&gt;row-&gt;product_id); if(isset($variant-&gt;product_published) &amp;&amp; $variant-&gt;product_published == 0 &amp;&amp; !empty($this-&gt;row-&gt;characteristics)){ echo JText::_('NOT_AVAILABLE'); }else{ echo JText::_('NO_STOCK'); }

Last edit: 14 years 3 weeks ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile").

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 3 weeks ago [\#72095](#72095) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72095 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

should i left the mods i made on the product_price view file?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 3 weeks ago [\#72097](#72097) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72097 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

You can remove the previous modifications. It wasn't useful in that case ![:/](/irritated.gif ":/")

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 3 weeks ago [\#72100](#72100) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72100 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

nope, not working.
I've just got a subscription to the business version, i will update and then we continue talking about this in some minutes, i can send you a PM with access to the front end so you can see what i'm experiencing.

See you later.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY5OTkxLXNvbHZlZC1ub3QtZGVmaW5lZC12YXJpYW50cy1yZXR1cm5zLWZyZWUtcHJvZHVjdD90bXBsPW1hcmtkb3du) 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: 86564
- Thank you received: 14311
-
-

14 years 3 weeks ago [\#72366](#72366) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72366 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Note that Xavier won't be back until Monday. If it can't wait until then, then please use our contact form.

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 3 weeks ago [\#72384](#72384) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72384 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

No problem, i can wait 'till Monday.
Thanks.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#72660](#72660) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72660 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

I tried the solution given again, and for me when a variant is not enabled, the message "Not available" is displayed instead of "No stock".

Could you give us a front &amp; back end access ?

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 2 weeks ago -  14 years 2 weeks ago [\#72793](#72793) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72793 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi Xavier, i have sent you a PM with access to the website.

This is my csv

*This attachment is hidden for guests.
Please log in or register to see it.*

Last edit: 14 years 2 weeks ago by [protorob](/forum/user/5729-protorob "View protorob's Profile").

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#72801](#72801) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72801 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

Ok I see from where come the problem.
I was thinking that the variants not available were unpublished, and not "not present" in your shop.

If you only unpublish the variant the modification given should work fine.
Tomorrow I will find another solution to your problem.

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 2 weeks ago [\#72811](#72811) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#72811 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

yes, i prefer to wait.
because i have created two characteristic for the whole international category, one for the volume in Lt. of the package and another one for the color palette of that brand, if i simply create all possible variants and then deactivate those ones i don't need my csv's are going to be ten times bigger and mainly full of unavailable variants, and that add a lot of unnecessary data on the database.

I'm following for your answer, I'm preparing a product import for around 5K products and i need to define the characteristics the most efficient and generalist possibly so i can use them in more than one product category and this situation of the non available characteristics is going to happen very frequently.

Have a good day and thanks again for your support.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#73040](#73040) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#73040 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

Hope this time it's the good solution ![:)](/media/kunena/emoticons/3.png ":)")

Try to replace the code: Code:

echo JText::_('NO_STOCK');

By just: Code:

if(!isset($variant)) echo JText::_('NOT_AVAILABLE'); else echo JText::_('NO_STOCK');

In the view "product / quantity".

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 2 weeks ago -  14 years 2 weeks ago [\#73171](#73171) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#73171 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi Xavier,

The code is not exactly as you write it, it should be:
Code:

if(!isset($variant)) echo JText::_('PRODUCT_NOT_AVAILABLE'); else echo JText::_('NO_STOCK');

It actually shows the string in the product quantity part of the product page but it only works if the cart functionality is activated (it does not work if you're in catalog mode) this is not cool because we're still strugglin' with legal paperwork for activate the cart options so we need to open right now only with the button for "ask info" and showing prices.

Is possible to make something similar but with the product&gt;listing_price view?
So i can have the PRODUCT_NOT_AVAILABLE message instead of the FREE_PRICE i have now when i select an non existing variant?

This issue is delaying me to continue the content population and i have a really big quantity of products.
I don't want to find myself creating all my product listing again, i have done this at least 3 times in the last year and when you have 5K products is a real pain so any advice is welcome.

Thanks

Last edit: 14 years 2 weeks ago by [protorob](/forum/user/5729-protorob "View protorob's Profile").

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#73311](#73311) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#73311 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Hi,

In catalog mode, the view "product / quantity" is loaded.
Try to add the code: Code:

if($this-&gt;row-&gt;product_published != 1){echo "Not Available";}

At the top of the file, between &lt;?php ?&gt; tags.

If it doesn't work thanks to give me a screenshot of your configuration, by this way I will be able to reproduce the problem on my end.

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

- **[protorob](/forum/user/5729-protorob "View protorob's Profile")**
- [![protorob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5729.png)](/forum/user/5729-protorob "View protorob's Profile") Topic Author
- [ Offline](/forum/user/5729-protorob)

Less More

- Posts: 96
- Thank you received: 14
-
-
-
- [](http://www.euromarnautica.com)
-

14 years 2 weeks ago [\#73337](#73337) by [protorob](/forum/user/5729-protorob "View protorob's Profile")  Replied by *[protorob](/forum/user/5729-protorob "View protorob's Profile")* on topic *[Re: Not defined product variants returns free product](/forum/4-how-to/69991-solved-not-defined-variants-returns-free-product#73337 "Given that you have two characteristics:  #1 Color: Blue, Red #2 Size: Small, Big  And you have a Product in tree variants:  #1 Product: Blue, Small #2 Product: Blue, Big #3 Product: Red, Big  There is something that i think is a problem:  #4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.  I can live with the fact that the variant can be selectable but there's something that i don't understand:  &#42; The price of that selection (Product: Red, Small in this case) is set to &quot;Free&quot; as default thus creating confusion in the user. This can be edited in the language file with changing the &quot;free&quot; field with &quot;The variant you selected is not available&quot; and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore  Despite the fact that the product fortunately gets &quot;Out of stock&quot; message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the &quot;free&quot; price tag.  It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.  So, my question is, how can i override that &quot;free&quot; price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?  Thanks in advance.")*

Did you receive the PM with the access to my backend?

Whatever, i'll be making this mods in the afternoon, i'll be back to you then.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY5OTkxLXNvbHZlZC1ub3QtZGVmaW5lZC12YXJpYW50cy1yZXR1cm5zLWZyZWUtcHJvZHVjdD90bXBsPW1hcmtkb3du) 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.119 seconds

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