mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Convert the "," separator into "." before checking the price amount.
This commit is contained in:
parent
d4c7dc6b6b
commit
b9cdc56ad6
1 changed files with 2 additions and 0 deletions
|
@ -51,6 +51,8 @@ class SingleProductBootstap {
|
||||||
else if (document.querySelector('.product .woocommerce-Price-amount')) {
|
else if (document.querySelector('.product .woocommerce-Price-amount')) {
|
||||||
priceText = document.querySelector('.product .woocommerce-Price-amount').innerText;
|
priceText = document.querySelector('.product .woocommerce-Price-amount').innerText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priceText = priceText.replace(/,/g, '.');
|
||||||
const amount = parseFloat(priceText.replace(/([^\d,\.\s]*)/g, ''));
|
const amount = parseFloat(priceText.replace(/([^\d,\.\s]*)/g, ''));
|
||||||
return amount === 0;
|
return amount === 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue