Fix module activation/deactivation
This commit is contained in:
Ivan Chaplygin 2023-11-21 15:22:11 +03:00
parent 2d2708adbe
commit 3e343faa19
2 changed files with 5 additions and 3 deletions

View file

@ -95,10 +95,11 @@ class RetailcrmSettings
private function setClientId()
{
$context = Context::getContext();
$clientId = uniqid();
Configuration::updateValue(RetailCRM::CLIENT_ID, hash(
'sha256',
$context->shop->id . Configuration::get('PS_SHOP_DOMAIN')
$context->shop->id . Configuration::get('PS_SHOP_DOMAIN') . $clientId
));
return true;

View file

@ -309,7 +309,8 @@ class RetailCRM extends Module
if (Shop::isFeatureActive()) {
$shops = Shop::getShops();
} else {
$shops[] = Shop::getContext();
$context = Context::getContext();
$shops[]['id_shop'] = $context->shop->id;
}
foreach ($shops as $shop) {
@ -371,7 +372,7 @@ class RetailCRM extends Module
return false;
}
$context = Shop::getContext();
$context = Context::getContext();
self::updateCrmModuleState($context->shop->id, false);