From c7638918ff254e8aa01fffed9feefe39cf3a3320 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 23 Jun 2026 15:55:12 +0330 Subject: [PATCH] fixed upload file 2 --- app/Services/ProductDisplayPriceService.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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; } /**