function changeAddToCartProductId(){
let getCheckBoxs = document.querySelectorAll('input[name="product_id"]');
let getAddToCartBtn = document.querySelector('.single_add_to_cart_button ');
if( null == getCheckBoxs || null == getAddToCartBtn){
return false;
}
getCheckBoxs.forEach(function(radio) {
radio.addEventListener('change', function() {
if (this.checked) {
let productId = this.value;
// console.log(productId);
getAddToCartBtn.setAttribute("value", productId);
getAddToCartBtn.classList.add("ajax_add_to_cart add_to_cart_button");
}
});
});
}
changeAddToCartProductId();
document.addEventListener("DOMContentLoaded", function () {
let navbar = document.querySelector(".page-id-2415 .main-nav");
if (navbar) {
window.addEventListener("scroll", function () {
navbar.classList.toggle("nav-bg-green", window.scrollY > 10);
});
}
});