From 1e29ab60f3ba24dabf6f7711d23bec06d53563da Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 13 Jun 2017 12:51:14 -0400 Subject: [PATCH] adding hidden product field to keep track of the actual total for the donation form adding one hidden product field which will act as a gateway to allow pay pal to collect the payment info, otherwise the total field alone isn't enough --- js/app.js | 11 +++++------ js/custom/donate.js | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/js/app.js b/js/app.js index 6283466..9cff42c 100644 --- a/js/app.js +++ b/js/app.js @@ -36,14 +36,11 @@ var g=a(f(this.selector(c),a("
").html(c.attr("title")).html())),h=thi total -= amount; total_input.children('#input_3_1').val(total.toFixed(2)); total_input.children( '.ginput_total' ).text('$' + total.toFixed(2)); + $('.gfield_hidden_product').last() + .find( $("[id^='ginput_base']") ).val('$' + total.toFixed(2)); } }); - - $(donate_fields).on('keyup', '.gfield_list_2_cell1 > input', function(){ -// get_amount( $(this)); - }); - - + $(donate_fields).on('blur', '.gfield_list_2_cell1 > input', function(){ var _ = $(this); var amount_input = page.find(".gfield_list_2_cell1").children(); @@ -65,6 +62,8 @@ var g=a(f(this.selector(c),a("
").html(c.attr("title")).html())),h=thi total = 0; } }); + $('.gfield_hidden_product').last() + .find( $("[id^='ginput_base']") ).val('$' + total.toFixed(2)); }); }); });;// Load foundation diff --git a/js/custom/donate.js b/js/custom/donate.js index c3c7e6b..bdc7db2 100644 --- a/js/custom/donate.js +++ b/js/custom/donate.js @@ -27,14 +27,11 @@ $(function(){ total -= amount; total_input.children('#input_3_1').val(total.toFixed(2)); total_input.children( '.ginput_total' ).text('$' + total.toFixed(2)); + $('.gfield_hidden_product').last() + .find( $("[id^='ginput_base']") ).val('$' + total.toFixed(2)); } }); - - $(donate_fields).on('keyup', '.gfield_list_2_cell1 > input', function(){ -// get_amount( $(this)); - }); - - + $(donate_fields).on('blur', '.gfield_list_2_cell1 > input', function(){ var _ = $(this); var amount_input = page.find(".gfield_list_2_cell1").children(); @@ -56,6 +53,8 @@ $(function(){ total = 0; } }); + $('.gfield_hidden_product').last() + .find( $("[id^='ginput_base']") ).val('$' + total.toFixed(2)); }); }); }); \ No newline at end of file -- 2.17.1