1. Make sure you have a section file called "customproductbuilder.liquid" in your theme files. If you don't have one, please add it by following the steps in this article.
2. You also need to make sure to add the script tag and jQuery into the customproductbuilder.liquid file:
3. In the "customproductbuilder.js" asset file, please paste this code (if you don't have such a file, please create it):
jQuery(function($) {
var oldPrice = window.comparePrice;
var basePrice = window.currentPrice / 100;
function waitForCPB() {
if($('.cpb-panels-container').length) {
initChanges();
} else {
requestAnimationFrame(waitForCPB);
}
}
waitForCPB();
function initChanges() {
changePriceSign();
}
function changePriceSign() {
var priceWrapper = $('.cpb-product-price');
var price = priceWrapper[0].querySelector('span');
price.innerText = price.innerText.replace(',', '.');
var config = {
characterData: true,
subtree: true
}
var observer = new MutationObserver(function() {
price.innerText = price.innerText.replace(',', '.');
}.bind(this));
observer.observe(price, config);
}
});
If you are using an older 1.0 theme, please refer to this article.
Comments
0 comments
Please sign in to leave a comment.