mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Merge pull request #655 from woocommerce/PCP-694-smart-button-not-visible-on-single-product-page
Convert the "," separator into "." before checking the price amount.
This commit is contained in:
commit
4ff581a5f7
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,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