Skip to main content

Put currency type into macro variable

More
14 years 6 months ago #45142 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 Log in or Create an account to join the conversation.

More
14 years 6 months ago #45347 by nicolas
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.

More
14 years 6 months ago #45461 by higgoboss
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
Powered by Kunena Forum