- Posts: 2
- Thank you received: 0
Changing the product option drop-down list default
14 years 5 months ago #47496
by Bendite
Changing the product option drop-down list default was created by Bendite
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
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.
14 years 5 months ago - 14 years 5 months ago #47589
by Xavier
Replied by Xavier on topic Re: Changing the product option drop-down list default
Hi Bendite,
Yes, you have to edit this file.
In this file, place the line:
Under this one:
Yes, you have to edit this file.
In this file, place the line:
Code:
$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
Code:
$this->values[] = JHTML::_('select.option', $optionElement->product_id,$text);
Last edit: 14 years 5 months ago by Xavier.
Please Log in or Create an account to join the conversation.
14 years 5 months ago #47607
by Bendite
Replied by Bendite on topic Re: Changing the product option drop-down list default
Thank you for the prompt response, Xavier!
I had to modify the (moved) line from:
to this:
...and now it works perfectly!
Dave U
I had to modify the (moved) line from:
Code:
$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
to this:
Code:
$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.167 seconds