Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are tens of various recommendation methods widgets (ex: alternative products, basket recommendations, etc..) that can be used on across different pages of on your web sitewebsite.

In technical terms a widget is a javascript snippet which that requests an array of recommended products from Visilabs the RMC servers depending on the recommendation algorithm and the specific visitor/usercustomer.

Different recommendation methods widgets require different parameters like "Category Top Sellers" needs the category code as a parameter where as whereas an "Alternative Products" widget needs the product being viewed as a parameter. This causes slight differences between the implementation of widgets.

To get the javascript code for your specific widget; visit Personalize > Widgets. You should see the list of widgets as shown below.:

 

Click on Edit next to the Widget Name that you would like to get the code for. You will see a screen similar to the one shown below. The template code is on the bottom part of the screen. Just copy the code and paste it to the specific page.

 

Warning

Please do Do not forget that widget only returns a recommended product array and you need to implement it according to your standards requirements in order to display the relevant recommendations on your web sitewebsite.

Code Block
languagejs
titleExample Usage
linenumberstrue
<script>
var vl = new Visilabs();
vl.AddParameter("json",true);
vl.Suggest(1,null,null,TopSellers);
function TopSellers(dataArr){
if (dataArr.length>0){
$.each(dataArr,function(index,element){
$("#content").append("<div><a href='"+element.dest_url+"'>
<img src='"+element.img+"'></a>"+
"<p>Title: "+element.title+"</p>+
"<p>Org.Fiyat"+element.price+"</p>"+
"<p>Disc.Fiyat"+element.dprice+"</p></div>");
});
}
</script

...