From cd594fae5480fca87974eb5baadd0bfeb0770776 Mon Sep 17 00:00:00 2001 From: jitendra Date: Tue, 30 Aug 2022 11:03:45 +0530 Subject: [PATCH] Fixed typo --- .../src/Repositories/ProductFlatRepository.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php index a085559ff..c3a5a4cc5 100644 --- a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php @@ -39,7 +39,7 @@ class ProductFlatRepository extends Repository * @param int $categoryId * @return \Illuminate\Support\Querybuilder */ - public function categoryProductQuerybuilder($categoryId) + public function categoryProductQueryBuilder($categoryId) { return $this->model ->leftJoin('product_categories', 'product_flat.product_id', 'product_categories.product_id') @@ -74,7 +74,7 @@ class ProductFlatRepository extends Repository */ public function getCategoryProductAttribute($categoryId) { - $qb = $this->categoryProductQuerybuilder($categoryId); + $qb = $this->categoryProductQueryBuilder($categoryId); $childQuery = $this->model->distinct()->whereIn('parent_id', $qb->distinct()->select(['id'])); @@ -144,18 +144,18 @@ class ProductFlatRepository extends Repository return $loadedCategoryAttributes[$category->id]; } - $productsCount = $this->categoryProductQuerybuilder($category->id)->count(); + $productsCount = $this->categoryProductQueryBuilder($category->id)->count(); if ($productsCount > 0) { $categoryFilterableAttributes = $category->filterableAttributes->pluck('id')->toArray(); - $productCategoryArrributes = $this->getCategoryProductAttribute($category->id); + $productCategoryAttributes = $this->getCategoryProductAttribute($category->id); - $allFilterableAttributes = array_filter(array_unique(array_intersect($categoryFilterableAttributes, $productCategoryArrributes['attributes']))); + $allFilterableAttributes = array_filter(array_unique(array_intersect($categoryFilterableAttributes, $productCategoryAttributes['attributes']))); $attributes = $this->attributeRepository->getModel()::with([ - 'options' => function ($query) use ($productCategoryArrributes) { - return $query->whereIn('id', $productCategoryArrributes['attributeOptions']) + 'options' => function ($query) use ($productCategoryAttributes) { + return $query->whereIn('id', $productCategoryAttributes['attributeOptions']) ->orderBy('sort_order'); } ])->whereIn('id', $allFilterableAttributes)->get();