diff --git a/retailcrm/lib/settings/RetailcrmSettings.php b/retailcrm/lib/settings/RetailcrmSettings.php index 9ebbec2..7bdaf4d 100644 --- a/retailcrm/lib/settings/RetailcrmSettings.php +++ b/retailcrm/lib/settings/RetailcrmSettings.php @@ -68,17 +68,17 @@ class RetailcrmSettings */ public function save() { - $changed = $this->settings->getChanged(); - if ($this->validator->validate(true)) { $this->settings->updateValueAll(); - if (array_key_exists('apiKey', $changed)) { + if (array_key_exists('apiKey', $this->settings->getChanged())) { $this->setClientId(); RetailCRM::updateCrmModuleState(Context::getContext()->shop->id); } } + $changed = $this->settings->getChanged(); + if ($this->consultantScript->issetValue()) { $this->updateConsultantCode(); $changed['consultantScript'] = $this->consultantScript->getValueStored();