Skip to content

Commit

Permalink
updates to ea pledge shim
Browse files Browse the repository at this point in the history
  • Loading branch information
tamw-wnet committed Jan 16, 2025
1 parent 47a00dc commit 32b2564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions assets/js/everyaction_pledge_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
$.each(shopping_cart, function( index, item ) {
pcodestring += item.pcode + ':' + item.quantity + '|';
var this_item_value = Number(item.quantity) * Number(item.required_amount);
premiumstring += item.title + ' | Premium Code: ' + item.pcode + ' | Price: $' + item.required_amount + ' | Quantity: ' + item.quantity + "\n" ;
premiumhtml += '<li><strong>' + item.title + '</strong> | Premium Code: ' + item.pcode + ' | Price: $' + item.required_amount + ' | Quantity: ' + item.quantity + "</li>" ;
premiumstring += item.title + ' Price: $' + item.required_amount + ' Quantity: ' + item.quantity + "\r\n" ;
premiumhtml += '<li><strong>' + item.title + '</strong> Price: $' + item.required_amount + ' Quantity: ' + item.quantity + "</li>" ;
required_donation_amount += this_item_value;
});
pcode_field.val(pcodestring);
premium_field.val(premiumstring);
$('.premium_list').html('<h4>Your order: <em><a href="/support/pledge-premiums/cart/">edit items</a></em></h4><ul>' + premiumhtml + '</ul><p class="contribution_message">Minimum contribution: $<span class="required_contribution">'+required_donation_amount+'</span></p>');
var formatted_required_donation_amount = required_donation_amount.toLocaleString();
$('.premium_list').html('<h4>Your order: <em><a href="/support/pledge-premiums/cart/">edit items</a></em></h4><ul>' + premiumhtml + '</ul><p class="contribution_message">Minimum contribution: $<span class="required_contribution">'+formatted_required_donation_amount+'</span></p>');
set_required_amount();
}

Expand Down Expand Up @@ -73,8 +74,9 @@
$("input[name='OtherAmount']").parent().prev().hide();
$("input[name='OtherAmount']").val(required_installment_amount);
} else {
var formatted_required_donation_amount = required_donation_amount.toLocaleString();
$("input[name='OtherAmount']").val(required_donation_amount);
$("span.required_contribution").html(required_donation_amount);
$("span.required_contribution").html(formatted_required_donation_amount);
$("input[name='OtherAmount']").parent().prev().hide();
}
$("input[name='OtherAmount']").attr("readonly", true);
Expand Down
2 changes: 1 addition & 1 deletion wnet-everyaction-wp-css-and-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WNET_EveryAction_WP_CSS_and_JS {
public $version;

public function __construct() {
$this->version = '2024.12.18';
$this->version = '2025.01.16';
/* use today's date in the line above in 'xxxx.xx.xx' format to make sure CloudFront is using this version.
* If including the script elsewhere, it is generally best to also include that date as a query string
*/
Expand Down

0 comments on commit 32b2564

Please sign in to comment.