Currency set by URL

  • Posts: 180
  • Thank you received: 13
10 years 8 months ago #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.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #147827

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 or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
10 years 8 months ago #147847

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 or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #147872

Like that:

$app = JFactory::getApplication();
$app->setUserState( HIKASHOP_COMPONENT.'.currency_id', $currency );
where $currency contains the id of the currency to set.

The following user(s) said Thank You: esotechie

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

  • Posts: 180
  • Thank you received: 13
10 years 8 months ago #148001

Thank you very much Nicolas. That is great.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum