I recently upgraded to 1.5.4. Wanting to offer customers the opportunity to see prices in their own currency, I installed the currencies sidebox. However, I need to process transactions in AUD only.
Some customers would select a currency but that selection remained throughout the checkout process and only the invoice total was shown in AUD. This also caused problems with PayPal registering as a currency conflict.
I searched for information on how to force the default currency at checkout and found that people had asked, but never seem to have received a solution. I know that you can stop the currencies sidebox from displaying during checkout, but that doesn't help if the wrong currency is active.
My solution was to modify one file: cart/includes/init_includes/init_currencies.php
I made two insertions. First insertion near the top of the code:
PHP Code:
if (!defined('IS_ADMIN_FLAG'))
{
die('Illegal Access');
}
// begin insertion 1 of 2
$force_default_currency = false;
$requested_page = $_SERVER['REQUEST_URI'];
// Does requested page contain the string 'checkout'?
// If so, then force currency to default
if (strpos($requested_page, 'checkout') !== false)
{
$force_default_currency = true;
}
// end insertion 1
The second insertion is just before the end of the code:
PHP Code:
// begin insertion 2 of 2
elseif ($force_default_currency)
{
$_SESSION['currency'] = DEFAULT_CURRENCY;
// redraw the page without the currency/language info in the URL
if (isset($_GET['currency']) || isset($_GET['language'])) zen_redirect(zen_href_link($current_page_base, zen_get_all_get_params(array('currency','language'))));
// end insertion 2
}
?>
This has solved my issue completely and my method may be helpful to others.
Bookmarks