Merchandising

💡

Level Medium

For this functionality you need to have a subscription of Level Medium or higher.

The Tweakwise Search & Merchandising Plugin can take over entire pages in your platform and show a Tweakwise product lister page instead.

Installation

Make sure you have followed the Installation guide.

Out of the box, Tweakwise JS will start looking for an input, output and start initializing the plugin.

💡

If you need more control, see Manual initialization

Implementation

Enabling the product lister page is as easy as adding a couple of lines of JavaScript code. To do this, we need to extend the twn-starter-config configuration object.

<script>
  window['twn-starter-config'] = window['twn-starter-config'] || {};
  window['twn-starter-config'].navigation = window['twn-starter-config'].navigation || {};
  window['twn-starter-config'].navigation.cid = "CID"
</script>

In the snippet above the CID needs to be replaced with the ID of the category you want to show. This ID should be known in Tweakwise, as provided through the feed or Backend API.

In case you don't want to show a product lister page, the "CID" can be set to null or undefined. This is useful on for example the home page.

When configured correctly, Tweakwise JS will replace the output container with a product lister page for the specified category. This will happen immediately after the HTML page is loaded.

Good to know

  • Merchandising is part of Level Medium or higher.
  • We recommend adding this snippet above the snippet that imports Tweakwise JS. This makes sure that the config is taken into consideration when initializing the plugin.
  • By default the product lister page will use the same output as the search results. If you want to use a different output container for the product lister page, this can be configured in the settings of the Search & Merchandising module.