Jump to content
thirty bees forum
  • 0

Question

Posted

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?

 

Screenshot_20251009_111914.jpeg

1 answer to this question

Recommended Posts

  • 0
Posted

Could you post more detailed repro steps as I'm unable to replicate this.

I have 2 shops, If I have the same currencies in both - I'm unable to disable/enable them per shop. If I switch to Shop 2 context and disable a currency it gets disabled for shop 1 also.

If I put a new currency in shop 2 only then I can disable it and it's not visible in shop 1 but then when I run the cron the disabled currencies stay at the same status.

Also what currency update module do you use?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...