Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
You need to consider different kind of currency in your script: if someone is using Euros (€) it will not work.
I just replaced all occurrences of '$' with the variable CURRENCY and now the script works.
Example:
ORIGINAL:
function formatPrice2(text){
return parseFloat(text.substring(text.indexOf('$') + 1));
}
MODIFIED:
//var CURRENCY = '$' ;
var CURRENCY = '€' ;
[...]
function formatPrice2(text){
return parseFloat(text.substring(text.indexOf(CURRENCY) + 1));
}
I wrote an implementation that does this, but grabs the currency from AliExpress itself:
https://gist.github.com/Biotronic/7afca676b5f6c48ca1f26cb797fcda60
Feel free to use the above code, though there may be some rough edges.