cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to add specific products to Customer?

Former Member
0 Likes
1,608

Hi All,

(B2B site) We have requirement that customer should be able to see only few specified products(not all).

This applies to all the customer. Every customer will have different products

How to achieve this in Hybris latest version.

Main question is how to restrict customer in Solr to view only his products and not all products.

Accepted Solutions (0)

Answers (2)

Answers (2)

karnwal_ankit
Explorer
0 Likes

Hi Ansari,

As you have mentioned B2B SIte which will be more focused on B2BUnit instead B2BCustomer so you should create many to many mapping between Product and B2BUnit. If Products should be accessible to particular B2BCustomer then create mapping between Product and Principal. Afterwards you have to index these B2BUnit OR B2BCustomers in SOLR against each Product. Also you have to add code to tweak product accessibility for all Product Pages.

arvind-kumar_avinash
Active Contributor
0 Likes

It requires extending your-product model to add an attribute of type, principal. This attribute will hold the required customers to which the product should be visible. The next step would be to add this attribute to be indexed by Solr. Finally, you can process the data from Solr and display the products applicable for the logged in customer.

Former Member
0 Likes

how adding Principal in Product will help? Hope Should map set of product to customer. any idea on this?

arvind-kumar_avinash
Active Contributor
0 Likes

Let's say you are going to name this attribute as allowedCustomer. Then every product can have a customer or customer group assigned to allowedCustomer.

Former Member
0 Likes

Hi Arvind,

As you said we created allowedCustomers attribute in Product. but we are facing issue indexing it. you have any idea. how to index this. Pls help. your answer is highly appreciated

arvind-kumar_avinash
Active Contributor
0 Likes

I hope you have added the allowedCustomers as a SolrIndexedProperty in solr.impex. The next step is to write the value resolver for it. You can refer to https://wiki.hybris.com/pages/viewpage.action?pageId=294094315 and https://help.hybris.com/1811/hcd/8c7dea5386691014aceaa6b5ab3e31b9.html for hints.

Former Member
0 Likes

Thanks for the solution , but it will be product centric , but we have a requirement to to make it as Principal Centric . Any idea how can we achieve .