I've recently set up the multistore function so that we have two versions - USA and international.
The international site has 9 currencies (including US dollars which is the default currency), but the USA site has only US dollars.
I can disable the other 8 currencies for the US site. But when the currency update cron runs (twice a day) ALL 9 currencies are re-enabled for the US site.
The cron job is run with admin/cron_currency_rates.php which updates all shops:
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
if (isset($_GET['secure_key'])) {
$secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME'));
if (!empty($secureKey) && $secureKey === $_GET['secure_key']) {
$shopIds = Shop::getCompleteListOfShopsID();
foreach ($shopIds as $idShop) {
Shop::setContext(Shop::CONTEXT_SHOP, (int) $idShop);
Currency::refreshCurrencies();
}
}
}
If I click on the "Update currency rates" button the unwanted currencies are not re-enabled.
Any ideas on how to stop the cron job from re-enabling these unwanted currencies?
Question
beetea2
I've recently set up the multistore function so that we have two versions - USA and international.
The international site has 9 currencies (including US dollars which is the default currency), but the USA site has only US dollars.
I can disable the other 8 currencies for the US site. But when the currency update cron runs (twice a day) ALL 9 currencies are re-enabled for the US site.
The cron job is run with admin/cron_currency_rates.php which updates all shops:
if (!defined('_PS_ADMIN_DIR_')) { define('_PS_ADMIN_DIR_', getcwd()); } include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); if (isset($_GET['secure_key'])) { $secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')); if (!empty($secureKey) && $secureKey === $_GET['secure_key']) { $shopIds = Shop::getCompleteListOfShopsID(); foreach ($shopIds as $idShop) { Shop::setContext(Shop::CONTEXT_SHOP, (int) $idShop); Currency::refreshCurrencies(); } } }
If I click on the "Update currency rates" button the unwanted currencies are not re-enabled.
Any ideas on how to stop the cron job from re-enabling these unwanted currencies?
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now