fix bug 2
This commit is contained in:
@@ -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/')) {
|
||||
|
||||
Reference in New Issue
Block a user