From 2e0e3001f22f4f890e5519766b2ad90dd7f8ef77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9EAndrei?= Date: Mon, 26 Jan 2026 12:42:57 +0300 Subject: [PATCH] =?UTF-8?q?Dmitriy=20|=20fix:=20=D0=9F=D0=BE=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D0=BE=D1=82=D1=81=D1=83?= =?UTF-8?q?=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B5=20=D0=B0=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D0=BE=D0=BD=D0=BD=D0=BE=D0=B9=20=D1=86=D0=B5=D0=BD=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Services/WCPriceUpdate.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Services/WCPriceUpdate.php b/src/Services/WCPriceUpdate.php index e937017..04691d6 100644 --- a/src/Services/WCPriceUpdate.php +++ b/src/Services/WCPriceUpdate.php @@ -32,7 +32,7 @@ class WCPriceUpdate { ]; // Если цена товара равна базовой и акционная цена отсутствует, его нет смысла обновлять, т.к. данные везде совпадают - if ($price["regular"] === $price["new"] && $price["sale"] === 0) { + if ($price["regular"] === $price["new"] && $price["sale"] === "") { $result[] = array_merge($item->toArray(), $price, [ "message" => "Товар не обновлён. Цены совпадают.", "isError" => true ]); continue; } @@ -45,11 +45,8 @@ class WCPriceUpdate { if ($price["regular"] <= $price["new"]) { $product->set_regular_price($price["new"]); - // Полностью очищаем акционную цену - if ($price["sale"] > 0) { - $product = self::clearSalePrice($product); - } + $product = self::clearSalePrice($product); } else { if ($price["new"] == 0) { $product = self::clearSalePrice($product);