Magento 2 how to filter product collection on category page with custom filtersCustom 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

Landing in very high winds

Ideas for 3rd eye abilities

Re-submission of rejected manuscript without informing co-authors

Are white and non-white police officers equally likely to kill black suspects?

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

Prime joint compound before latex paint?

Need help identifying/translating a plaque in Tangier, Morocco

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Are objects structures and/or vice versa?

Email Account under attack (really) - anything I can do?

How to make payment on the internet without leaving a money trail?

Is "plugging out" electronic devices an American expression?

What do the Banks children have against barley water?

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Doomsday-clock for my fantasy planet

Where else does the Shulchan Aruch quote an authority by name?

Can I legally use front facing blue light in the UK?

Unbreakable Formation vs. Cry of the Carnarium

Is a vector space a subspace of itself?

Is window.confirm() accessible?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Why was the "bread communication" in the arena of Catching Fire left out in the movie?



Magento 2 how to filter product collection on category page with custom filters


Custom 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;








7















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?



enter image description here










share|improve this question














bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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












  • @RaphaelatDigitalPianism can you help on this?

    – Jagdish Barot
    Nov 3 '17 at 6:50

















7















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?



enter image description here










share|improve this question














bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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












  • @RaphaelatDigitalPianism can you help on this?

    – Jagdish Barot
    Nov 3 '17 at 6:50













7












7








7


2






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?



enter image description here










share|improve this question














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?



enter image description here







magento2 category category-products






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 2 '17 at 7:09









Jagdish BarotJagdish Barot

1149




1149





bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • 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












  • @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 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
















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










1 Answer
1






active

oldest

votes


















0














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:



  1. 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 enabled


  2. update all your products in your catalog with a script


  3. in the block MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on the function getLoadedProductCollection






share|improve this answer

























  • wrong product count in layernavigation.

    – Jagdish Barot
    Oct 16 '18 at 7:56












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
);



);













draft saved

draft discarded


















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









0














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:



  1. 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 enabled


  2. update all your products in your catalog with a script


  3. in the block MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on the function getLoadedProductCollection






share|improve this answer

























  • wrong product count in layernavigation.

    – Jagdish Barot
    Oct 16 '18 at 7:56
















0














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:



  1. 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 enabled


  2. update all your products in your catalog with a script


  3. in the block MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on the function getLoadedProductCollection






share|improve this answer

























  • wrong product count in layernavigation.

    – Jagdish Barot
    Oct 16 '18 at 7:56














0












0








0







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:



  1. 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 enabled


  2. update all your products in your catalog with a script


  3. in the block MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on the function getLoadedProductCollection






share|improve this answer















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:



  1. 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 enabled


  2. update all your products in your catalog with a script


  3. in the block MagentoCatalogBlockProductListProduct, you may change the function that loads the products using a plugin on the function getLoadedProductCollection







share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Nidaros erkebispedøme

Birsay

Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?