PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.2.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.2.0
2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 All 65 releases
← All changes | assets/js/admin.js +6 -1 1.10.2 → 2.2.0 View file →
@@ -12,10 +12,15 @@
12 12 } else {
13 13 jQuery(".show_if_subscription").hide();
14 14 }
15 15
16 + // WooCommerce fires this from its variations AJAX callback, before it removes
17 + // the panel's loading overlay. A product with no variations yet renders no
18 + // `.woocommerce_variations[data-total]`, and JSON.parse(undefined) threw out
19 + // of that callback, leaving the Variations panel spinning forever. No count
20 + // means no variations.
16 21 jQuery(document).on("woocommerce_variations_loaded", () => {
17 - let total_variations = JSON.parse(jQuery(".woocommerce_variations").attr("data-total"));
22 + let total_variations = parseInt(jQuery(".woocommerce_variations").attr("data-total"), 10) || 0;
18 23 for (let index = 0; index < total_variations; index++) {
19 24 let element = document.getElementById("subscrpt_enable[" + index + "]");
20 25 if (element && element.checked) {
21 26 jQuery(".show_if_subscription_" + index).show();