fix bug 2

This commit is contained in:
2026-06-11 21:17:40 +03:30
parent 2636df99ad
commit a21dbcf3e1
5 changed files with 95 additions and 4 deletions
@@ -160,7 +160,13 @@ class ProductController extends SuperController
$products = Product::with(['file'])->where('active', 1)->get();
if (str_contains(request()->path(), '/customer/')) {
app(ProductDisplayPriceService::class)->enrichForApi($products);
$displayPriceService = app(ProductDisplayPriceService::class);
$displayPriceService->enrichForApi($products);
$products->each(function (Product $product) use ($displayPriceService) {
if (!$displayPriceService->hasCustomerDisplayPrice($product)) {
$product->setAttribute('show', false);
}
});
}
if (Product::hasPriceOffsetColumn() && str_contains(request()->path(), '/customer/')) {