const key = "rzp_live_D73fj3IZiNVVC6";
const amount = parseFloat("2124s") * 100;
addEventListener("load",
function() {
const widgetConfig = {
"key": key,
"amount": amount,
"theme": {
"color": "#8BBFFF"
},
"features": {
"offers": {
"list": [],
}
},
"display": {
"offers": true,
"emi": true,
"cardlessEmi": true,
"paylater": true,
"widget": {
"main": {
"heading": {
"color": "black",
"fontSize": "10px"
},
"content": {
"color": "grey",
"fontSize": "10px"
},
"link": {
"color": "blue",
"fontSize": "10px"
},
"footer": {
"color": "grey",
"fontSize": "10px",
"darkLogo": true// true is default show black text rzp logo
}
}
}
}
};
const rzpAffordabilitySuite = new RazorpayAffordabilitySuite(widgetConfig);
rzpAffordabilitySuite.render();
});
jQuery(function($) {
$.fn.myFunction = function()
{
var variants = (document.querySelector("form.variations_form").dataset.product_variations);
var selectedVariantID = document.querySelector("input.variation_id").value;
var selectedVariant = JSON.parse(variants).filter( variant => variant.variation_id === parseInt(selectedVariantID));
if(typeof(selectedVariant[0]) != "undefined")
{
amt = selectedVariant[0].display_price * 100;
const widgetConfig = {
"key": key,
"amount": amt,
"theme": {
"color": "#8BBFFF"
},
"features": {
"offers": {
"list": [],
}
},
"display": {
"offers": true,
"emi": true,
"cardlessEmi": true,
"paylater": true,
"widget": {
"main": {
"heading": {
"color": "black",
"fontSize": "10px"
},
"content": {
"color": "grey",
"fontSize": "10px"
},
"link": {
"color": "blue",
"fontSize": "10px"
},
"footer": {
"color": "grey",
"fontSize": "10px",
"darkLogo": true// true is default show black text rzp logo
}
}
}
}
};
const rzpAffordabilitySuite = new RazorpayAffordabilitySuite(widgetConfig);
rzpAffordabilitySuite.render();
}
}
$("input.variation_id").change(function(){
$.fn.myFunction();
});
});
Reviews
There are no reviews yet.