diff --git a/src/module-elasticsuite-virtual-category/Model/Preview.php b/src/module-elasticsuite-virtual-category/Model/Preview.php index 9257d1484..ffef321ce 100644 --- a/src/module-elasticsuite-virtual-category/Model/Preview.php +++ b/src/module-elasticsuite-virtual-category/Model/Preview.php @@ -121,7 +121,7 @@ protected function prepareProductCollection(Collection $collection) : Collection $directionFallback = $sortBy !== 'position' ? Collection::SORT_ORDER_ASC : Collection::SORT_ORDER_DESC; $direction = $this->request->getParam('sort_direction', $directionFallback); - if (empty($direction)) { + if (empty($direction) || ((string) $direction === '')) { $direction = $directionFallback; } $collection->setOrder($sortBy, $direction);