JS is not my forte but there's something that needs done. The GTM code below is FB-related and takes price from the website. Problem is, the prices use a comma and they need a full stop.
How to adjust the code below so it swaps one for another?
<script>
requirejs(['jquery'], function( jQuery ) {
jQuery(".c-btn--pdp").click(function() {
if(jQuery(".c-product-size__selected-option").text() != ""){
var sku = jQuery(".product-info-stock-sku").find(".value").text();
var price = jQuery("[data-price-type='finalPrice']").find(".price").text().substring(2);
console.log("Added Product SKU: " + sku);
console.log("Added Product Price: " + price);
fbq('track', 'AddToCart', {
content_ids: sku,
content_type: 'product',
value: price,
currency: {{Currency}}
});
}
});
});
</script>