Skip to content

Commit

Permalink
Get filters from landing page instead of registry
Browse files Browse the repository at this point in the history
  • Loading branch information
jansentjeu committed Nov 1, 2024
1 parent b8715e0 commit 5d25581
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Plugin/Block/Product/ListProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Registry;
use Tweakwise\Magento2Tweakwise\Block\Product\ListProduct as Subject;
use Tweakwise\Magento2Tweakwise\Helper\Cache;

Expand All @@ -18,13 +17,11 @@ class ListProduct
* @param RequestInterface $request
* @param Cache $cacheHelper
* @param LandingPageRepositoryInterface $landingPageRepository
* @param Registry $registry
*/
public function __construct(
private readonly RequestInterface $request,
private readonly Cache $cacheHelper,
private readonly LandingPageRepositoryInterface $landingPageRepository,
private readonly Registry $registry
private readonly LandingPageRepositoryInterface $landingPageRepository
) {
}

Expand Down Expand Up @@ -52,7 +49,7 @@ public function beforeGetUrl(Subject $subject, $route = '', $params = [])
return [$route, $params];
}

$filters = $this->registry->registry(sprintf('alp_filters_%s', $landingPageId)) ?? [];
$filters = $landingPage->getFilters();
$filterTemplate = $landingPage->getTweakwiseFilterTemplate();
$sortTemplate = $landingPage->getTweakwiseSortTemplate();

Expand Down

0 comments on commit 5d25581

Please sign in to comment.