diff --git a/packages/Sarga/API/Http/Resources/Core/CMSResource.php b/packages/Sarga/API/Http/Resources/Core/CMSResource.php index b8ee537f9..21d46a138 100644 --- a/packages/Sarga/API/Http/Resources/Core/CMSResource.php +++ b/packages/Sarga/API/Http/Resources/Core/CMSResource.php @@ -16,6 +16,7 @@ class CMSResource extends \Illuminate\Http\Resources\Json\JsonResource 'content' => $this->content, 'page_title' => $this->page_title, 'html_content' => $this->html_content, + 'url_key' => $this->url_key, ]; } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 31094893d..cbd5cfe58 100644 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -197,6 +197,13 @@ class ProductRepository extends Repository $qb->whereIn('product_categories.category_id', explode(',', $categoryId)); } + if(isset($params['color'])){ + $qb->whereIn('product_flat.color', explode(',', $params['color'])); + } + + if(isset($params['size'])){ + $qb->whereIn('product_flat.size', explode(',', $params['size'])); + } if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) { $qb = $this->checkOutOfStockItem($qb); } @@ -209,17 +216,17 @@ class ProductRepository extends Repository $qb->where('product_flat.visible_individually', 1); } - if (isset($params['search'])) { - $qb->where('product_flat.name', 'like', '%' . urldecode($params['search']) . '%'); - } - - if (isset($params['name'])) { - $qb->where('product_flat.name', 'like', '%' . urldecode($params['name']) . '%'); - } - - if (isset($params['url_key'])) { - $qb->where('product_flat.url_key', 'like', '%' . urldecode($params['url_key']) . '%'); - } +// if (isset($params['search'])) { +// $qb->where('product_flat.name', 'like', '%' . urldecode($params['search']) . '%'); +// } +// +// if (isset($params['name'])) { +// $qb->where('product_flat.name', 'like', '%' . urldecode($params['name']) . '%'); +// } +// +// if (isset($params['url_key'])) { +// $qb->where('product_flat.url_key', 'like', '%' . urldecode($params['url_key']) . '%'); +// } # sort direction $orderDirection = 'asc'; @@ -284,7 +291,7 @@ class ProductRepository extends Repository $attributeFilters = $this->attributeRepository ->getProductDefaultAttributes(array_keys( - request()->except(['price']) + request()->except(['price','color','size']) )); if (count($attributeFilters) > 0) {