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);