Customer specific catalog
Displaying customer specific products can be achieved by providing us the customer identifiers and using the curent customer as a filter.
Normally, filtering is done by adding an attribute to a filtertemplate. The drawback: you'll see the customer identifier in the selection. To prevent that, we introduced request parameters: the effect on product filtering is the same but it brings performance improvements (over a regular filter) and solves the selection problem.
Steps to take:
- Add an attribute containing the customer identifiers that have the product in their range.
- Configure the attribute as request parameter.
- Use the parameter in your platform to show products for the current customer.
Add an attribute
Add an attribute to the product feed, containing the customer identifiers that have the product in their range.
<item>
<id>TSH0123</id>
<name>Shirt Colin</name>
<!-- omitted for brevity -->
<attributes>
<attribute>
<name>allow_customer</name>
<value>10005</value>
</attribute>
<attribute>
<name>allow_customer</name>
<value>10006</value>
</attribute>
<attribute>
<name>allow_customer</name>
<value>10018</value>
</attribute>
</attributes>
</item>
This will be visible in the items module as:
Configure as request parameter
Follow the guide to Configure the attribute as request parameter.
Use the parameter
In the examples we take this as a starting point:
- Attribute name:
allow_customer
- Current customer idenfier:
10005
Tweakwise JS
Use the parameters
option to filter on the current customer for search and merchandising:
window["twn-starter-config"].parameters = 'allow_customer=10005';
window["twn-starter-config"].navigation.parameters = 'allow_customer=10005';
Read more about Use request parameters in Tweakwise JS.
API
Use the tn_parameters
option to filter on the current customer for navigation
and navigation-search
endpoints:
/navigation-search/{instancekey}/?tn_parameters=allow_customer%3D10005
/navigation-search/{instancekey}/?tn_parameters=allow_customer%3D10005
Read more about Use request parameters in Tweakwise API.
Updated 8 days ago