Magento 2 how to filter product collection on category page with custom filters The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraCustom category collection not rendering correct results in layered navigation and toolbar in magento 2Filter magento product collection by category id but NOT category childrenMagento 2 Product Collection with Multi Categories Layered NavigationRemove Category filter from Shop By Filter Renderer in Magento 2Magento 2 : Static blocks with products on category landing pageMagento-2 How to get custom product collection in catalog search result based on particular categoryMagento-2 How to change product collection based on categoriesHow to apply visibility filter to category view's product collection in magento 2?How to get current category price range filter list in Magento2Filter on custom product collection
Keeping a retro style to sci-fi spaceships?
Solving overdetermined system by QR decomposition
Can I visit the Trinity College (Cambridge) library and see some of their rare books
Why can't devices on different VLANs, but on the same subnet, communicate?
How to make Illustrator type tool selection automatically adapt with text length
Working through the single responsibility principle (SRP) in Python when calls are expensive
Why doesn't a hydraulic lever violate conservation of energy?
Deal with toxic manager when you can't quit
"... to apply for a visa" or "... and applied for a visa"?
How do you keep chess fun when your opponent constantly beats you?
What aspect of planet Earth must be changed to prevent the industrial revolution?
What do I do when my TA workload is more than expected?
How to read αἱμύλιος or when to aspirate
Why did Peik Lin say, "I'm not an animal"?
For what reasons would an animal species NOT cross a *horizontal* land bridge?
Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?
What's the point in a preamp?
ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?
Did the new image of black hole confirm the general theory of relativity?
Variable with quotation marks "$()"
Using dividends to reduce short term capital gains?
Define a list range inside a list
Can we generate random numbers using irrational numbers like π and e?
How to handle characters who are more educated than the author?
Magento 2 how to filter product collection on category page with custom filters
The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraCustom category collection not rendering correct results in layered navigation and toolbar in magento 2Filter magento product collection by category id but NOT category childrenMagento 2 Product Collection with Multi Categories Layered NavigationRemove Category filter from Shop By Filter Renderer in Magento 2Magento 2 : Static blocks with products on category landing pageMagento-2 How to get custom product collection in catalog search result based on particular categoryMagento-2 How to change product collection based on categoriesHow to apply visibility filter to category view's product collection in magento 2?How to get current category price range filter list in Magento2Filter on custom product collection
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have one category in system... For example EMT. There are many products assigned to it. Now I want to filter some products for particular customers for that category. I mean only specific products should be display in that category for some customers. It should display all the products to guest users.
How can I do that so all the collection should filter with proper layered navigation and toolbar collection.
Can anyone suggest the way to do this with files I need to override?

magento2 category category-products
add a comment |
I have one category in system... For example EMT. There are many products assigned to it. Now I want to filter some products for particular customers for that category. I mean only specific products should be display in that category for some customers. It should display all the products to guest users.
How can I do that so all the collection should filter with proper layered navigation and toolbar collection.
Can anyone suggest the way to do this with files I need to override?

magento2 category category-products
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you can use eventcatalog_block_product_list_collectionto filter you products
– Minesh Patel
Nov 2 '17 at 7:45
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50
add a comment |
I have one category in system... For example EMT. There are many products assigned to it. Now I want to filter some products for particular customers for that category. I mean only specific products should be display in that category for some customers. It should display all the products to guest users.
How can I do that so all the collection should filter with proper layered navigation and toolbar collection.
Can anyone suggest the way to do this with files I need to override?

magento2 category category-products
I have one category in system... For example EMT. There are many products assigned to it. Now I want to filter some products for particular customers for that category. I mean only specific products should be display in that category for some customers. It should display all the products to guest users.
How can I do that so all the collection should filter with proper layered navigation and toolbar collection.
Can anyone suggest the way to do this with files I need to override?

magento2 category category-products
magento2 category category-products
asked Nov 2 '17 at 7:09
Jagdish BarotJagdish Barot
1149
1149
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you can use eventcatalog_block_product_list_collectionto filter you products
– Minesh Patel
Nov 2 '17 at 7:45
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50
add a comment |
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you can use eventcatalog_block_product_list_collectionto filter you products
– Minesh Patel
Nov 2 '17 at 7:45
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you can use event
catalog_block_product_list_collection to filter you products– Minesh Patel
Nov 2 '17 at 7:45
you can use event
catalog_block_product_list_collection to filter you products– Minesh Patel
Nov 2 '17 at 7:45
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50
add a comment |
1 Answer
1
active
oldest
votes
I assume you know how to write a plugin and how to write a script in Magento 2. With this in mind, the plan to have your issue resolved would be as follows:
add a product attribute that is a boolean and define for all your products whether they can be displayed to guests or not
—> make it layered enabledupdate all your products in your catalog with a script
in the block
MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on thefunction getLoadedProductCollection
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f199729%2fmagento-2-how-to-filter-product-collection-on-category-page-with-custom-filters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I assume you know how to write a plugin and how to write a script in Magento 2. With this in mind, the plan to have your issue resolved would be as follows:
add a product attribute that is a boolean and define for all your products whether they can be displayed to guests or not
—> make it layered enabledupdate all your products in your catalog with a script
in the block
MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on thefunction getLoadedProductCollection
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
add a comment |
I assume you know how to write a plugin and how to write a script in Magento 2. With this in mind, the plan to have your issue resolved would be as follows:
add a product attribute that is a boolean and define for all your products whether they can be displayed to guests or not
—> make it layered enabledupdate all your products in your catalog with a script
in the block
MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on thefunction getLoadedProductCollection
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
add a comment |
I assume you know how to write a plugin and how to write a script in Magento 2. With this in mind, the plan to have your issue resolved would be as follows:
add a product attribute that is a boolean and define for all your products whether they can be displayed to guests or not
—> make it layered enabledupdate all your products in your catalog with a script
in the block
MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on thefunction getLoadedProductCollection
I assume you know how to write a plugin and how to write a script in Magento 2. With this in mind, the plan to have your issue resolved would be as follows:
add a product attribute that is a boolean and define for all your products whether they can be displayed to guests or not
—> make it layered enabledupdate all your products in your catalog with a script
in the block
MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on thefunction getLoadedProductCollection
edited Jun 14 '18 at 9:06
Rama Chandran M
2,74181530
2,74181530
answered Jun 14 '18 at 8:59
Herve TribouilloyHerve Tribouilloy
1,349510
1,349510
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
add a comment |
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
wrong product count in layernavigation.
– Jagdish Barot
Oct 16 '18 at 7:56
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f199729%2fmagento-2-how-to-filter-product-collection-on-category-page-with-custom-filters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you have pre list of product to show to customer ?
– Minesh Patel
Nov 2 '17 at 7:42
you can use event
catalog_block_product_list_collectionto filter you products– Minesh Patel
Nov 2 '17 at 7:45
@RaphaelatDigitalPianism can you help on this?
– Jagdish Barot
Nov 3 '17 at 6:50