AI Skincare Advisor
Note: To use the sample code snippet for your cart URL during checkout and as a landing page after closing Revieve solution, you need to replace the existing URL with your own. Additionally, it is recommended that you remove the console.log statements in the production version of the code as they are only meant for testing purposes.
paperclip Related articles
For step-to-step Klaviyo integration with Revieve solution in Shopify.
onClose: function (data) {
// User closed modal. Here you could forward them to checkout if they had
// added products (onAddToCart was called before).
return
console.log("close" + data);
Revieve.API.hide();
},
onDisplayProducts: (data) => {
Revieve.API.getAdvisorData((data) => {
console.log('onDisplayProducts', data);
//Given_Properties = data;
});
},
onSendEmail: function (data) {
console.log(data);
},
onCheckout: function (data) {
// User clicked the checkout button that is visible on results page
// after adding one or more products to cart. Redirect to checkout page?
return window.location.assign("https://myrevieve.myshopify.com/cart"); //assign your cart address
},
onClickProduct: function (product) {
// To be filled in by skincaredemo.
console.log("User clicked info action.");
console.log(product);
var win = window.open(product.url, '_blank');
win.focus();
},
};
(function () {
var rv = document.createElement('script');
rv.src = 'https://d38knilzwtuys1.cloudfront.net/revieve-plugin-v4/revieve-plugin-loader.js';
rv.charset = 'utf-8';
rv.type = 'text/javascript';
rv.async = 'true';
rv.onload = rv.onreadystatechange = function () {
var rs = this.readyState;
if (rs && rs != 'complete' && rs != 'loaded') return;
Revieve.Init(config, function () {
// Comment out the below line if you want to open the modal
// manually when user clicks a certain button or navigates
// to certain page.
Revieve.API.show();
});
};
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(rv, s);
})();