Skip to content
Snippets Groups Projects
Commit c4a671b5 authored by mattwire's avatar mattwire
Browse files

Change internal variable name in CRM.payment.getTotalAmount()

parent 166cbd03
No related branches found
No related tags found
No related merge requests found
......@@ -9,32 +9,32 @@
* @returns {number}
*/
getTotalAmount: function() {
var totalFee = 0.0;
var totalAmount = 0.0;
if (CRM.payment.isEventAdditionalParticipants()) {
totalFee = null;
totalAmount = null;
}
else if (document.getElementById('totalTaxAmount') !== null) {
totalFee = parseFloat(this.calculateTaxAmount());
totalAmount = parseFloat(this.calculateTaxAmount());
this.debugging(this.scriptName, 'Calculated amount using internal calculateTaxAmount()');
}
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 Stripe is the ONLY payment processor configured on the page.
totalFee = parseFloat(calculateTotalFee());
totalAmount = parseFloat(calculateTotalFee());
}
else if (this.getIsDrupalWebform()) {
// This is how webform civicrm calculates the amount in webform_civicrm_payment.js
$('.line-item:visible', '#wf-crm-billing-items').each(function() {
totalFee += parseFloat($(this).data('amount'));
totalAmount += parseFloat($(this).data('amount'));
});
}
else if (document.getElementById('total_amount')) {
// The input#total_amount field exists on backend contribution forms
totalFee = parseFloat(document.getElementById('total_amount').value);
totalAmount = parseFloat(document.getElementById('total_amount').value);
}
this.debugging(this.scriptName, 'getTotalAmount: ' + totalFee);
return totalFee;
this.debugging(this.scriptName, 'getTotalAmount: ' + totalAmount);
return totalAmount;
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment