Script 01
Script 01
Script 01
matches) {
window.onscroll = function() {
var pageOffset = document.documentElement.scrollTop ||
document.body.scrollTop,
btn = document.getElementById('scrollToTop');
if (btn) btn.style.display = pageOffset > 1200 ? 'block' : 'none';
}
}
function updateVariantData() {
var queryString = window.location.search;
var urlParams = new URLSearchParams(queryString);
var productDataJSON = JSON.parse($("body").find("[data-product-json]").html());
var variantData = productDataJSON.product;
if(urlParams.has('variant')){
var selectedVariantId = urlParams.get('variant');
productDataJSON.product.variants.forEach(function(e) {
if(e.id == selectedVariantId) {
variantData = e;
}
});
}
if($('#installmentsContainer').length){
var installmentsContainer = $('#installmentsContainer');
var installmentsOptions = '';
function getRate(installments){
let rates = {
'7' : 1.1472,
'8' : 1.1623,
'9' : 1.1769,
'10' : 1.1865,
'11' :1.2012,
'12' : 1.2161
};
return rates[installments] ?? 1;
}
$(document).ready(function() {
var $buttonPlus = $('.qtyplus');
var $buttonMin = $('.qtyminus');
var $quantity = $('.qty');
$buttonMin.click(function() {
$quantity.val(Math.max(parseInt($quantity.val()) - 1, 0)).trigger('input');
});
})