diff --git a/app/Services/ProductDisplayPriceService.php b/app/Services/ProductDisplayPriceService.php index 35443a6..59cab0b 100644 --- a/app/Services/ProductDisplayPriceService.php +++ b/app/Services/ProductDisplayPriceService.php @@ -30,7 +30,22 @@ class ProductDisplayPriceService return false; } - return $this->isMeltedTradeProduct($product); + return $this->isMeltedTradeProduct($product) + || $this->usesQuantityAppPrice($product); + } + + /** معامله مقداری با قیمت اپ — نه قیمت دستی قدیمی با price پر در DB */ + private function usesQuantityAppPrice(Product $product): bool + { + if (! ($product->trade_by_quantity ?? false)) { + return false; + } + + if ($product->reading_method || (int) ($product->direct_price ?? 0) === 1) { + return false; + } + + return (int) ($product->price ?? 0) <= 0; } /**