- Posts: 8
- Thank you received: 0
Put currency type into macro variable
14 years 6 months ago #45142
by higgoboss
Put currency type into macro variable was created by higgoboss
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 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.
14 years 6 months ago #45347
by nicolas
Replied by nicolas on topic Re: Put currency type into macro variable
You can do like that:
$currencyClass = hikashop_get('class.currency');
$currency = $currencyClass->get(hikashop_getCurrency());
echo $currency->currency_code;
$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.
14 years 6 months ago #45461
by higgoboss
Replied by higgoboss on topic Re: Put currency type into macro variable
Great thanks Nicolas just what I needed
Please Log in or Create an account to join the conversation.
Time to create page: 0.145 seconds