Showing all 2 results
document.addEventListener('DOMContentLoaded', function() {
// Replace 0,00 EUR prices with "Precio a consultar"
var priceElements = document.querySelectorAll('.woocommerce-Price-amount, .price .amount');
priceElements.forEach(function(el) {
var text = el.textContent.trim();
if (text.match(/^0[,.]00/)) {
el.closest('.price') ? el.closest('.price').innerHTML = 'Precio a consultar<\/span>' : el.innerHTML = 'Precio a consultar<\/span>';
}
});
// Also check .price wrappers directly
document.querySelectorAll('.price').forEach(function(el) {
if (el.textContent.trim().match(/^0[,.]00/)) {
el.innerHTML = 'Precio a consultar<\/span>';
}
});
});