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

#   JGLOBAL\_SELECT\_AN\_OPTION

##

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#93611](#93611) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#93611 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")* was created by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")*

HI

When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL_SELECT_AN_OPTION. However I notice **this doesn't** happen if all the product variants have quantity 0.

[ ![CropperCapture3.png](/forum/attachment/8995) ](/forum/attachment/8995 "...erCapture3.png")

Thanks

Patrick

- [ ![CropperCapture3.png](/forum/attachment/8995) ](/forum/attachment/8995 "...erCapture3.png") [ ](/forum/attachment/8995?download=1 "...erCapture3.png")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 8 months ago [\#93622](#93622) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#93622 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi,

Can you give me a link to your website, it would help me to understand what your problem really is ?

Thank you.

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

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago -  13 years 8 months ago [\#93670](#93670) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#93670 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi Mohamed

My website is in a password protected directory. Do you have an email address i can send the details to.

However I believe you can reproduce this problem by creating

1 Main Product
1 characteristic (with 1 value)
3 Options

Then assign the 1 characteristic to the 3 options, so each option will have 1 variant product. And assign the 3 options to the Main Product.

If you publish all 3 variants and set the quantity for any of the variants to 0, you will get the error text.

Products and Variants
[ ![Example.png](/forum/attachment/9011) ](/forum/attachment/9011 "Example.png")

Output

[ ![Output.png](/forum/attachment/9012) ](/forum/attachment/9012 "Output.png")

Thanks

Patrick

Thanks

Patrick

- [ ![Example.png](/forum/attachment/9011) ](/forum/attachment/9011 "Example.png") [ ](/forum/attachment/9011?download=1 "Example.png")
- [ ![Output.png](/forum/attachment/9012) ](/forum/attachment/9012 "Output.png") [ ](/forum/attachment/9012?download=1 "Output.png")

Last edit: 13 years 8 months ago by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDk2LWpnbG9iYWwtc2VsZWN0LWFuLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#93951](#93951) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#93951 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi,

That's something we indeed didn't take into account.

You need to add the code:
if(!count($this-&gt;values)) continue;

before the line:
$html = JHTML::_('select.genericlist', $this-&gt;values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id );

in the file "option" of the view "product" via the menu Display-&gt;Views to not display the option at all when no variants are available for the option.

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

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#94042](#94042) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94042 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

HI Nicolas

Thank you for the solution.

But could I suggest rather than making the option disappear, could I change it to displaying a value from a custom field.

For example,
NoVariants_CustomField
Values: All sold out, None Available etc

By setting it to a custom field I can have different message for different category of products.

Is the code too difficult to alter for this solution.

Thanks

Patrick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDk2LWpnbG9iYWwtc2VsZWN0LWFuLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#94109](#94109) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94109 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi,

Then, instead of the code:
if(!count($this-&gt;values)) continue;
you can use the code:
if(!count($this-&gt;values)){$html=$optionElement-&gt;CUSTOM_PRODUCT_FIELD_COLUMN;}else

where CUSTOM_PRODUCT_FIELD_COLUMN is the column name of your custom product field with the error message in it.

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

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#94697](#94697) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94697 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi Nicolas

I have created a custom field with Columne Name: zero_quantity_message and Table: Product. I have created 2 values: All sold out and Not Available.

I have modified the file - Option and view - Product with the following:

if(!count($this-&gt;values)){$html=$optionElement-&gt;zero_quantity_message;}else

However in the front, I can see the Option being displayed, however instead of seeing the values, all I see an empty &lt;td&gt;&lt;/td&gt;

[ ![CropperCapture5.png](/forum/attachment/9137) ](/forum/attachment/9137 "...erCapture5.png")

Not too sure what I am doing wrong.

Thanks

Patrick

- [ ![CropperCapture5.png](/forum/attachment/9137) ](/forum/attachment/9137 "...erCapture5.png") [ ](/forum/attachment/9137?download=1 "...erCapture5.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDk2LWpnbG9iYWwtc2VsZWN0LWFuLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#94715](#94715) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94715 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi,

It probably means that you didn't fill the value of the custom field in that option product. Edit it, fill that field and save.

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

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#94771](#94771) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94771 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi Nicolas

I have set a value for the Option but I get the blank &lt;td&gt;&lt;/td&gt;. However, If I set a value in the Variant, then it works. However I am using $optionElement-&gt;zero_quantity_message but it is using the values from the variant and not the option. If I change to a new value in the Option, then nothing happens and it still uses details from the variant product.

Thanks

Patrick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDk2LWpnbG9iYWwtc2VsZWN0LWFuLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#94797](#94797) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[JGLOBAL\_SELECT\_AN\_OPTION](/forum/2-general-talk-about-hikashop/79096-jglobal-select-an-option#94797 "HI  When a product variant changes from quantity 1 to 0, the dropdown box displays JGLOBAL&#95;SELECT&#95;AN&#95;OPTION. However I notice this doesn't happen if all the product variants have quantity 0.  Thanks  Patrick")*

Hi,

Then try the line :
if(!count($this-&gt;values)){$html=$optionElement-&gt;main-&gt;zero_quantity_message;}else

instead of the one of your previous message and that should help.

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

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