From 1f129658d0d1992f5df53f6a52e6414afebc3b64 Mon Sep 17 00:00:00 2001 From: merdan Date: Sun, 30 Apr 2023 11:54:22 +0500 Subject: [PATCH] product detail --- packages/Sarga/API/Http/Controllers/Products.php | 2 ++ packages/Sarga/API/Http/Controllers/SearchController.php | 7 ++----- .../Sarga/API/Http/Resources/Catalog/ProductDetail.php | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/Sarga/API/Http/Controllers/Products.php b/packages/Sarga/API/Http/Controllers/Products.php index f428db213..41e52a543 100644 --- a/packages/Sarga/API/Http/Controllers/Products.php +++ b/packages/Sarga/API/Http/Controllers/Products.php @@ -76,6 +76,8 @@ class Products extends ProductController // return $product; + Log::info($product); + return ProductDetail::make($product); } diff --git a/packages/Sarga/API/Http/Controllers/SearchController.php b/packages/Sarga/API/Http/Controllers/SearchController.php index b7aa7e5d9..3b1bc0f14 100644 --- a/packages/Sarga/API/Http/Controllers/SearchController.php +++ b/packages/Sarga/API/Http/Controllers/SearchController.php @@ -67,12 +67,9 @@ class SearchController extends V1Controller private function searchProducts($key){ -// $channel = core()->getRequestedChannelCode(); - -// $locale = core()->getRequestedLocaleCode(); + $locale = core()->getRequestedLocaleCode(); $products = $this->productFlatRepository->getModel()::search(implode(' OR ', $key)) -// ->where('channel', $channel) -// ->where('locale', $locale) + ->where('locale', $locale) // ->addSelect(DB::raw("\'product\' as type" )) diff --git a/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php b/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php index 5ad6eb634..45a5af528 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php +++ b/packages/Sarga/API/Http/Resources/Catalog/ProductDetail.php @@ -33,5 +33,4 @@ class ProductDetail extends Product ]; } - } \ No newline at end of file