In Tweakwise, you’re able to pass hidden filters to almost every request that returns products (see API - Use hidden filters).
This functionality is useful for pages where you want to show a default subset of products:
- Include: brand pages, specific categories.
- Exclude: show regular catalog except specificly marked products
Include
Use parameters
to only include products that match with the given attribute value(s).
Example: use this if you can't exclude items in your Tweakwise feed, e.g. only items that are in-stock.
Search
Use parameters
in the twn-starter-config
object to include specific products:
window["twn-starter-config"].parameters = 'in-stock=true';
or use parameters
in tweakwiseListerPage
method when using manual initialization:
tweakwiseListerPage({
output: '#tweakwise-output',
cid: '1',
parameters: 'in-stock=true'
});
Note: replace output
and cid
with the correct values.
Suggestions
Use the parameters
option in tweakwiseSuggestions
method, to include specific products:
window.tweakwiseSuggestions({
input: "INPUT",
instancekey: "INSTANCEKEY",
cid: "CID",
parameters: 'in-stock=true'
});
Note: replace input
, instancekey
and cid
with the correct values.
Merchandising
Use navigation.parameters
option to configure hidden filters for lister pages.
window["twn-starter-config"].navigation.parameters = 'in-stock=true&vip=true';
or use parameters
in tweakwiseListerPage
method when using manual initialization:
let listerPage = tweakwiseListerPage({
output: '#tweakwise-output',
cid: '1',
parameters: 'in-stock=true'
});
Note: replace output
and cid
with the correct values.
Exclude
Use parametersExcept
to only include products that match with the given attribute value(s).
Example: use this if you can't exclude items in your Tweakwise feed, e.g. for displaying a specific catalog for a user group.
Search
Use parametersExcept
in the twn-starter-config
object to exclude specific products:
window["twn-starter-config"].parametersExcept = 'segment=basic';
or use parameters
in tweakwiseListerPage
method when using manual initialization:
tweakwiseListerPage({
output: '#tweakwise-output',
cid: '1',
parametersExcept: 'segment=basic'
});
Note: replace output
and cid
with the correct values.
Suggestions
Use the parameters
option in tweakwiseSuggestions
method, to exclude specific products:
window.tweakwiseSuggestions({
input: "INPUT",
instancekey: "INSTANCEKEY",
cid: "CID",
parametersExcept: 'segment=basic'
});
Note: replace input
, instancekey
and cid
with the correct values.
Merchandising
Use navigation.parameters
option to configure hidden filters for lister pages.
window["twn-starter-config"].navigation.parametersExcept = 'segment=basic';
or use parameters
in tweakwiseListerPage
method when using manual initialization:
let listerPage = tweakwiseListerPage({
output: '#tweakwise-output',
cid: '1',
parametersExcept: 'segment=basic'
});
Note: replace output
and cid
with the correct values.
Good to know
- Use the attribute URL name as the parameter names.
- Reach out to our support team, and we'll help mark the attributes you'd like to use as hidden filters in your instance.
- If multiple attributes are necessary, provide it in a regular URL format:
window["twn-starter-config"].parameters = 'in-stock=true&vip=true';