Changing the product option drop-down list default

  • Posts: 2
  • Thank you received: 0
12 years 7 months ago #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 "selected" attribute of the <option> 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->Views, but I can't seeme to find how to make the change. How could this be done?

Respectfully,

Dave U

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 7 months ago #47589

Hi Bendite,

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

$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
Under this one:
$this->values[] = JHTML::_('select.option', $optionElement->product_id,$text);

Last edit: 12 years 7 months ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
12 years 7 months ago #47607

Thank you for the prompt response, Xavier!

I had to modify the (moved) line from:

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

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

...and now it works perfectly!

Dave U

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum