From b9cdc56ad6aea1f71f37cc1f682781e57949af06 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Tue, 24 May 2022 18:35:39 +0400 Subject: [PATCH] Convert the "," separator into "." before checking the price amount. --- .../js/modules/ContextBootstrap/SingleProductBootstap.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 8192be38f..3212cbdcc 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -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;