* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL * @license https://opensource.org/licenses/MIT The MIT License * * Don't forget to prefix your containers with your own identifier * to avoid any conflicts with others containers. */ if (!defined('_PS_VERSION_')) { exit; } /** * Upgrade module to version 3.4.13 * * @param \RetailCRM $module * * @return bool */ function upgrade_module_3_4_13($module) { if ('retailcrm' != $module->name) { return false; } if (Shop::isFeatureActive()) { $shops = Shop::getShops(); } else { $shops[] = ['id_shop' => Shop::getContext()->shop->id]; } foreach ($shops as $shop) { if (isset($shop['id_shop'])) { $idShop = (int) $shop['id_shop']; if ( !Configuration::hasKey($module::CLIENT_ID, null, null, $idShop) || empty(Configuration::get($module::CLIENT_ID, null, null, $idShop)) ) { Configuration::updateValue( $module::CLIENT_ID, hash('sha256', $idShop . Configuration::get('PS_SHOP_DOMAIN')), false, null, $idShop ); } $module::updateCrmModuleState($idShop); } } return true; }