Skip to content

Commit

Permalink
Luigi's Box: fix filtering by availability
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav committed Dec 12, 2024
1 parent 1364272 commit e614dac
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class ProductFilterToLuigisBoxFilterMapper

/**
* @param \Shopsys\FrameworkBundle\Model\Product\Availability\ProductAvailabilityFacade $productAvailabilityFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
*/
public function __construct(
protected readonly ProductAvailabilityFacade $productAvailabilityFacade,
protected readonly Domain $domain,
) {
}

Expand Down Expand Up @@ -102,7 +104,7 @@ protected function mapAvailability(
array $luigisBoxFilter,
): array {
if ($productFilterData->inStock === true) {
$luigisBoxFilter[self::FILTER_OR][] = 'availability_rank:1';
$luigisBoxFilter[self::FILTER_OR][] = 'availability_rank_text:' . $this->productAvailabilityFacade->getOnStockText($this->domain->getLocale());
}

return $luigisBoxFilter;
Expand Down

0 comments on commit e614dac

Please sign in to comment.