An elegant way to change the currency for checkout

  • Posts: 180
  • Thank you received: 13
12 years 3 months ago #60255

I have only one published currency and have a couple of others for display.

When a different currency than the default one is chosen, because it is not published, a message s given stating that it is not available for payment. Is there a way to set it so that instead of that message the checkout currency is changed to the default currency? I think that would be more elegant than forcing the user to change the currency.

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #60259

I'm not sure that you need to do anything. The currency should already be the main one in the cart of the checkout.

Anyway, you can add the code:

if(!empty($this->total->prices[0]->price_currency_id)&& $this->total->prices[0]->price_currency_id!=hikashop_getCurrency()){
$url=hikashop_completeLink('currency&task=update&hikashopcurrency='.$this->total->prices[0]->price_currency_id.'&return_url='.urlencode(hikashop_currentURL()));
header('HTTP/1.1 303 See other');
header('Location: '.$url);
exit;
}
in the file "cart" of the view "checkout" and that will change the currency.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum