Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63fd2b4850 |
@@ -32,7 +32,7 @@ class WCPriceUpdate {
|
||||
];
|
||||
|
||||
// Если цена товара равна базовой и акционная цена отсутствует, его нет смысла обновлять, т.к. данные везде совпадают
|
||||
if ($price["regular"] === $price["new"] && $price["sale"] === "") {
|
||||
if ($price["regular"] === $price["new"] && $price["sale"] === 0) {
|
||||
$result[] = array_merge($item->toArray(), $price, [ "message" => "Товар не обновлён. Цены совпадают.", "isError" => true ]);
|
||||
continue;
|
||||
}
|
||||
@@ -45,8 +45,11 @@ class WCPriceUpdate {
|
||||
|
||||
if ($price["regular"] <= $price["new"]) {
|
||||
$product->set_regular_price($price["new"]);
|
||||
|
||||
// Полностью очищаем акционную цену
|
||||
$product = self::clearSalePrice($product);
|
||||
if ($price["sale"] > 0) {
|
||||
$product = self::clearSalePrice($product);
|
||||
}
|
||||
} else {
|
||||
if ($price["new"] == 0) {
|
||||
$product = self::clearSalePrice($product);
|
||||
|
||||
Reference in New Issue
Block a user