An elegant way to change the currency for checkout
14 years 1 month ago #60255
by esotechie
An elegant way to change the currency for checkout was created by esotechie
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.
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.
14 years 1 month ago #60259
by nicolas
Replied by nicolas on topic Re: An elegant way to change the currency for checkout
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:
in the file "cart" of the view "checkout" and that will change the currency.
Anyway, you can add the code:
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;
}
Please Log in or Create an account to join the conversation.
Time to create page: 0.188 seconds