diff --git a/config.xml b/config.xml index f2e08bde1..e259d574c 100644 --- a/config.xml +++ b/config.xml @@ -2,11 +2,11 @@ ps_facetedsearch - + 1 0 - \ No newline at end of file + diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index d75e54483..33eecd2d6 100755 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -84,7 +84,7 @@ public function __construct() { $this->name = 'ps_facetedsearch'; $this->tab = 'front_office_features'; - $this->version = '3.0.0'; + $this->version = '3.0.1'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true; diff --git a/src/Product/Search.php b/src/Product/Search.php index d67e93cfc..3a0afc438 100644 --- a/src/Product/Search.php +++ b/src/Product/Search.php @@ -109,6 +109,9 @@ public function initSearch($selectedFilters) $this->addFilter('id_category_default', [$parent->id]); } + // Visibility of a product must be in catalog or both (search & catalog) + $this->addFilter('visibility', ['both', 'catalog']); + $this->addSearchFilters( $selectedFilters, $psLayeredFullTree ? $parent : null, diff --git a/tests/php/FacetedSearch/Product/SearchTest.php b/tests/php/FacetedSearch/Product/SearchTest.php index 7ee537cdf..3ebaf508a 100644 --- a/tests/php/FacetedSearch/Product/SearchTest.php +++ b/tests/php/FacetedSearch/Product/SearchTest.php @@ -110,6 +110,14 @@ public function testInitSearchWithEmptyFilters() ], ], ], + 'visibility' => [ + '=' => [ + [ + 'both', + 'catalog', + ], + ], + ], ], $this->search->getSearchAdapter()->getInitialPopulation()->getFilters()->toArray() ); @@ -235,6 +243,14 @@ public function testInitSearchWithAllFilters() ], ], ], + 'visibility' => [ + '=' => [ + [ + 'both', + 'catalog', + ], + ], + ], ], $this->search->getSearchAdapter()->getInitialPopulation()->getFilters()->toArray() );