The change function is not firing to the console after I change the value in the dropdown. When I apply the code in the console and run it, changed!! logs without any problem. What could be the cause of this?
jQuery( document ).ready(function() {
/* Watch for changes in UITVERKOCHT for 50m and 100m pages and change the text */
if(window.location.href.indexOf("prikkabel-50-meter") > -1 || window.location.href.indexOf("prikkabel-100-meter") > -1){
console.log('window location true');
jQuery('#aantal-fittingen').change(function(){
console.log('changed!!');
if(jQuery('.woocommerce-variation-availability > p').text() === "Uitverkocht"){
jQuery('.woocommerce-variation-availability > p').text('Beschikbaar');
}
});
}
});
This is the page when I would like this code to work: https://pkled.wpstagecoach.com/product/prikkabel-50-meter/