Untitled
unknown
plain_text
2 years ago
1.4 kB
20
Indexable
jQuery(document).ready(function($) {
if ($('body').hasClass('home')) {
let priceElements = $('.jet-woo-product-price');
priceElements.slice(0, 3).each(function() {
let priceText = $(this).find('ins span.woocommerce-Price-amount').text().trim();
let DispriceText = $(this).find('del span.woocommerce-Price-amount').text().trim();
switch (priceText) {
case '$3,915':
$(this).find('ins span.woocommerce-Price-amount').text('$9,135');
break;
case '$1,380':
$(this).find('ins span.woocommerce-Price-amount').text('$4,600');
break;
case '$2,865':
$(this).find('ins span.woocommerce-Price-amount').text('$7,640');
break;
}
switch (DispriceText) {
case '$5,500':
$(this).find('del span.woocommerce-Price-amount').text('$26,100');
break;
case '$1,840':
$(this).find('del span.woocommerce-Price-amount').text('$9,200');
break;
case '$3,900':
$(this).find('del span.woocommerce-Price-amount').text('$19,100');
break;
}
});
}
});
Editor is loading...