From eaa1d18788f7f97a75e0349b2b9f453364830787 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Mon, 7 Aug 2017 20:06:08 +0000 Subject: [PATCH] Assigns a value if transaction tests true for membership discount. --- js/transaction.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index 74c1ff6..d62439a 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -783,7 +783,7 @@ $(function() { } }); - } + } // end Volunteer benefits }); // show original price @@ -807,12 +807,23 @@ $(function() { $("#redeemable_hours").val(0); }); + + // membership transaction? + var membership_transaction = false, membership_transaction_obj; + $.post("json/transaction.php", { transaction_benefits: 1 }, function (data) { + membership_transaction_obj = $.parseJSON(data); + if ( membership_transaction_obj.transactions_with_membership_benefits[$("#transaction_type").val()] === true ) { + membership_transaction = true; + } + }); // membership transaction? + sold_to.change(function() { if (this.value !== "no_selection") { var expiration_date; // Is this a paid member? + // Determine membership benefits of current transaction $.post("json/transaction.php", { membership_benefits: 1, contact_id: this.value }, function (data) { var obj = $.parseJSON(data); @@ -1021,9 +1032,15 @@ $(function() { } // Membership benefits - for (var n in obj.transactions_with_membership_benefits) { - //console.log(obj.transactions_with_volunteer_benefits[n]); - } + /* + if ( obj.transactions_with_membership_benefits[$("#transaction_type").val()] === true ) { + if ($("#redeemable_hours").data("ui-spinner")) + + } else { + if ($("#redeemable_hours").data("ui-spinner")) + + } + */ });