Custom recommender allows you to create a recommender based on any logic of your choice. We created this feature to enable every shop to maximize their deep understand of their customer market and their products to help customers make the best purchase decision possible.


You can create arbitrary input fields for the user to field out, and then set up custom logic to make the final size recommendation. 


First, open the custom recommender editor:



The following is the recommender creation view. 



1. Name of the recommender. It will show up as the header of the recommender

2. Preview of the recommender steps

3. Button to add new recommender step

4. Editor for the currently selected recommender step. 


Basic concepts

The custom recommender is made of recommender steps.  If you click on "Add recommender step", you can see the following:


Number input and Select Input are input steps that user can put in information. Math Formula and Switch Formula steps that can make calculation using the values from inputs steps. 


1. Number input

This creates an number input field. You can use this to gather certain information from the user like weight, height, chest measurement, etc. You can also select a unit for this input, and the app would automatically display the unit toggle button.

Editor 

What it looks like to the user.


2. Select Input

This input step allows you to ask user to select from a list of options. Click on "Add new option" to add new options to the list. There are also 2 display types as you can see from the screenshot below.

Editor


Selector display type

What "Radio" display looks like 

What "dropdown" display looks like



Selector condition to display

This allows the select input to show up ONLY when certain conditions are met. For example, you can have a shoe size recommender where it first has a select input for gender (male or female), and then you have 2 select inputs (male sizes, and female sizes). You can set it up so that male size select input only shows up if gender is selected as male. 


For example: the condition is set to #1 == "female", so only when the first selector's value is "female" would the female sizes selector show up. 



3. Math Result

The results from number input and select input can be used to calculate the size. In Math result, you can reference the values and then apply and arbitrary formula. You use "#1" to reference the value from the first element. 


Some examples are if your final size recommendation requires addition or subtraction of different measurements, then using Math results can be useful.

Editor


On the left of each element, there is a number. Use this in result element.


4. Switch Result

Finally, switch results gives you the ultimate flexibility to recommend the size. In the "IF" condition input box, you can put any condition using the results from previous elements. You can use any valid javascript function inside the expression.



Referencing values from previous elements:

On the Preview, you can see black arrows referring to each recommender step. You can use the number (#1, #2, #3, etc) to refer to the values from the recommender step. Note that you can only use recommender steps before the current step.

IF expressions

You can use any valid javascript functions as well.

Example conditionMeaning
#1 < 10Result from element 1 is less than 10
#1 < 10 && #2 < 20Result from element 1 is less than 10 AND result from element 2 is less than 20
#1 < 10 || #2 < 20Result from element 1 is less than 10 OR result from element 2 is less than 20
#1 == "male"Result from element 1 is "male". (we use quotation if the result value is not a number)