Easy Digital Downloads - Version 2.8.1

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.8.1
Comparing to
See all releases

Code changes from version 2.8 to 2.8.1

assets/js/edd-ajax.js CHANGED
@@ -93,26 +93,6 @@ jQuery(document).ready(function ($) {
93
  return false;
94
  });
95
 
96
- // Update button price with quantity
97
- $(document.body).on('change', '.edd-item-quantity', function() {
98
- var target = $(this).parent().next('.edd_purchase_submit_wrapper').find('.edd-add-to-cart');
99
- var price = target.data('price');
100
-
101
- // Determine the number of decimal places currently being displayed
102
- var decimals = 0;
103
- if ( price.toString().indexOf(edd_scripts.decimal_separator)) {
104
- var parts = price.toString().split(edd_scripts.decimal_separator);
105
- if ('undefined' !== typeof parts[1]) {
106
- decimals = parts[1].length;
107
- }
108
- }
109
-
110
- var new_price = $(this).val() * price;
111
- new_price = new_price.toFixed(decimals);
112
- new_price = String(new_price).split("").reverse().join("").replace(/(\d{3}\B)/g, "$1" + edd_scripts.thousands_separator).split("").reverse().join("");
113
- target.find('.edd-add-to-cart-label .edd-purchase-button-price-text').text(new_price);
114
- });
115
-
116
  // Send Add to Cart request
117
  $(document.body).on('click.eddAddToCart', '.edd-add-to-cart', function (e) {
118
 
93
  return false;
94
  });
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  // Send Add to Cart request
97
  $(document.body).on('click.eddAddToCart', '.edd-add-to-cart', function (e) {
98
 
assets/js/edd-ajax.min.js CHANGED
@@ -1 +1 @@
1
- function edd_load_gateway(e){jQuery(".edd-cart-ajax").show(),jQuery("#edd_purchase_form_wrap").html('<span class="edd-loading-ajax edd-loading"></span>');var d=edd_scripts.ajaxurl;d+=d.indexOf("?")>0?"&":"?",d=d+"payment-mode="+e,jQuery.post(d,{action:"edd_load_gateway",edd_payment_mode:e},function(d){jQuery("#edd_purchase_form_wrap").html(d),jQuery(".edd-no-js").hide(),jQuery("body").trigger("edd_gateway_loaded",[e])})}var edd_scripts;jQuery(document).ready(function(e){function d(){var d,t=e(this),a="undefined"!=typeof edd_global_vars,r="card_state";if("edd_address_country"==e(this).attr("id")&&(r="edd_address_state"),"card_state"!=t.attr("id")){var i={action:"edd_get_shop_states",country:t.val(),field_name:r};e.ajax({type:"POST",data:i,url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(r){d=a?e("#edd_purchase_form"):t.closest("form");var i='input[name="card_state"], select[name="card_state"], input[name="edd_address_state"], select[name="edd_address_state"]';if("nostates"==e.trim(r)){var o='<input type="text" name="card_state" class="card-state edd-input required" value=""/>';d.find(i).replaceWith(o)}else d.find(i).replaceWith(r);a&&e(document.body).trigger("edd_cart_billing_address_updated",[r])}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){a&&recalculate_taxes()})}else a&&recalculate_taxes();return!1}if(e(".edd-no-js").hide(),e("a.edd-add-to-cart").addClass("edd-has-js"),e(document.body).on("click.eddRemoveFromCart",".edd-remove-from-cart",function(d){var t=e(this),a=t.data("cart-item"),r=t.data("action"),i=t.data("download-id"),o={action:r,cart_item:a};return e.ajax({type:"POST",data:o,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){if(d.removed){if(parseInt(edd_scripts.position_in_cart,10)===parseInt(a,10)||edd_scripts.has_purchase_links)return window.location=window.location,!1;e(".edd-cart").each(function(){e(this).find("[data-cart-item='"+a+"']").parent().remove()}),e(".edd-cart").each(function(){var d=0;e(this).find("[data-cart-item]").each(function(){e(this).attr("data-cart-item",d),d+=1})}),e("[id^=edd_purchase_"+i+"]").length&&(e("[id^=edd_purchase_"+i+"] .edd_go_to_checkout").hide(),e("[id^=edd_purchase_"+i+"] a.edd-add-to-cart").show().removeAttr("data-edd-loading"),"1"==edd_scripts.quantities_enabled&&e("[id^=edd_purchase_"+i+"] .edd_download_quantity_wrapper").show()),e("span.edd-cart-quantity").text(d.cart_quantity),e(document.body).trigger("edd_quantity_updated",[d.cart_quantity]),edd_scripts.taxes_enabled&&(e(".cart_item.edd_subtotal span").html(d.subtotal),e(".cart_item.edd_cart_tax span").html(d.tax)),e(".cart_item.edd_total span").html(d.total),0==d.cart_quantity&&(e(".cart_item.edd_subtotal,.edd-cart-number-of-items,.cart_item.edd_checkout,.cart_item.edd_cart_tax,.cart_item.edd_total").hide(),e(".edd-cart").each(function(){var d=e(this).parent();d&&(d.addClass("cart-empty"),d.removeClass("cart-not-empty")),e(this).append('<li class="cart_item empty">'+edd_scripts.empty_cart_message+"</li>")})),e(document.body).trigger("edd_cart_item_removed",[d])}}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){}),!1}),e(document.body).on("change",".edd-item-quantity",function(){var d=e(this).parent().next(".edd_purchase_submit_wrapper").find(".edd-add-to-cart"),t=d.data("price"),a=0;if(t.toString().indexOf(edd_scripts.decimal_separator)){var r=t.toString().split(edd_scripts.decimal_separator);"undefined"!=typeof r[1]&&(a=r[1].length)}var i=e(this).val()*t;i=i.toFixed(a),i=String(i).split("").reverse().join("").replace(/(\d{3}\B)/g,"$1"+edd_scripts.thousands_separator).split("").reverse().join(""),d.find(".edd-add-to-cart-label .edd-purchase-button-price-text").text(i)}),e(document.body).on("click.eddAddToCart",".edd-add-to-cart",function(d){d.preventDefault();var t=e(this),a=t.closest("form");t.prop("disabled",!0);var r=(t.find(".edd-loading"),t.closest("div"));t.attr("data-edd-loading","");var a=t.parents("form").last(),i=t.data("download-id"),o=t.data("variable-price"),n=t.data("price-mode"),c=[],s=!0;if("yes"==o)if(a.find(".edd_price_option_"+i+'[type="hidden"]').length>0)c[0]=e(".edd_price_option_"+i,a).val(),a.find(".edd-submit").data("price")&&a.find(".edd-submit").data("price")>0&&(s=!1);else{if(!a.find(".edd_price_option_"+i+":checked",a).length)return t.removeAttr("data-edd-loading"),alert(edd_scripts.select_option),d.stopPropagation(),t.prop("disabled",!1),!1;a.find(".edd_price_option_"+i+":checked",a).each(function(d){if(c[d]=e(this).val(),!0===s){var t=e(this).data("price");t&&t>0&&(s=!1)}})}else c[0]=i,t.data("price")&&t.data("price")>0&&(s=!1);if(s&&a.find(".edd_action_input").val("add_to_cart"),"straight_to_gateway"==a.find(".edd_action_input").val())return a.submit(),!0;var _=t.data("action"),l={action:_,download_id:i,price_ids:c,post_data:e(a).serialize()};return e.ajax({type:"POST",data:l,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){var c="1"==edd_scripts.redirect_to_checkout,s="1"==a.find("#edd_redirect_to_checkout").val();if(c&&s||!c&&s)window.location=edd_scripts.checkout_page;else{"1"===edd_scripts.taxes_enabled&&(e(".cart_item.edd_subtotal").show(),e(".cart_item.edd_cart_tax").show()),e(".cart_item.edd_total").show(),e(".cart_item.edd_checkout").show(),e(".cart_item.empty").length&&e(".cart_item.empty").hide(),e(".widget_edd_cart_widget .edd-cart").each(function(t){var a=e(this).find(".edd-cart-meta:first");e(d.cart_item).insertBefore(a);var r=e(this).parent();r&&(r.addClass("cart-not-empty"),r.removeClass("cart-empty"))}),"1"===edd_scripts.taxes_enabled&&(e(".edd-cart-meta.edd_subtotal span").html(d.subtotal),e(".edd-cart-meta.edd_cart_tax span").html(d.tax)),e(".edd-cart-meta.edd_total span").html(d.total);e(".edd-cart-item-title",d.cart_item).length;if(e("span.edd-cart-quantity").each(function(){e(this).text(d.cart_quantity),e(document.body).trigger("edd_quantity_updated",[d.cart_quantity])}),"none"==e(".edd-cart-number-of-items").css("display")&&e(".edd-cart-number-of-items").show("slow"),("no"==o||"multi"!=n)&&(e("a.edd-add-to-cart",r).toggle(),e(".edd_go_to_checkout",r).css("display","inline-block")),"multi"==n&&t.removeAttr("data-edd-loading"),e(".edd_download_purchase_form").length&&("no"==o||!a.find(".edd_price_option_"+i).is("input:hidden"))){var _=e('.edd_download_purchase_form *[data-download-id="'+i+'"]').parents("form");e("a.edd-add-to-cart",_).hide(),"multi"!=n&&_.find(".edd_download_quantity_wrapper").slideUp(),e(".edd_go_to_checkout",_).show().removeAttr("data-edd-loading")}"incart"!=d&&(e(".edd-cart-added-alert",r).fadeIn(),setTimeout(function(){e(".edd-cart-added-alert",r).fadeOut()},3e3)),t.prop("disabled",!1),e(document.body).trigger("edd_cart_item_added",[d])}}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){}),!1}),e("#edd_checkout_form_wrap").on("click",".edd_checkout_register_login",function(){var d=e(this),t={action:d.data("action")};return e(".edd-cart-ajax").show(),e.post(edd_scripts.ajaxurl,t,function(d){e("#edd_checkout_login_register").html(edd_scripts.loading),e("#edd_checkout_login_register").html(d),e(".edd-cart-ajax").hide()}),!1}),e(document).on("click","#edd_purchase_form #edd_login_fields input[type=submit]",function(d){d.preventDefault();var t=e(this).val();e(this).val(edd_global_vars.purchase_loading),e(this).after('<span class="edd-loading-ajax edd-loading"></span>');var a={action:"edd_process_checkout_login",edd_ajax:1,edd_user_login:e("#edd_login_fields #edd_user_login").val(),edd_user_pass:e("#edd_login_fields #edd_user_pass").val()};e.post(edd_global_vars.ajaxurl,a,function(d){"success"==e.trim(d)?(e(".edd_errors").remove(),window.location=edd_scripts.checkout_page):(e("#edd_login_fields input[type=submit]").val(t),e(".edd-loading-ajax").remove(),e(".edd_errors").remove(),e("#edd-user-login-submit").before(d))})}),e("select#edd-gateway, input.edd-gateway").change(function(d){var t=e("#edd-gateway option:selected, input.edd-gateway:checked").val();return"0"==t?!1:(edd_load_gateway(t),!1)}),"1"==edd_scripts.is_checkout&&e("select#edd-gateway, input.edd-gateway").length){var t=e("meta[name='edd-chosen-gateway']").attr("content");t||(t=edd_scripts.default_gateway),setTimeout(function(){edd_load_gateway(t)},200)}e(document).on("click","#edd_purchase_form #edd_purchase_submit input[type=submit]",function(d){var t=document.getElementById("edd_purchase_form");if("function"!=typeof t.checkValidity||!1!==t.checkValidity()){d.preventDefault();var a=e(this).val();e(this).val(edd_global_vars.purchase_loading),e(this).prop("disabled",!0),e(this).after('<span class="edd-loading-ajax edd-loading"></span>'),e.post(edd_global_vars.ajaxurl,e("#edd_purchase_form").serialize()+"&action=edd_process_checkout&edd_ajax=true",function(d){"success"==e.trim(d)?(e(".edd_errors").remove(),e(".edd-error").hide(),e(t).submit()):(e("#edd-purchase-button").val(a),e(".edd-loading-ajax").remove(),e(".edd_errors").remove(),e(".edd-error").hide(),e(edd_global_vars.checkout_error_anchor).before(d),e("#edd-purchase-button").prop("disabled",!1),e(document.body).trigger("edd_checkout_error",[d]))})}}),e(document.body).on("change","#edd_cc_address input.card_state, #edd_cc_address select, #edd_address_country",d),e(document.body).on("change","#edd_cc_address input[name=card_zip]",function(){"undefined"!=typeof edd_global_vars&&recalculate_taxes()})});
1
+ function edd_load_gateway(e){jQuery(".edd-cart-ajax").show(),jQuery("#edd_purchase_form_wrap").html('<span class="edd-loading-ajax edd-loading"></span>');var d=edd_scripts.ajaxurl;d+=d.indexOf("?")>0?"&":"?",d=d+"payment-mode="+e,jQuery.post(d,{action:"edd_load_gateway",edd_payment_mode:e},function(d){jQuery("#edd_purchase_form_wrap").html(d),jQuery(".edd-no-js").hide(),jQuery("body").trigger("edd_gateway_loaded",[e])})}var edd_scripts;jQuery(document).ready(function(e){function d(){var d,t=e(this),a="undefined"!=typeof edd_global_vars,r="card_state";if("edd_address_country"==e(this).attr("id")&&(r="edd_address_state"),"card_state"!=t.attr("id")){var i={action:"edd_get_shop_states",country:t.val(),field_name:r};e.ajax({type:"POST",data:i,url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(r){d=a?e("#edd_purchase_form"):t.closest("form");var i='input[name="card_state"], select[name="card_state"], input[name="edd_address_state"], select[name="edd_address_state"]';if("nostates"==e.trim(r)){var o='<input type="text" name="card_state" class="card-state edd-input required" value=""/>';d.find(i).replaceWith(o)}else d.find(i).replaceWith(r);a&&e(document.body).trigger("edd_cart_billing_address_updated",[r])}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){a&&recalculate_taxes()})}else a&&recalculate_taxes();return!1}if(e(".edd-no-js").hide(),e("a.edd-add-to-cart").addClass("edd-has-js"),e(document.body).on("click.eddRemoveFromCart",".edd-remove-from-cart",function(d){var t=e(this),a=t.data("cart-item"),r=t.data("action"),i=t.data("download-id"),o={action:r,cart_item:a};return e.ajax({type:"POST",data:o,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){if(d.removed){if(parseInt(edd_scripts.position_in_cart,10)===parseInt(a,10)||edd_scripts.has_purchase_links)return window.location=window.location,!1;e(".edd-cart").each(function(){e(this).find("[data-cart-item='"+a+"']").parent().remove()}),e(".edd-cart").each(function(){var d=0;e(this).find("[data-cart-item]").each(function(){e(this).attr("data-cart-item",d),d+=1})}),e("[id^=edd_purchase_"+i+"]").length&&(e("[id^=edd_purchase_"+i+"] .edd_go_to_checkout").hide(),e("[id^=edd_purchase_"+i+"] a.edd-add-to-cart").show().removeAttr("data-edd-loading"),"1"==edd_scripts.quantities_enabled&&e("[id^=edd_purchase_"+i+"] .edd_download_quantity_wrapper").show()),e("span.edd-cart-quantity").text(d.cart_quantity),e(document.body).trigger("edd_quantity_updated",[d.cart_quantity]),edd_scripts.taxes_enabled&&(e(".cart_item.edd_subtotal span").html(d.subtotal),e(".cart_item.edd_cart_tax span").html(d.tax)),e(".cart_item.edd_total span").html(d.total),0==d.cart_quantity&&(e(".cart_item.edd_subtotal,.edd-cart-number-of-items,.cart_item.edd_checkout,.cart_item.edd_cart_tax,.cart_item.edd_total").hide(),e(".edd-cart").each(function(){var d=e(this).parent();d&&(d.addClass("cart-empty"),d.removeClass("cart-not-empty")),e(this).append('<li class="cart_item empty">'+edd_scripts.empty_cart_message+"</li>")})),e(document.body).trigger("edd_cart_item_removed",[d])}}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){}),!1}),e(document.body).on("click.eddAddToCart",".edd-add-to-cart",function(d){d.preventDefault();var t=e(this),a=t.closest("form");t.prop("disabled",!0);var r=(t.find(".edd-loading"),t.closest("div"));t.attr("data-edd-loading","");var a=t.parents("form").last(),i=t.data("download-id"),o=t.data("variable-price"),c=t.data("price-mode"),n=[],s=!0;if("yes"==o)if(a.find(".edd_price_option_"+i+'[type="hidden"]').length>0)n[0]=e(".edd_price_option_"+i,a).val(),a.find(".edd-submit").data("price")&&a.find(".edd-submit").data("price")>0&&(s=!1);else{if(!a.find(".edd_price_option_"+i+":checked",a).length)return t.removeAttr("data-edd-loading"),alert(edd_scripts.select_option),d.stopPropagation(),t.prop("disabled",!1),!1;a.find(".edd_price_option_"+i+":checked",a).each(function(d){if(n[d]=e(this).val(),!0===s){var t=e(this).data("price");t&&t>0&&(s=!1)}})}else n[0]=i,t.data("price")&&t.data("price")>0&&(s=!1);if(s&&a.find(".edd_action_input").val("add_to_cart"),"straight_to_gateway"==a.find(".edd_action_input").val())return a.submit(),!0;var _=t.data("action"),l={action:_,download_id:i,price_ids:n,post_data:e(a).serialize()};return e.ajax({type:"POST",data:l,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){var n="1"==edd_scripts.redirect_to_checkout,s="1"==a.find("#edd_redirect_to_checkout").val();if(n&&s||!n&&s)window.location=edd_scripts.checkout_page;else{"1"===edd_scripts.taxes_enabled&&(e(".cart_item.edd_subtotal").show(),e(".cart_item.edd_cart_tax").show()),e(".cart_item.edd_total").show(),e(".cart_item.edd_checkout").show(),e(".cart_item.empty").length&&e(".cart_item.empty").hide(),e(".widget_edd_cart_widget .edd-cart").each(function(t){var a=e(this).find(".edd-cart-meta:first");e(d.cart_item).insertBefore(a);var r=e(this).parent();r&&(r.addClass("cart-not-empty"),r.removeClass("cart-empty"))}),"1"===edd_scripts.taxes_enabled&&(e(".edd-cart-meta.edd_subtotal span").html(d.subtotal),e(".edd-cart-meta.edd_cart_tax span").html(d.tax)),e(".edd-cart-meta.edd_total span").html(d.total);e(".edd-cart-item-title",d.cart_item).length;if(e("span.edd-cart-quantity").each(function(){e(this).text(d.cart_quantity),e(document.body).trigger("edd_quantity_updated",[d.cart_quantity])}),"none"==e(".edd-cart-number-of-items").css("display")&&e(".edd-cart-number-of-items").show("slow"),("no"==o||"multi"!=c)&&(e("a.edd-add-to-cart",r).toggle(),e(".edd_go_to_checkout",r).css("display","inline-block")),"multi"==c&&t.removeAttr("data-edd-loading"),e(".edd_download_purchase_form").length&&("no"==o||!a.find(".edd_price_option_"+i).is("input:hidden"))){var _=e('.edd_download_purchase_form *[data-download-id="'+i+'"]').parents("form");e("a.edd-add-to-cart",_).hide(),"multi"!=c&&_.find(".edd_download_quantity_wrapper").slideUp(),e(".edd_go_to_checkout",_).show().removeAttr("data-edd-loading")}"incart"!=d&&(e(".edd-cart-added-alert",r).fadeIn(),setTimeout(function(){e(".edd-cart-added-alert",r).fadeOut()},3e3)),t.prop("disabled",!1),e(document.body).trigger("edd_cart_item_added",[d])}}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){}),!1}),e("#edd_checkout_form_wrap").on("click",".edd_checkout_register_login",function(){var d=e(this),t={action:d.data("action")};return e(".edd-cart-ajax").show(),e.post(edd_scripts.ajaxurl,t,function(d){e("#edd_checkout_login_register").html(edd_scripts.loading),e("#edd_checkout_login_register").html(d),e(".edd-cart-ajax").hide()}),!1}),e(document).on("click","#edd_purchase_form #edd_login_fields input[type=submit]",function(d){d.preventDefault();var t=e(this).val();e(this).val(edd_global_vars.purchase_loading),e(this).after('<span class="edd-loading-ajax edd-loading"></span>');var a={action:"edd_process_checkout_login",edd_ajax:1,edd_user_login:e("#edd_login_fields #edd_user_login").val(),edd_user_pass:e("#edd_login_fields #edd_user_pass").val()};e.post(edd_global_vars.ajaxurl,a,function(d){"success"==e.trim(d)?(e(".edd_errors").remove(),window.location=edd_scripts.checkout_page):(e("#edd_login_fields input[type=submit]").val(t),e(".edd-loading-ajax").remove(),e(".edd_errors").remove(),e("#edd-user-login-submit").before(d))})}),e("select#edd-gateway, input.edd-gateway").change(function(d){var t=e("#edd-gateway option:selected, input.edd-gateway:checked").val();return"0"==t?!1:(edd_load_gateway(t),!1)}),"1"==edd_scripts.is_checkout&&e("select#edd-gateway, input.edd-gateway").length){var t=e("meta[name='edd-chosen-gateway']").attr("content");t||(t=edd_scripts.default_gateway),setTimeout(function(){edd_load_gateway(t)},200)}e(document).on("click","#edd_purchase_form #edd_purchase_submit input[type=submit]",function(d){var t=document.getElementById("edd_purchase_form");if("function"!=typeof t.checkValidity||!1!==t.checkValidity()){d.preventDefault();var a=e(this).val();e(this).val(edd_global_vars.purchase_loading),e(this).prop("disabled",!0),e(this).after('<span class="edd-loading-ajax edd-loading"></span>'),e.post(edd_global_vars.ajaxurl,e("#edd_purchase_form").serialize()+"&action=edd_process_checkout&edd_ajax=true",function(d){"success"==e.trim(d)?(e(".edd_errors").remove(),e(".edd-error").hide(),e(t).submit()):(e("#edd-purchase-button").val(a),e(".edd-loading-ajax").remove(),e(".edd_errors").remove(),e(".edd-error").hide(),e(edd_global_vars.checkout_error_anchor).before(d),e("#edd-purchase-button").prop("disabled",!1),e(document.body).trigger("edd_checkout_error",[d]))})}}),e(document.body).on("change","#edd_cc_address input.card_state, #edd_cc_address select, #edd_address_country",d),e(document.body).on("change","#edd_cc_address input[name=card_zip]",function(){"undefined"!=typeof edd_global_vars&&recalculate_taxes()})});
easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.8
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.8
29
  */
30
 
31
  // Exit if accessed directly.
@@ -206,7 +206,7 @@ final class Easy_Digital_Downloads {
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
- define( 'EDD_VERSION', '2.8' );
210
  }
211
 
212
  // Plugin Folder Path.
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.8.1
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.8.1
29
  */
30
 
31
  // Exit if accessed directly.
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
+ define( 'EDD_VERSION', '2.8.1' );
210
  }
211
 
212
  // Plugin Folder Path.
includes/EDD_SL_Plugin_Updater.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
7
  * Allows plugins to use their own update API.
8
  *
9
  * @author Easy Digital Downloads
10
- * @version 1.6.13
11
  */
12
  class EDD_SL_Plugin_Updater {
13
 
@@ -474,7 +474,7 @@ class EDD_SL_Plugin_Updater {
474
  'value' => json_encode( $value )
475
  );
476
 
477
- update_option( $cache_key, $data );
478
 
479
  }
480
 
7
  * Allows plugins to use their own update API.
8
  *
9
  * @author Easy Digital Downloads
10
+ * @version 1.6.14
11
  */
12
  class EDD_SL_Plugin_Updater {
13
 
474
  'value' => json_encode( $value )
475
  );
476
 
477
+ update_option( $cache_key, $data, 'no' );
478
 
479
  }
480
 
includes/admin/payments/class-payments-table.php CHANGED
@@ -66,6 +66,14 @@ class EDD_Payment_History_Table extends WP_List_Table {
66
  */
67
  public $pending_count;
68
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Total number of refunded payments
71
  *
@@ -216,19 +224,21 @@ class EDD_Payment_History_Table extends WP_List_Table {
216
  */
217
  public function get_views() {
218
 
219
- $current = isset( $_GET['status'] ) ? $_GET['status'] : '';
220
- $total_count = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
221
- $complete_count = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
222
- $pending_count = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
223
- $refunded_count = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
224
- $failed_count = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
225
- $abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
226
- $revoked_count = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
 
227
 
228
  $views = array(
229
  'all' => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array( 'status', 'paged' ) ), $current === 'all' || $current == '' ? ' class="current"' : '', __('All','easy-digital-downloads' ) . $total_count ),
230
  'publish' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'publish', 'paged' => FALSE ) ), $current === 'publish' ? ' class="current"' : '', __('Completed','easy-digital-downloads' ) . $complete_count ),
231
  'pending' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'pending', 'paged' => FALSE ) ), $current === 'pending' ? ' class="current"' : '', __('Pending','easy-digital-downloads' ) . $pending_count ),
 
232
  'refunded' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'refunded', 'paged' => FALSE ) ), $current === 'refunded' ? ' class="current"' : '', __('Refunded','easy-digital-downloads' ) . $refunded_count ),
233
  'revoked' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'revoked', 'paged' => FALSE ) ), $current === 'revoked' ? ' class="current"' : '', __('Revoked','easy-digital-downloads' ) . $revoked_count ),
234
  'failed' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'failed', 'paged' => FALSE ) ), $current === 'failed' ? ' class="current"' : '', __('Failed','easy-digital-downloads' ) . $failed_count ),
@@ -651,6 +661,9 @@ class EDD_Payment_History_Table extends WP_List_Table {
651
  case 'pending':
652
  $total_items = $this->pending_count;
653
  break;
 
 
 
654
  case 'refunded':
655
  $total_items = $this->refunded_count;
656
  break;
66
  */
67
  public $pending_count;
68
 
69
+ /**
70
+ * Total number of processing payments
71
+ *
72
+ * @var int
73
+ * @since 2.8
74
+ */
75
+ public $processing_count;
76
+
77
  /**
78
  * Total number of refunded payments
79
  *
224
  */
225
  public function get_views() {
226
 
227
+ $current = isset( $_GET['status'] ) ? $_GET['status'] : '';
228
+ $total_count = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
229
+ $complete_count = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
230
+ $pending_count = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
231
+ $processing_count = '&nbsp;<span class="count">(' . $this->processing_count . ')</span>';
232
+ $refunded_count = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
233
+ $failed_count = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
234
+ $abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
235
+ $revoked_count = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
236
 
237
  $views = array(
238
  'all' => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array( 'status', 'paged' ) ), $current === 'all' || $current == '' ? ' class="current"' : '', __('All','easy-digital-downloads' ) . $total_count ),
239
  'publish' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'publish', 'paged' => FALSE ) ), $current === 'publish' ? ' class="current"' : '', __('Completed','easy-digital-downloads' ) . $complete_count ),
240
  'pending' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'pending', 'paged' => FALSE ) ), $current === 'pending' ? ' class="current"' : '', __('Pending','easy-digital-downloads' ) . $pending_count ),
241
+ 'processing' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'processing', 'paged' => FALSE ) ), $current === 'processing' ? ' class="current"' : '', __('Processing','easy-digital-downloads' ) . $processing_count ),
242
  'refunded' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'refunded', 'paged' => FALSE ) ), $current === 'refunded' ? ' class="current"' : '', __('Refunded','easy-digital-downloads' ) . $refunded_count ),
243
  'revoked' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'revoked', 'paged' => FALSE ) ), $current === 'revoked' ? ' class="current"' : '', __('Revoked','easy-digital-downloads' ) . $revoked_count ),
244
  'failed' => sprintf( '<a href="%s"%s>%s</a>', add_query_arg( array( 'status' => 'failed', 'paged' => FALSE ) ), $current === 'failed' ? ' class="current"' : '', __('Failed','easy-digital-downloads' ) . $failed_count ),
661
  case 'pending':
662
  $total_items = $this->pending_count;
663
  break;
664
+ case 'processing':
665
+ $total_items = $this->processing_count;
666
+ break;
667
  case 'refunded':
668
  $total_items = $this->refunded_count;
669
  break;
includes/emails/class-edd-email-tags.php CHANGED
@@ -439,15 +439,15 @@ function edd_email_tag_download_list( $payment_id ) {
439
 
440
  } elseif ( edd_is_bundled_product( $item['id'] ) ) {
441
 
442
- $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item['id'] ), $item, $payment_id, 'download_list' );
443
 
444
  foreach ( $bundled_products as $bundle_item ) {
445
 
446
  $download_list .= '<div class="edd_bundled_product"><strong>' . get_the_title( $bundle_item ) . '</strong></div>';
447
 
448
- $files = edd_get_download_files( $bundle_item );
449
 
450
- foreach ( $files as $filekey => $file ) {
451
  if ( $show_links ) {
452
  $download_list .= '<div>';
453
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
@@ -460,7 +460,8 @@ function edd_email_tag_download_list( $payment_id ) {
460
  }
461
  }
462
  }
463
- }else{
 
464
 
465
  $no_downloads_message = apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item['id'] );
466
  $no_downloads_message = apply_filters( 'edd_email_receipt_no_downloads_message', $no_downloads_message, $item['id'], $price_id, $payment_id );
439
 
440
  } elseif ( edd_is_bundled_product( $item['id'] ) ) {
441
 
442
+ $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item['id'], $price_id ), $item, $payment_id, 'download_list' );
443
 
444
  foreach ( $bundled_products as $bundle_item ) {
445
 
446
  $download_list .= '<div class="edd_bundled_product"><strong>' . get_the_title( $bundle_item ) . '</strong></div>';
447
 
448
+ $download_files = edd_get_download_files( edd_get_bundle_item_id( $bundle_item ), edd_get_bundle_item_price_id( $bundle_item ) );
449
 
450
+ foreach ( $download_files as $filekey => $file ) {
451
  if ( $show_links ) {
452
  $download_list .= '<div>';
453
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
460
  }
461
  }
462
  }
463
+
464
+ } else {
465
 
466
  $no_downloads_message = apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item['id'] );
467
  $no_downloads_message = apply_filters( 'edd_email_receipt_no_downloads_message', $no_downloads_message, $item['id'], $price_id, $payment_id );
includes/payments/functions.php CHANGED
@@ -739,7 +739,8 @@ function edd_get_payment_statuses() {
739
  'refunded' => __( 'Refunded', 'easy-digital-downloads' ),
740
  'failed' => __( 'Failed', 'easy-digital-downloads' ),
741
  'abandoned' => __( 'Abandoned', 'easy-digital-downloads' ),
742
- 'revoked' => __( 'Revoked', 'easy-digital-downloads' )
 
743
  );
744
 
745
  return apply_filters( 'edd_payment_statuses', $payment_statuses );
739
  'refunded' => __( 'Refunded', 'easy-digital-downloads' ),
740
  'failed' => __( 'Failed', 'easy-digital-downloads' ),
741
  'abandoned' => __( 'Abandoned', 'easy-digital-downloads' ),
742
+ 'revoked' => __( 'Revoked', 'easy-digital-downloads' ),
743
+ 'processing' => __( 'Processing', 'easy-digital-downloads' )
744
  );
745
 
746
  return apply_filters( 'edd_payment_statuses', $payment_statuses );
includes/scripts.php CHANGED
@@ -89,10 +89,6 @@ function edd_load_scripts() {
89
  'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0',
90
  'quantities_enabled' => edd_item_quantities_enabled(),
91
  'taxes_enabled' => edd_use_taxes() ? '1' : '0', // Adding here for widget, but leaving in checkout vars for backcompat
92
- 'currency_sign' => edd_currency_filter(''),
93
- 'currency_pos' => edd_get_option( 'currency_position', 'before' ),
94
- 'decimal_separator' => edd_get_option( 'decimal_separator', '.' ),
95
- 'thousands_separator' => edd_get_option( 'thousands_separator', ',' ),
96
  ) ) );
97
  }
98
  }
89
  'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0',
90
  'quantities_enabled' => edd_item_quantities_enabled(),
91
  'taxes_enabled' => edd_use_taxes() ? '1' : '0', // Adding here for widget, but leaving in checkout vars for backcompat
 
 
 
 
92
  ) ) );
93
  }
94
  }
includes/template-functions.php CHANGED
@@ -126,26 +126,14 @@ function edd_get_purchase_link( $args = array() ) {
126
 
127
  $data_price = 'data-price="' . $data_price_value . '"';
128
 
129
- $button_text = ! empty( $args['text'] ) ? '<span class="edd-purchase-button-separator">&nbsp;&ndash;&nbsp;</span>' . '<span class="edd-purchase-button-text">' . $args['text'] . '</span>' : '';
130
 
131
  if ( false !== $price ) {
132
 
133
  if ( 0 == $price ) {
134
- $args['text'] = '<span class="edd-purchase-button-free">' . __( 'Free', 'easy-digital-downloads' ) . '</span>' . $button_text;
135
  } else {
136
- $symbol = edd_currency_symbol( edd_get_currency() );
137
-
138
- $args['text'] = '<span class="edd-purchase-button-price-text">' . edd_format_amount( $price ) . '</span>';
139
-
140
- $currency_pos = edd_get_option( 'currency_position', 'before' );
141
- $currency_markup = '<span class="edd-purchase-button-currency-symbol">' . $symbol . '</span>';
142
- if ( 'before' === $currency_pos ) {
143
- $args['text'] = $currency_markup . $args['text'];
144
- } else {
145
- $args['text'] .= $currency_markup;
146
- }
147
-
148
- $args['text'] .= $button_text;
149
  }
150
 
151
  }
@@ -190,7 +178,7 @@ function edd_get_purchase_link( $args = array() ) {
190
 
191
  }
192
 
193
- echo '<input type="submit" class="edd-add-to-cart edd-no-js ' . esc_attr( $class ) . '" name="edd_purchase_download" value="' . esc_attr( strip_tags( $args['text'] ) ) . '" data-action="edd_add_to_cart" data-download-id="' . esc_attr( $download->ID ) . '" ' . $data_variable . ' ' . $type . ' ' . $button_display . '/>';
194
  echo '<a href="' . esc_url( edd_get_checkout_uri() ) . '" class="edd_go_to_checkout ' . esc_attr( $class ) . '" ' . $checkout_display . '>' . __( 'Checkout', 'easy-digital-downloads' ) . '</a>';
195
  ?>
196
 
126
 
127
  $data_price = 'data-price="' . $data_price_value . '"';
128
 
129
+ $button_text = ! empty( $args['text'] ) ? '&nbsp;&ndash;&nbsp;' . $args['text'] : '';
130
 
131
  if ( false !== $price ) {
132
 
133
  if ( 0 == $price ) {
134
+ $args['text'] = __( 'Free', 'easy-digital-downloads' ) . $button_text;
135
  } else {
136
+ $args['text'] = edd_currency_filter( edd_format_amount( $price ) ) . $button_text;
 
 
 
 
 
 
 
 
 
 
 
 
137
  }
138
 
139
  }
178
 
179
  }
180
 
181
+ echo '<input type="submit" class="edd-add-to-cart edd-no-js ' . esc_attr( $class ) . '" name="edd_purchase_download" value="' . esc_attr( $args['text'] ) . '" data-action="edd_add_to_cart" data-download-id="' . esc_attr( $download->ID ) . '" ' . $data_variable . ' ' . $type . ' ' . $button_display . '/>';
182
  echo '<a href="' . esc_url( edd_get_checkout_uri() ) . '" class="edd_go_to_checkout ' . esc_attr( $class ) . '" ' . $checkout_display . '>' . __( 'Checkout', 'easy-digital-downloads' ) . '</a>';
183
  ?>
184
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://easydigitaldownloads.com/donate/
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
  Tested up to: 4.9
9
- Stable Tag: 2.8
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
@@ -213,6 +213,13 @@ Yes. Easy Digital Downloads also includes default support for Amazon Payments an
213
 
214
  == Changelog ==
215
 
 
 
 
 
 
 
 
216
  = 2.8, July 25, 2017 =
217
 
218
  * New: Design of repeatable rows, including variable prices and download files, has been redesigned to better accommodate more options and smaller screen sizes
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
  Tested up to: 4.9
9
+ Stable Tag: 2.8.1
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
213
 
214
  == Changelog ==
215
 
216
+ = 2.8.1, July 27, 2017 =
217
+
218
+ * New: Include "processing" as payment status in the list table.
219
+ * Fix: Revert adjusting purchase amount when quantity changes.
220
+ * Fix: Variable pricing bundle purchases gave access to incorrect product files.
221
+ * Tweak: Update to 1.6.14 of the Plugin Updater.
222
+
223
  = 2.8, July 25, 2017 =
224
 
225
  * New: Design of repeatable rows, including variable prices and download files, has been redesigned to better accommodate more options and smaller screen sizes