Customers Also Bought
2 min
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
Klevu can power a recommendation banner showcasing any products which other customers also purchased, in addition to the current product. The most common placements for this banner type are:
Cart: Customers Also Bought Show a recommendation banner with products other customers also purchased from the store.
Product Page: Customers Also Bought Show a recommendation banner with products other customer bought together with the product currently being viewed.
Customers Also Bought Product Recommendations
The end-point is used for retrieving customers also bought product recommendations.
POST
https://eucs19v2.ksearchnet.com/cs/v2/search
var data = JSON.stringify({"recordQueries":[{"id":"recsAlsoBought","typeOfRequest":"RECS_ALSO_BOUGHT","settings":{"context":{"recentObjects":[{"typeOfRecord":"KLEVU_PRODUCT","records":[{"id":34322443665539},{"id":34322633916547}]}]},"typeOfRecords":["KLEVU_PRODUCT"]}}],"context":{"apiKeys":["klevu-158755634955912036"]}});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://eucs19v2.ksearchnet.com/cs/v2/search");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Try it here!