eugene-petrov/magento2-category-filter

Magento 2 category filter

dev-main 2022-01-13 13:51 UTC

This package is auto-updated.

Last update: 2024-09-13 19:28:03 UTC


README

M2 Coding Standard M2 Mess Detector M2 PHPStan

ReadyToGo_CategoryFilter

Task: we need to display only products that are added to several categories on product listing page

To enable this module execute:

  • composer require eugene-petrov/magento2-category-filter or if the cmd above is not working: composer config repositories.readyToGoCategoryFilter vcs git@github.com:eugene-petrov/magento2-category-filter.git
  • php bin/magento setup:upgrade
  • php bin/magento cache:clean

Example

Preconditions: magento sample data is installed

Let's imagine that we are on a category page like this one: img

And we need a filter to find out which products (from this particular category) are on sale (assigned to the Sale category). img_1

To make it done, let's specify a parameter in the URL cat_ids with category id (or ids) which we need and observe the result: img_2

This is it. Now we can build something on top of this implementation.