Changing the display on mod_currency_switch

  • Posts: 7
  • Thank you received: 0
4 years 2 months ago #289004

-- 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

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

  • Posts: 25249
  • Thank you received: 3908
  • MODERATOR
4 years 2 months ago #289009

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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 7
  • Thank you received: 0
4 years 2 months ago #289055

Hello,

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.

  • Posts: 7
  • Thank you received: 0
4 years 2 months ago #289075

Yay !

The code to modify is in administrator/components/com_hikashop/types

in load(), I changed the last line to

$this->values[] = JHTML::_('select.option', (int)$currency->currency_id, $currency->currency_symbol);

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

  • Posts: 75473
  • Thank you received: 11742
  • MODERATOR
4 years 2 months ago #289056

Hi,

As Jerome said, you could change the line:

$this->values[] = JHTML::_('select.option', (int)$currency->currency_id, $currency->currency_symbol.' '.$currency->currency_code);
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.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum