jeffharrell / minicart

The minicart is a great way to improve your PayPal shopping cart integration.
MIT License
501 stars 211 forks source link

will not accept comma in cart #308

Open ianwilliams7158 opened 5 years ago

ianwilliams7158 commented 5 years ago

Hi

I have several thousand products in my database and many of them are above £1000, resulting in a comma, ie £1,999.99.

When this is passed to minicart, it displays NaN and will not process forward. Any amount under £1000, and therefore not using a comma goes through perfectly and I can checkout as expected.

How can I force the minicart to accept the comma? I know paypal understands them as I'm using the exact same code as on my test site that does not have minicart installed and amounts over £1000 go through successfully.

Can anyone help?

robliberty commented 5 years ago

Add in a quick jQuery replace function to strip the commas before passing to cart

var noCommas = $('.money').text().replace(/,/g, '');

ianwilliams7158 commented 5 years ago

perfect! thanks very much :)