- Posts: 7
- Thank you received: 0
Changing the display on mod_currency_switch
8 years 8 months ago #289004
by luciolis
Changing the display on mod_currency_switch was created by luciolis
-- url of the page with the problem -- :
www.dkloc.ch/
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.2.1
Hello,
Does anybody know how to change the display for mod_currency_switch ? I would like to only display the symbol and not the currency name. I have search for a few hours and found a $currency->display() method, but the arguments were only the IDs and nothing else.
Thanks
Adrian
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.2.1
Hello,
Does anybody know how to change the display for mod_currency_switch ? I would like to only display the symbol and not the currency name. I have search for a few hours and found a $currency->display() method, but the arguments were only the IDs and nothing else.
Thanks
Adrian
Please Log in or Create an account to join the conversation.
8 years 8 months ago #289009
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Changing the display on mod_currency_switch
Hello,
The variable $currency is the HikaShop currency type.
If you want to change the display, best would be to edit the values ( $currency->values ) or to have your own display for the dropdown (with the help of the code in the HikaShop currency type).
Regards,
The variable $currency is the HikaShop currency type.
If you want to change the display, best would be to edit the values ( $currency->values ) or to have your own display for the dropdown (with the help of the code in the HikaShop currency type).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
8 years 8 months ago #289055
by luciolis
Replied by luciolis on topic Changing the display on mod_currency_switch
Hello,
Apparently the display is a loop that goes on every key-value pair on the currency. Is that true ?
Apparently the display is a loop that goes on every key-value pair on the currency. Is that true ?
Please Log in or Create an account to join the conversation.
8 years 8 months ago #289075
by luciolis
Replied by luciolis on topic Changing the display on mod_currency_switch
Yay !
The code to modify is in administrator/components/com_hikashop/types
in load(), I changed the last line to
The code to modify is in administrator/components/com_hikashop/types
in load(), I changed the last line to
Code:
$this->values[] = JHTML::_('select.option', (int)$currency->currency_id, $currency->currency_symbol);
Please Log in or Create an account to join the conversation.
8 years 8 months ago #289056
by nicolas
Replied by nicolas on topic Changing the display on mod_currency_switch
Hi,
As Jerome said, you could change the line:
in the file administrator/components/com_hikashop/types/currency.php and remove .' '.$currency->currency_code to not have the code, only the symbol.
However, it would be better to do an override of the module via the template manager, and copy/paste the code of the type and modify it there.
That way, you wouldn't loose your changes after each update of HikaShop.
As Jerome said, you could change the line:
Code:
$this->values[] = JHTML::_('select.option', (int)$currency->currency_id, $currency->currency_symbol.' '.$currency->currency_code);
However, it would be better to do an override of the module via the template manager, and copy/paste the code of the type and modify it there.
That way, you wouldn't loose your changes after each update of HikaShop.
Please Log in or Create an account to join the conversation.
Time to create page: 0.059 seconds