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

#   Currency set by URL

##

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

12 years 8 months ago [\#147781](#147781) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  *[Currency set by URL](/forum/31-development/866535-currency-set-by-url#147781 "Hi  I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.  They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.  I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.  I need to get back to my client fairly soon so I would be thankful for any assistance.")* was created by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")*

Hi

I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.

They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.

I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.

I need to get back to my client fairly soon so I would be thankful for any assistance.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 8 months ago [\#147827](#147827) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Currency set by URL](/forum/31-development/866535-currency-set-by-url#147827 "Hi  I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.  They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.  I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.  I need to get back to my client fairly soon so I would be thankful for any assistance.")*

Hi,

I think that the best solution will be to create a system plugin which will check the url and depending on this url change the currency.
To see how to change the currency, you can see how is made the hikashop currency switcher module.

Hope this will help you.

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

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

12 years 8 months ago [\#147847](#147847) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Currency set by URL](/forum/31-development/866535-currency-set-by-url#147847 "Hi  I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.  They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.  I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.  I need to get back to my client fairly soon so I would be thankful for any assistance.")*

Thanks for the reply Xavier.

I was going to create a plugin as suggested, but wanted to know how to switch the currency. Unfortunately looking at the currency module is not much help to me as it calls he main component and I do not know what or where in the component to look.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjUzNS1jdXJyZW5jeS1zZXQtYnktdXJsP3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

12 years 8 months ago [\#147872](#147872) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Currency set by URL](/forum/31-development/866535-currency-set-by-url#147872 "Hi  I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.  They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.  I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.  I need to get back to my client fairly soon so I would be thankful for any assistance.")*

Like that: Code:

$app = JFactory::getApplication(); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.currency_id', $currency );

where $currency contains the id of the currency to set.

The following user(s) said Thank You: [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")

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

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

12 years 8 months ago [\#148001](#148001) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Currency set by URL](/forum/31-development/866535-currency-set-by-url#148001 "Hi  I have a client that currently uses Magento and we are encouraging them to move to Hikashop for their next project, and they have an odd requirement.  They would like the store to be accessed by two URLS, where the Joomla fronted will display different templates. But they would like different currencies forced depending on the URL.  I would appreciate an example of code to show me how to set the currency once I come into a Hikashop page.  I need to get back to my client fairly soon so I would be thankful for any assistance.")*

Thank you very much Nicolas. That is great.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NjUzNS1jdXJyZW5jeS1zZXQtYnktdXJsP3RtcGw9bWFya2Rvd24=) 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.054 seconds

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