adding hidden product field to keep track of the actual total for the donation form
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 13 Jun 2017 16:51:14 +0000 (12:51 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 13 Jun 2017 16:51:14 +0000 (12:51 -0400)
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
js/custom/donate.js

index 6283466..9cff42c 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -36,14 +36,11 @@ var g=a(f(this.selector(c),a("<div></div>").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("<div></div>").html(c.attr("title")).html())),h=thi
                     total = 0;
                 }
             });
+            $('.gfield_hidden_product').last()
+                .find( $("[id^='ginput_base']") ).val('$' + total.toFixed(2));
         });
     });
 });;// Load foundation
index c3c7e6b..bdc7db2 100644 (file)
@@ -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