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

#   Changing the product option drop-down list default

##

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

Less More

- Posts: 2
- Thank you received: 0
-
-

14 years 6 months ago [\#47496](#47496) by [Bendite](/forum/user/6445-bendite "View Bendite's Profile")  *[Changing the product option drop-down list default](/forum/2-general-talk-about-hikashop/47496-changing-the-product-option-drop-down-list-default#47496 "I've been trying to change the default in the drop-down list on the product page for the product options (equivalent to the HTML &quot;selected&quot; attribute of the  tag). I've managed to change the...")* was created by *[Bendite](/forum/user/6445-bendite "View Bendite's Profile")*

I've been trying to change the default in the drop-down list on the product page for the product options (equivalent to the HTML "selected" attribute of the &lt;option&gt; tag). I've managed to change the text of the default option to "Yes" (JHTML::_), but I can't figure out how to change the actual default product option (which I would like to automatically add to the customer purchase as well as to hide the entire list box with "display:none" is CSS).

I am guessing the change should be made by editing the file "option" of the view "product" via the menu Display-&gt;Views, but I can't seeme to find how to make the change. How could this be done?

Respectfully,

Dave U

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ3NDk2LWNoYW5naW5nLXRoZS1wcm9kdWN0LW9wdGlvbi1kcm9wLWRvd24tbGlzdC1kZWZhdWx0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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 6 months ago -  14 years 6 months ago [\#47589](#47589) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Changing the product option drop-down list default](/forum/2-general-talk-about-hikashop/47496-changing-the-product-option-drop-down-list-default#47589 "I've been trying to change the default in the drop-down list on the product page for the product options (equivalent to the HTML &quot;selected&quot; attribute of the  tag). I've managed to change the...")*

Hi Bendite,

Yes, you have to edit this file.
In this file, place the line: Code:

$this-&gt;values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));

Under this one: Code:

$this-&gt;values[] = JHTML::_('select.option', $optionElement-&gt;product_id,$text);

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

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

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

Less More

- Posts: 2
- Thank you received: 0
-
-

14 years 6 months ago [\#47607](#47607) by [Bendite](/forum/user/6445-bendite "View Bendite's Profile")  Replied by *[Bendite](/forum/user/6445-bendite "View Bendite's Profile")* on topic *[Re: Changing the product option drop-down list default](/forum/2-general-talk-about-hikashop/47496-changing-the-product-option-drop-down-list-default#47607 "I've been trying to change the default in the drop-down list on the product page for the product options (equivalent to the HTML &quot;selected&quot; attribute of the  tag). I've managed to change the...")*

Thank you for the prompt response, Xavier!

I had to modify the (moved) line from:
Code:

$this-&gt;values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));

to this:
Code:

$this-&gt;values[] = JHTML::_('select.option', product_id,JText::_('HIKASHOP_NO'));

...and now it works perfectly!

Dave U

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

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