mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
parent
2d2708adbe
commit
3d6edb8b97
@ -1,3 +1,6 @@
|
||||
## v3.6.3
|
||||
* Исправление активации/деактивации модуля
|
||||
|
||||
## v3.6.2
|
||||
* Добавлена валидация валют при настройке модуля
|
||||
|
||||
|
@ -71,9 +71,12 @@ class RetailcrmSettings
|
||||
if ($this->validator->validate(true)) {
|
||||
$this->settings->updateValueAll();
|
||||
|
||||
if (array_key_exists('apiKey', $this->settings->getChanged())) {
|
||||
$shopId = Context::getContext()->shop->id;
|
||||
|
||||
if (array_key_exists('apiKey', $this->settings->getChanged())
|
||||
&& !Configuration::get(RetailCRM::CLIENT_ID, null, null, $shopId)) {
|
||||
$this->setClientId();
|
||||
RetailCRM::updateCrmModuleState(Context::getContext()->shop->id);
|
||||
RetailCRM::updateCrmModuleState($shopId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,10 +98,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;
|
||||
|
@ -48,7 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php';
|
||||
|
||||
class RetailCRM extends Module
|
||||
{
|
||||
const VERSION = '3.6.2';
|
||||
const VERSION = '3.6.3';
|
||||
|
||||
const API_URL = 'RETAILCRM_ADDRESS';
|
||||
const API_KEY = 'RETAILCRM_API_TOKEN';
|
||||
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user