diff --git a/.gitignore b/.gitignore index 88e99d5..cbc099d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor -composer.lock \ No newline at end of file +composer.lock +config/google/credentials.json \ No newline at end of file diff --git a/config/google/credentials.json b/config/google/credentials.json deleted file mode 100644 index 643d412..0000000 --- a/config/google/credentials.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "service_account", - "project_id": "", - "private_key_id": "", - "private_key": "", - "client_email": "", - "client_id": "", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/gs-648%40weighty-forest-484418-g1.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} \ No newline at end of file diff --git a/config/google/template_credentials.json b/config/google/template_credentials.json new file mode 100644 index 0000000..bfefea6 --- /dev/null +++ b/config/google/template_credentials.json @@ -0,0 +1,13 @@ +{ + "type": "", + "project_id": "", + "private_key_id": "", + "private_key": "", + "client_email": "", + "client_id": "", + "auth_uri": "", + "token_uri": "", + "auth_provider_x509_cert_url": "", + "client_x509_cert_url": "", + "universe_domain": "" +} \ No newline at end of file diff --git a/src/Controllers/OptionsController.php b/src/Controllers/OptionsController.php index 7dd9e16..6466b21 100644 --- a/src/Controllers/OptionsController.php +++ b/src/Controllers/OptionsController.php @@ -39,7 +39,7 @@ class OptionsController extends AbstractController { public static function update() { $result = OptionsService::update($_POST); - if (OptionsService::update($_POST) === false) { + if ($result === false) { wp_send_json([ "error" => true, "message" => "Ошибка сохранения настроек.", @@ -48,6 +48,7 @@ class OptionsController extends AbstractController { wp_die(); } + // Переинициализируем парсер, чтобы обновить клиент гугла GoogleTableParser::init(); wp_send_json($result, 200); diff --git a/src/Views/PriceUpdatesPage.php b/src/Views/PriceUpdatesPage.php index dc19d24..5ef9253 100644 --- a/src/Views/PriceUpdatesPage.php +++ b/src/Views/PriceUpdatesPage.php @@ -26,7 +26,9 @@ - Обновляются только те товары, у которых присутствует артикул и цена не совпадает с базовой или акционной. + Обновляются только те товары, у которых присутствует артикул и цена не совпадает с базовой или акционной.
+ - Если у товара цена больше базовой, то она устанавлевается как базовая, а акционная цена обнуляется (если была установлена);
+ - Если цена меньше базовой, то она устанавливается как акционная.