Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

There are tens of recommendation methods(alternative products, basket recommendations etc) can be used on different pages of your web site.

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

Different recommendation methods require different parameters like Category Top Sellers needs the category code as a parameter where as 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; navigate to Personalize > Widgets on the Visilabs panel. You should see the list of widgets as below.

 

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

 

Please do not forget that widget only returns a recommended product array and you need to implement it according to your standards to display the recommendations on your web site.

Examle Usage
<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
List of Attributes
"title": "Product Name",
"img": "Product Image URL",
"code": "Product Code",
"target": "_self",
"dest_url": "www.website.com/prodpage?OM.zn=widget_adi&OM.zpc=productcode",
"brand": "product brands",
"price": 18.5000, // original price of product
"dprice": 9.0000, // discounted price of product
"cur": "USD", // original price currency
"rating": 0, // customer rating of product
"comment": 0, // number of comments by customers 
"freeshipping": false, // 
"samedayshipping": false, 
"attr1": "", // product attribute (can be anything like color,size)
"attr2": "",
"attr3": "",
"attr4": "",
"attr5": ""
  • No labels