[Skip to main content](#vessel-content)

#   Put currency type into macro variable

##

- **[higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")**
- [![higgoboss's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6589-higgoboss "View higgoboss's Profile") Topic Author
- [ Offline](/forum/user/6589-higgoboss)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#45142](#45142) by [higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")  *[Put currency type into macro variable](/forum/4-how-to/45142-put-currency-type-into-macro-variable#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&#95;id  $currency&#95;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 &quot;$&quot; when I call the variable I want a &quot;$&quot; to be displayed?  How do I do this?  Many thanks for your help  Mike")* was created by *[higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ1MTQyLXB1dC1jdXJyZW5jeS10eXBlLWludG8tbWFjcm8tdmFyaWFibGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

14 years 6 months ago [\#45347](#45347) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Put currency type into macro variable](/forum/4-how-to/45142-put-currency-type-into-macro-variable#45347 "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&#95;id  $currency&#95;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 &quot;$&quot; when I call the variable I want a &quot;$&quot; to be displayed?  How do I do this?  Many thanks for your help  Mike")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ1MTQyLXB1dC1jdXJyZW5jeS10eXBlLWludG8tbWFjcm8tdmFyaWFibGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")**
- [![higgoboss's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6589-higgoboss "View higgoboss's Profile") Topic Author
- [ Offline](/forum/user/6589-higgoboss)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#45461](#45461) by [higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")  Replied by *[higgoboss](/forum/user/6589-higgoboss "View higgoboss's Profile")* on topic *[Re: Put currency type into macro variable](/forum/4-how-to/45142-put-currency-type-into-macro-variable#45461 "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&#95;id  $currency&#95;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 &quot;$&quot; when I call the variable I want a &quot;$&quot; to be displayed?  How do I do this?  Many thanks for your help  Mike")*

Great thanks Nicolas just what I needed ![:)](/media/kunena/emoticons/8.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQ1MTQyLXB1dC1jdXJyZW5jeS10eXBlLWludG8tbWFjcm8tdmFyaWFibGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.225 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
