From e7bab6eb5656e80e6908c7d59b4e99c5bc21fc44 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Sat, 17 Jan 2026 16:52:13 +0300 Subject: [PATCH] =?UTF-8?q?Dmitriy=20|=20chore:=20=D0=9E=D0=B1=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D0=BA=D1=83,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=B2=20?= =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=BB?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC=D0=B0=20=D0=B8=20=D1=83?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B8=D0=B7=20=D0=B3=D0=B8=D1=82?= =?UTF-8?q?=D0=B0=20credentials.json,=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B2=20=D0=BD=D0=B0=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- config/google/credentials.json | 13 ------------- config/google/template_credentials.json | 13 +++++++++++++ src/Controllers/OptionsController.php | 3 ++- src/Views/PriceUpdatesPage.php | 4 +++- 5 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 config/google/credentials.json create mode 100644 config/google/template_credentials.json 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 @@ - Обновляются только те товары, у которых присутствует артикул и цена не совпадает с базовой или акционной. + Обновляются только те товары, у которых присутствует артикул и цена не совпадает с базовой или акционной.
+ - Если у товара цена больше базовой, то она устанавлевается как базовая, а акционная цена обнуляется (если была установлена);
+ - Если цена меньше базовой, то она устанавливается как акционная.