Put currency type into macro variable

  • Posts: 8
  • Thank you received: 0
12 years 9 months ago #45142

Hi there

Please bear with me because I know hardly anything about PHP

From what I understand the function below puts the currency id key into a macro variable called currency_id

$currency_id = hikashop::getCurrency();

What I want is the macro variable to contain the symbol of that currency. I.e. if currency id 1 is a "$" when I call the variable I want a "$" to be displayed?

How do I do this?

Many thanks for your help

Mike

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 9 months ago #45347

You can do like that:
$currencyClass = hikashop_get('class.currency');
$currency = $currencyClass->get(hikashop_getCurrency());
echo $currency->currency_code;

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

  • Posts: 8
  • Thank you received: 0
12 years 9 months ago #45461

Great thanks Nicolas just what I needed :)

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

Time to create page: 0.056 seconds
Powered by Kunena Forum