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 these issues, we introduced "hidden filters". 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.
- Contact us to configure the attribute as hidden filter.
- Use the hidden filter in your platform to show products for the current customer.
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:
Implementation
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 hidden filters 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 hidden filters in Tweakwise API.
Updated 17 days ago