shish 3 лет назад
Родитель
Сommit
68523aed82
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      biz-ghs/product/classes/ProductClass.php

+ 8 - 1
biz-ghs/product/classes/ProductClass.php

@@ -622,7 +622,14 @@ class ProductClass extends BaseClass
         $discountPrice = $product['discountPrice'] ?? 0;
         if ($discountPrice > 0) {
             if ($level == 0) {
-                $price = $discountPrice;
+                $skMore = $product['skMore'] ?? 0;
+                $addPrice = $product['addPrice'] ?? 0;
+                $diff = bcsub($skMore,$addPrice, 2);
+                if ($diff > 0) {
+                    $price = bcsub($discountPrice, $diff, 2);
+                } else {
+                    $price = $discountPrice;
+                }
             }
             if ($level == 1) {
                 $price = $discountPrice;