diff --git a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php index 2d2295854..85399f8a8 100644 --- a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php @@ -73,7 +73,7 @@ class ProductFlatRepository extends Repository public function getFilterableAttributes($category, $products) { $filterAttributes = []; - if (count($category->filterableAttributes) > 0 && count($products)) { + if (count($category->filterableAttributes) > 0 ) { $filterAttributes = $category->filterableAttributes; } else { $categoryProductAttributes = $this->getCategoryProductAttribute($category->id); diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php index 6cd7262b9..f8327f68c 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php @@ -11,7 +11,9 @@ $products = $productRepository->getAll($category->id); $filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products); - } else { + } + + if (! count($filterAttributes) > 0) { $filterAttributes = $attributeRepository->getFilterAttributes(); } diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php index 632bdfaaa..d73c3d012 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php @@ -9,7 +9,9 @@ $products = $productRepository->getAll($category->id); $filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products); - } else { + } + + if (! count($filterAttributes) > 0) { $filterAttributes = $attributeRepository->getFilterAttributes(); }