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

#   Adding a "Please select" to variants

##

- **[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 7 months ago [\#94858](#94858) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#94858 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")* was created by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")*

HI

I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.

I have created two variant products and displayed them in a drop down box.

I would like to be able to display a "please select" in the combo box rather than the first variant product.

[ ![CropperCapture6.png](/forum/attachment/9175) ](/forum/attachment/9175 "...erCapture6.png")

Thanks

Patrick

- [ ![CropperCapture6.png](/forum/attachment/9175) ](/forum/attachment/9175 "...erCapture6.png") [ ](/forum/attachment/9175?download=1 "...erCapture6.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 7 months ago -  13 years 7 months ago [\#94966](#94966) 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 *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#94966 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

Hi Patrick,

My solution would be to :
- Go to "*Hikashop-&gt;Display-&gt;Views*"
- Edit the **show\_block\_characteristic** file of the **product** view of your front-end template
- Change these lines : Code:

&lt;?php if (!empty ($this-&gt;element-&gt;characteristics)) { ?&gt;

by : Code:

&lt;?php if (!empty ($this-&gt;element-&gt;characteristics)) { echo "Please select"; ?&gt;

Hope this will help you a little ![:)](/media/kunena/emoticons/3.png ":)").

Last edit: 13 years 7 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 7 months ago [\#95026](#95026) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#95026 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

HI Mohamed

I tried that but it did not seem to work.

I would have thought I would needed to append the "Please select" as a sql query with a union join to the query that retrieves the variant data. Could you tell me which file the sql for the variant date is called from.

Thanks

Patrick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 7 months ago [\#95215](#95215) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#95215 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

Hi there,

The Mohamed solution wasn't the best for your case.
I think you should simply add a new variant called "Please Select" with no stock and no price.
So this variant would be displayed but people won't be able to buy it and will have to select one of your variants ![;)](/media/kunena/emoticons/24.png ";)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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 7 months ago [\#95244](#95244) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#95244 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

HI Eliot

Thank you for your suggestion. I already thought of doing that. However, this would work, if there are variant products to choose. But once all the variants have been sold/bought, then it would look silly to have a "Please select", with no variants to choose from.

If I can somehow hide this option when there are no variant products to display then your solution would work fine.

Thanks for the suggestion though.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

13 years 7 months ago [\#95256](#95256) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#95256 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

Hi,

The solution proposed by Eliot is indeed better.

Regarding the hiding of the characteristics if only the default value is left in the dropdown, you can add the code:

if(count($this-&gt;values)===1) return 'Out of stock';

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

in the file administrator/components/com_hikashop/types/characteristic.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")**
- [![grayt7's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30010.jpg)](/forum/user/30010-grayt7 "View grayt7's Profile")
- [ Offline](/forum/user/30010-grayt7)

Less More

- Posts: 376
- Thank you received: 7
-
-
- [](http://www.identitywebdesign.com)
-

7 years 8 months ago [\#303787](#303787) by [grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")  Replied by *[grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#303787 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

Hi,

What if you had the notify of when back in stack feature on? Then adding a "please select" variant wouldn't work as it would look like the product is out of stock when actually you've just set the "please select" variant with no stock. Anyway around this?

Cheers.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

7 years 8 months ago [\#303790](#303790) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a "Please select" to variants](/forum/2-general-talk-about-hikashop/79375-adding-a-please-select-to-variants#303790 "HI  I have created a characteristic called TimeSlots and created two value : 2pm - 4pm and 6pm - 8pm.  I have created two variant products and displayed them in a drop down box.  I would like to be able to display a &quot;please select&quot; in the combo box rather than the first variant product.  Thanks  Patrick")*

Hi,

Instead of using the stock of the variant, you could set the "sale date" start value in the remote future or the end value in the past. It would do the same but with a different message (that you can customize with a translation override), but the "notify me" button wouldn't display for the "please select" choice.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5Mzc1LWFkZGluZy1hLXBsZWFzZS1zZWxlY3QtdG8tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.066 seconds

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