Commit 11b91993 authored by mattwire's avatar mattwire
Browse files

Add generic support for extensions that modify amount (eg. percentagepricesetfield and extrafee)

parent a476b463
......@@ -18,9 +18,13 @@
totalAmount += parseFloat($(this).data('amount'));
});
}
else if (typeof CRM.percentagepricesetfield !== 'undefined' && typeof CRM.percentagepricesetfield.calculateTotalFee === 'function') {
totalAmount = CRM.percentagepricesetfield.calculateTotalFee();
}
else if (typeof calculateTotalFee == 'function') {
// This is ONLY triggered in the following circumstances on a CiviCRM contribution page:
// - With a priceset that allows a 0 amount to be selected.
// - When we are the ONLY payment processor configured on the page.
// It is ALSO replaced by percentagepricesetfield and extrafee extensions
totalAmount = parseFloat(calculateTotalFee());
}
else if (document.getElementById('totalTaxAmount') !== null) {
totalAmount = parseFloat(this.calculateTaxAmount());
this.debugging(this.name, 'Calculated amount using internal calculateTaxAmount()');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment