Magento-2 How to get custom product collection in catalog search result based on particular categoryOn Search Result: Group Products by CategoryHow to exclude or include specific category in catalog search result?How to order search results by category?Include category in search resultSearch result in magentocatalog search product per page issueMagento-2 How to change product collection based on categoriesSearch product URL as catalog/view/id/213 Magento 2Magento2.3 - How to Sort Products Based on Attribute CategoryChange Magento 2 catalog search result
What to do when surprise and a high initiative roll conflict with the narrative?
Extreme flexible working hours: how to control people and activities?
Is it possible to have a wealthy country without a middle class?
Cascading Switches. Will it affect performance?
How can I end combat quickly when the outcome is inevitable?
What ways have you found to get edits from non-LaTeX users?
Need feedback - Can the composition/colors of this design be fixed if something is lacking or is not a better fit?
English word for "product of tinkering"
What can I, as a user, do about offensive reviews in App Store?
Is an entry level DSLR going to shoot nice portrait pictures?
Arriving at the same result with the opposite hypotheses
Pathfinder warbow concept review
How do I prevent employees from either switching to competitors or opening their own business?
Group Integers by Originality
How to tell your grandparent to not come to fetch you with their car?
Is this use of the expression "long past" correct?
Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?
SQL counting distinct over partition
Using "subway" as name for London Underground?
What is the purpose of the goat for Azazel, as opposed to conventional offerings?
is it possible for a vehicle to be manufactured witout a catalitic converter
Giant Steps - Coltrane and Slonimsky
Why can't I use =default for default ctors with a member initializer list
Non-disclosure agreement in a small business
Magento-2 How to get custom product collection in catalog search result based on particular category
On Search Result: Group Products by CategoryHow to exclude or include specific category in catalog search result?How to order search results by category?Include category in search resultSearch result in magentocatalog search product per page issueMagento-2 How to change product collection based on categoriesSearch product URL as catalog/view/id/213 Magento 2Magento2.3 - How to Sort Products Based on Attribute CategoryChange Magento 2 catalog search result
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.
Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.
See below Example
Suppose customer A has access to only categories Men > Tops > Tshirts.
So, he will only see Men > Tops > Tshirts
products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.
magento2 collection catalogsearch
add a comment |
I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.
Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.
See below Example
Suppose customer A has access to only categories Men > Tops > Tshirts.
So, he will only see Men > Tops > Tshirts
products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.
magento2 collection catalogsearch
add a comment |
I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.
Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.
See below Example
Suppose customer A has access to only categories Men > Tops > Tshirts.
So, he will only see Men > Tops > Tshirts
products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.
magento2 collection catalogsearch
I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.
Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.
See below Example
Suppose customer A has access to only categories Men > Tops > Tshirts.
So, he will only see Men > Tops > Tshirts
products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.
magento2 collection catalogsearch
magento2 collection catalogsearch
edited Aug 1 '17 at 9:02
Suresh Chikani
asked Aug 1 '17 at 5:47
Suresh ChikaniSuresh Chikani
10.5k53673
10.5k53673
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I had a similar requirement to restrict the access to products in search result based on some customer attribute.
There are 2 classes responsible to filter and build the query for catalog search namely MagentoCatalogSearchModelSearchIndexBuilder
and MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch
,
You can add plugin/override to the methods IndexBuilder::build
and the method MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch::build
to apply the required logic.
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
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%2f187286%2fmagento-2-how-to-get-custom-product-collection-in-catalog-search-result-based-on%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 had a similar requirement to restrict the access to products in search result based on some customer attribute.
There are 2 classes responsible to filter and build the query for catalog search namely MagentoCatalogSearchModelSearchIndexBuilder
and MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch
,
You can add plugin/override to the methods IndexBuilder::build
and the method MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch::build
to apply the required logic.
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
add a comment |
I had a similar requirement to restrict the access to products in search result based on some customer attribute.
There are 2 classes responsible to filter and build the query for catalog search namely MagentoCatalogSearchModelSearchIndexBuilder
and MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch
,
You can add plugin/override to the methods IndexBuilder::build
and the method MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch::build
to apply the required logic.
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
add a comment |
I had a similar requirement to restrict the access to products in search result based on some customer attribute.
There are 2 classes responsible to filter and build the query for catalog search namely MagentoCatalogSearchModelSearchIndexBuilder
and MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch
,
You can add plugin/override to the methods IndexBuilder::build
and the method MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch::build
to apply the required logic.
I had a similar requirement to restrict the access to products in search result based on some customer attribute.
There are 2 classes responsible to filter and build the query for catalog search namely MagentoCatalogSearchModelSearchIndexBuilder
and MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch
,
You can add plugin/override to the methods IndexBuilder::build
and the method MagentoFrameworkSearchAdapterMysqlQueryBuilderMatch::build
to apply the required logic.
answered Aug 1 '17 at 9:14
Taral PatoliyaTaral Patoliya
94621035
94621035
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
add a comment |
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
I have checked but I can't see any category condition here, can you please give me some more ideas for categories access restriction.
– Suresh Chikani
Aug 1 '17 at 9:27
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%2f187286%2fmagento-2-how-to-get-custom-product-collection-in-catalog-search-result-based-on%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