Smartweb

Recommendations

Automate and personalise products on any page in Smartweb.

Clerk.io offers more than 23 different types of product logics, making it possible for you to display completely automated products on any page. This article explains how to get started when using a Clerk.js setup in Smartweb.

For our full Best Practices, read this article on which Recommendations to use.

Slider Setup #

Recommendations are created with Elements that reference a Design. Below is the basic guide for setting up an Element.

Following the steps in my.clerk.io > Settings > Setup Guides will automatically create the Elements for our Best Practices.

Create Design #

Recommendations are shown as a slider by default. This allows customers to see more products with fewer clicks. You can either use the Design Editor to configure it visually, or use code designs.

A design can be reused for any number of Recommendations elements you create.

Design Editor #

  1. Go to Recommendations > Designs and click New Design.
  2. Choose Product Slider
  3. From the list of design templates, choose the one you want to start with.
  4. Give it a name and click Create design.
  5. Make any changes you want to the design.

Code Design #

  1. Go to Recommendations > Designs and click New Design.
  2. Choose Other designs > Blank > Code.
  3. Give it a name and click Create design.
  4. Create a code design from scratch using Liquid code.

If you want a starting design, check the Slider template further down.

Create Element #

This contains all the settings used to display the Recommendations, and make it embeddable in your website. Follow these steps for each Recommendations banner you want to create.

  1. Go to Recommendations > Elements.
  2. Click New Element.
  3. Give it a descriptive name. We recommend naming it based on the page and logic you want to use. E.g., “Home Page / Visitor Recommendations”.
  4. In Element type, select the product logic you want to use from the dropdown. You can see an overview of all the product logics here.
  5. In Design select the design you created from the dropdown and choose the number of products you want to show.
  6. Click Save at the top of the screen.

Add to Website #

To add Clerk Recommendations on your website, you have two options: Injection and Embedded code.

  1. Open the Insert into website tab.
  2. Here you have two options:
    • Using injection allows you to insert the code by using a CSS selector.
    • Using embedded code allows you to insert the code into your website manually.
  3. Pick the option that is easiest for you to use.
  4. For some Logics you will see the Choose your platform dropdown. Select Smartweb in these cases. This will prefill the embedcode with the correct Smartweb shortcodes.

To add sync details or start a sync, go to my.clerk.io > Data > Configuration.

my.clerk.io Setup #

  1. Go to Recommendations > Elements.
  2. Select the element you want to insert.
  3. Open the Insert into website tab.
  4. Choose one of the following:
  5. For embedded code on Smartweb, typical placements and file names are:
    • Product page: modules > product > product-entity.tpl — set data-products to [{$product->Id}].
    • Category page: modules > product > product-list.tpl — set data-category to {$item->Id} and wrap with {if $field == 'search'}...{else}...{/if} to avoid showing on the Search Page.
    • Cart page: modules > cart > cart.tpl — set data-products to the cart product IDs (see example in our setup guide).
    • Homepage: insert in your homepage template/CMS block.

Pages #

Below are the specific pages where you should insert Recommendations, and which types you should use, in order to follow our Best Practices.

Homepage #

  1. In my.clerk.io, create 3 Elements with the following logics:
    • Visitor Recommendations
    • Bestsellers
    • Hot Products
  2. Insert the embedcodes to your homepage template/CMS block.

Category Page #

  1. In my.clerk.io, create an Element with the logic Bestsellers In Category.
  2. In the Insert into website > Choose your platform dropdown, select Smartweb, and copy the embedcode.
  3. Go to Smartweb’s theme files and find the file that generates your Category pages. This is most often modules > product > product-list.tpl.
  4. Insert the embedcode somewhere below the title and description. Set data-category to {$item->Id} and wrap with {if $field == 'search'}...{else}...{/if} to avoid showing on the Search Page.

Product Page #

  1. In my.clerk.io, create 2 Elements with the following logics:
    • Best Alternative Products
    • Best Cross-Sell Products
  2. In Insert into website > Choose your platform dropdown, select Smartweb for each of them and copy the embedcodes.
  3. In the Smartweb theme files, find the file that generates your product pages. This is most often modules > product > product-entity.tpl.
  4. Insert the embedcodes somewhere below the product description. Set data-products to [{$product->Id}].

Cart Page #

  1. In my.clerk.io, create an Element with the logic Best Cross-Sell Products.
  2. In the Insert into website > Choose your platform dropdown, select Smartweb, and copy the embedcode.
  3. Go to Smartweb’s theme files and find the file that generates your Cart pages. This is most often modules > cart > cart.tpl.
  4. Insert the embedcode somewhere below the cart items and checkout button. Set data-products to the cart product IDs.

After enabling the features, you will be able to see Clerk.io’s RECOMMENDATIONS function on your webshop.