Convert the "," separator into "." before checking the price amount.

This commit is contained in:
Narek Zakarian 2022-05-24 18:35:39 +04:00
parent d4c7dc6b6b
commit b9cdc56ad6

View file

@ -51,6 +51,8 @@ class SingleProductBootstap {
else if (document.querySelector('.product .woocommerce-Price-amount')) {
priceText = document.querySelector('.product .woocommerce-Price-amount').innerText;
}
priceText = priceText.replace(/,/g, '.');
const amount = parseFloat(priceText.replace(/([^\d,\.\s]*)/g, ''));
return amount === 0;