diff --git a/changelog.txt b/changelog.txt index c01c596..e1209c4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,15 @@ *** WooCommerce Subscriptions Changelog *** +2017.08.01 - version 2.2.11 +* Fix: Do not save subscription product meta data on other post types, including WooCommerce Tab Manager and Jetpack post types. PR#2203 +* Fix: Do not apply 'woocommerce_get_price' or 'woocommerce_product_get_price' filters to tax inclusive/exclusive prices to avoid ever applying them twice or to non price prices, like sign-up fees. Introduced in Subscriptions v2.2.5. PR#2261 +* Fix: Copy custom and third-party order line item meta to cart line items during the renewal/resubscribe process so that the meta persists on the renewal/resubscribe orders and subscription. PR#2258 +* Fix: Always use correct minimum variation price when generating variable price HTML, even if there is a free trial on one variation. PR#2254 +* Fix: Never apply 'woocommerce_order_formatted_line_subtotal' filter twice. PR#2239 +* Fix: Format plain text email for Subscription renewals correctly. PR#2255 +* Tweak: Add Woo plugin header to be compatible with WooCommerce 3.1's updater. PR#2252 +* Tweak: Add base composer.json for using Subscriptions with Composer. PR#2229 + 2017.07.20 - version 2.2.10 * Fix: Do not attempt to call WC 3.0 only method when WC 2.6 is active by fixing version check from 2.6 to 3.0. Props @lkraav. PR#2236 * Fix: Display "Limit Subscription" option on Edit Product screen even when Reviews are disabled. PR#2233 diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..451c48c --- /dev/null +++ b/composer.lock @@ -0,0 +1,132 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "f940d0fcab30dd0d30d8b2234dbbed1b", + "packages": [ + { + "name": "composer/installers", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045", + "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "phpbb", + "piwik", + "ppi", + "puppet", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2017-04-24T06:37:16+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/includes/admin/class-wc-subscriptions-admin.php b/includes/admin/class-wc-subscriptions-admin.php index a812e5d..6287ac2 100644 --- a/includes/admin/class-wc-subscriptions-admin.php +++ b/includes/admin/class-wc-subscriptions-admin.php @@ -369,7 +369,7 @@ class WC_Subscriptions_Admin { */ public static function save_subscription_meta( $post_id ) { - if ( self::$saved_product_meta || ( empty( $_POST['_wcsnonce'] ) || ! wp_verify_nonce( $_POST['_wcsnonce'], 'wcs_subscription_meta' ) || ! isset( $_POST['product-type'] ) || ! in_array( $_POST['product-type'], apply_filters( 'woocommerce_subscription_product_types', array( WC_Subscriptions::$name ) ) ) ) ) { + if ( empty( $_POST['_wcsnonce'] ) || ! wp_verify_nonce( $_POST['_wcsnonce'], 'wcs_subscription_meta' ) || false === self::is_subscription_product_save_request( $post_id, apply_filters( 'woocommerce_subscription_product_types', array( WC_Subscriptions::$name ) ) ) ) { return; } @@ -448,7 +448,7 @@ class WC_Subscriptions_Admin { */ public static function save_variable_subscription_meta( $post_id ) { - if ( self::$saved_product_meta || ( empty( $_POST['_wcsnonce'] ) || ! wp_verify_nonce( $_POST['_wcsnonce'], 'wcs_subscription_meta' ) || ! isset( $_POST['product-type'] ) || ! in_array( $_POST['product-type'], apply_filters( 'woocommerce_subscription_variable_product_types', array( 'variable-subscription' ) ) ) ) ) { + if ( empty( $_POST['_wcsnonce'] ) || ! wp_verify_nonce( $_POST['_wcsnonce'], 'wcs_subscription_meta' ) || false === self::is_subscription_product_save_request( $post_id, apply_filters( 'woocommerce_subscription_variable_product_types', array( 'variable-subscription' ) ) ) ) { return; } @@ -1631,6 +1631,29 @@ class WC_Subscriptions_Admin { return $checkout_settings; } + /** + * Check if subscription product meta data should be saved for the current request. + * + * @param array Array of product types. + * @since 2.2.9 + */ + private static function is_subscription_product_save_request( $post_id, $product_types ) { + + if ( self::$saved_product_meta ) { + $is_subscription_product_save_request = false; + } elseif ( empty( $_POST['_wcsnonce'] ) || ! wp_verify_nonce( $_POST['_wcsnonce'], 'wcs_subscription_meta' ) ) { + $is_subscription_product_save_request = false; + } elseif ( ! isset( $_POST['product-type'] ) || ! in_array( $_POST['product-type'], $product_types ) ) { + $is_subscription_product_save_request = false; + } elseif ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) { + $is_subscription_product_save_request = false; + } else { + $is_subscription_product_save_request = true; + } + + return apply_filters( 'wcs_admin_is_subscription_product_save_request', $is_subscription_product_save_request, $post_id, $product_types ); + } + /** * Outputs the contents of the "Renewal Orders" meta box. * diff --git a/includes/class-wc-product-variable-subscription.php b/includes/class-wc-product-variable-subscription.php index 18738d8..b74fc97 100644 --- a/includes/class-wc-product-variable-subscription.php +++ b/includes/class-wc-product-variable-subscription.php @@ -85,7 +85,7 @@ class WC_Product_Variable_Subscription extends WC_Product_Variable { $tax_display_mode = get_option( 'woocommerce_tax_display_shop' ); - $price = WC_Subscriptions_Product::get_price( $this ); + $price = WC_Subscriptions_Product::get_price( $this->get_meta( '_min_price_variation_id' ) ); $price = 'incl' == $tax_display_mode ? wcs_get_price_including_tax( $this, array( 'price' => $price ) ) : wcs_get_price_excluding_tax( $this, array( 'price' => $price ) ); $price = $this->get_price_prefix( $prices ) . wc_price( $price ) . $this->get_price_suffix(); $price = apply_filters( 'woocommerce_variable_price_html', $price, $this ); diff --git a/includes/class-wc-subscription.php b/includes/class-wc-subscription.php index 8f9a13b..6dc6171 100644 --- a/includes/class-wc-subscription.php +++ b/includes/class-wc-subscription.php @@ -1488,9 +1488,10 @@ class WC_Subscription extends WC_Order { $line_subtotal = $this->get_line_subtotal( $item, true ); } $subtotal = wcs_price_string( $this->get_price_string_details( $line_subtotal ) ); + $subtotal = apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this ); } - return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this ); + return $subtotal; } /** diff --git a/includes/class-wc-subscriptions-email.php b/includes/class-wc-subscriptions-email.php index 57b5e40..f759568 100644 --- a/includes/class-wc-subscriptions-email.php +++ b/includes/class-wc-subscriptions-email.php @@ -253,7 +253,7 @@ class WC_Subscriptions_Email { add_filter( 'woocommerce_order_is_paid', $show_purchase_note_callback ); if ( function_exists( 'wc_get_email_order_items' ) ) { // WC 3.0+ - $items_table = wc_get_email_order_items( $order ); + $items_table = wc_get_email_order_items( $order, $args ); } else { $items_table = $order->email_order_items_table( $args ); } diff --git a/includes/class-wcs-cart-renewal.php b/includes/class-wcs-cart-renewal.php index 691598c..1fd86a3 100644 --- a/includes/class-wcs-cart-renewal.php +++ b/includes/class-wcs-cart-renewal.php @@ -118,6 +118,26 @@ class WCS_Cart_Renewal { // If the shipping address on a renewal order differs to the order's billing address, check the "Ship to different address" automatically to make sure the renewal order's fields are used by default add_filter( 'woocommerce_ship_to_different_address_checked', array( &$this, 'maybe_check_ship_to_different_address' ), 100, 1 ); + + add_filter( 'woocommerce_get_item_data', array( &$this, 'display_line_item_data_in_cart' ), 10, 2 ); + + // Attach hooks which depend on WooCommerce version constants. Differs from @see attach_dependant_hooks() in that this is hooked inside an inherited function and so extended classes will also inherit these callbacks + add_action( 'woocommerce_loaded', array( &$this, 'attach_dependant_callbacks' ), 10 ); + } + + /** + * Attach callbacks dependant on WC versions + * + * @since 2.2.11 + */ + public function attach_dependant_callbacks() { + + if ( WC_Subscriptions::is_woocommerce_pre( '3.0' ) ) { + add_action( 'woocommerce_add_order_item_meta', array( &$this, 'add_order_item_meta' ), 10, 2 ); + add_action( 'woocommerce_add_subscription_item_meta', array( &$this, 'add_order_item_meta' ), 10, 2 ); + } else { + add_action( 'woocommerce_checkout_create_order_line_item', array( &$this, 'add_order_line_item_meta' ), 10, 3 ); + } } /** @@ -205,6 +225,22 @@ class WCS_Cart_Renewal { $variations = array(); $item_data = array(); + $custom_line_item_meta = array(); + $reserved_item_meta_keys = array( + '_item_meta', + '_item_meta_array', + '_qty', + '_tax_class', + '_product_id', + '_variation_id', + '_line_subtotal', + '_line_total', + '_line_tax', + '_line_tax_data', + '_line_subtotal_tax', + '_cart_item_key_' . $this->cart_item_key, // This value is unique per checkout attempt and so shouldn't be copied from existing line items. + 'Backordered', // WC will reapply this meta if the line item is backordered. Therefore it shouldn't be copied through the cart. + ); // Load all product info including variation data if ( WC_Subscriptions::is_woocommerce_pre( '3.0' ) ) { @@ -219,6 +255,8 @@ class WCS_Cart_Renewal { $variations[ $meta_name ] = $meta_value[0]; } elseif ( meta_is_product_attribute( $meta_name, $meta_value[0], $product_id ) ) { $variations[ $meta_name ] = $meta_value[0]; + } elseif ( ! in_array( $meta_name, $reserved_item_meta_keys ) ) { + $custom_line_item_meta[ $meta_name ] = $meta_value[0]; } } } else { @@ -233,6 +271,8 @@ class WCS_Cart_Renewal { $variations[ $meta->key ] = $meta->value; } elseif ( meta_is_product_attribute( $meta->key, $meta->value, $product_id ) ) { $variations[ $meta->key ] = $meta->value; + } elseif ( ! in_array( $meta->key, $reserved_item_meta_keys ) ) { + $custom_line_item_meta[ $meta->key ] = $meta->value; } } } @@ -260,7 +300,8 @@ class WCS_Cart_Renewal { } } - $cart_item_data['line_item_id'] = $item_id; + $cart_item_data['line_item_id'] = $item_id; + $cart_item_data['custom_line_item_meta'] = $custom_line_item_meta; $item_data = apply_filters( 'woocommerce_order_again_cart_item_data', array( $this->cart_item_key => $cart_item_data ), $line_item, $subscription ); @@ -1156,6 +1197,66 @@ class WCS_Cart_Renewal { } } + /** + * Add custom line item meta to the cart item data so it's displayed in the cart. + * + * @param array $cart_item_data + * @param array $cart_item + * @since 2.2.11 + */ + public function display_line_item_data_in_cart( $cart_item_data, $cart_item ) { + + if ( ! empty( $cart_item[ $this->cart_item_key ]['custom_line_item_meta'] ) ) { + foreach ( $cart_item[ $this->cart_item_key ]['custom_line_item_meta'] as $item_meta_key => $value ) { + + $cart_item_data[] = array( + 'key' => $item_meta_key, + 'value' => $value, + 'hidden' => substr( $item_meta_key, 0, 1 ) === '_', // meta keys prefixed with an `_` are hidden by default + ); + } + } + + return $cart_item_data; + } + + /** + * Add custom line item meta from the old line item into the new line item meta. + * + * Used when WC versions prior to 3.0 are active. When WC 3.0 or newer is active, + * @see WCS_Cart_Renewal->add_order_line_item_meta() replaces this function + * + * @param int $item_id + * @param array $cart_item_data + * @since 2.2.11 + */ + public function add_order_item_meta( $item_id, $cart_item_data ) { + if ( ! empty( $cart_item_data[ $this->cart_item_key ]['custom_line_item_meta'] ) ) { + foreach ( $cart_item_data[ $this->cart_item_key ]['custom_line_item_meta'] as $meta_key => $value ) { + woocommerce_add_order_item_meta( $item_id, $meta_key, $value ); + } + } + } + + /** + * Add custom line item meta from the old line item into the new line item meta. + * + * Used when WC 3.0 or newer is active. When prior versions are active, + * @see WCS_Cart_Renewal->add_order_item_meta() replaces this function + * + * @param WC_Order_Item_Product + * @param string $cart_item_key + * @param array $cart_item_data + * @since 2.2.11 + */ + public function add_order_line_item_meta( $item, $cart_item_key, $cart_item_data ) { + if ( ! empty( $cart_item_data[ $this->cart_item_key ]['custom_line_item_meta'] ) ) { + foreach ( $cart_item_data[ $this->cart_item_key ]['custom_line_item_meta'] as $meta_key => $value ) { + $item->add_meta_data( $meta_key, $value ); + } + } + } + /* Deprecated */ /** diff --git a/includes/emails/class-wcs-email-customer-payment-retry.php b/includes/emails/class-wcs-email-customer-payment-retry.php index 68fc5dc..bd416cb 100644 --- a/includes/emails/class-wcs-email-customer-payment-retry.php +++ b/includes/emails/class-wcs-email-customer-payment-retry.php @@ -15,9 +15,6 @@ if ( ! defined( 'ABSPATH' ) ) { */ class WCS_Email_Customer_Payment_Retry extends WCS_Email_Customer_Renewal_Invoice { - var $find; - var $replace; - /** * Constructor */ diff --git a/includes/emails/class-wcs-email-customer-renewal-invoice.php b/includes/emails/class-wcs-email-customer-renewal-invoice.php index d17fb1e..62d5251 100644 --- a/includes/emails/class-wcs-email-customer-renewal-invoice.php +++ b/includes/emails/class-wcs-email-customer-renewal-invoice.php @@ -15,9 +15,6 @@ if ( ! defined( 'ABSPATH' ) ) { */ class WCS_Email_Customer_Renewal_Invoice extends WC_Email_Customer_Invoice { - var $find; - var $replace; - // fields used in WC_Email_Customer_Invoice this class doesn't need var $subject_paid = null; var $heading_paid = null; diff --git a/includes/wcs-product-functions.php b/includes/wcs-product-functions.php index af3f849..f9afa9a 100644 --- a/includes/wcs-product-functions.php +++ b/includes/wcs-product-functions.php @@ -27,13 +27,11 @@ function wcs_get_price_including_tax( $product, $args = array() ) { if ( function_exists( 'wc_get_price_including_tax' ) ) { // WC 3.0+ $price = wc_get_price_including_tax( $product, $args ); - $filter = 'woocommerce_product_get_price'; } else { // WC < 3.0 $price = $product->get_price_including_tax( $args['qty'], $args['price'] ); - $filter = 'woocommerce_get_price'; } - return apply_filters( $filter, $price , $product ); + return $price; } /** @@ -53,13 +51,11 @@ function wcs_get_price_excluding_tax( $product, $args = array() ) { if ( function_exists( 'wc_get_price_excluding_tax' ) ) { // WC 3.0+ $price = wc_get_price_excluding_tax( $product, $args ); - $filter = 'woocommerce_product_get_price'; } else { // WC < 3.0 $price = $product->get_price_excluding_tax( $args['qty'], $args['price'] ); - $filter = 'woocommerce_get_price'; } - return apply_filters( $filter, $price , $product ); + return $price; } /** diff --git a/languages/woocommerce-subscriptions.pot b/languages/woocommerce-subscriptions.pot index dd960fd..f825176 100644 --- a/languages/woocommerce-subscriptions.pot +++ b/languages/woocommerce-subscriptions.pot @@ -2,10 +2,10 @@ # This file is distributed under the same license as the WooCommerce Subscriptions package. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Subscriptions 2.2.10\n" +"Project-Id-Version: WooCommerce Subscriptions 2.2.11\n" "Report-Msgid-Bugs-To: " "https://github.com/Prospress/woocommerce-subscriptions/issues\n" -"POT-Creation-Date: 2017-07-20 05:32:36+00:00\n" +"POT-Creation-Date: 2017-08-01 04:27:16+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -180,7 +180,7 @@ msgid "Manage Subscriptions" msgstr "" #: includes/admin/class-wc-subscriptions-admin.php:868 -#: woocommerce-subscriptions.php:233 +#: woocommerce-subscriptions.php:235 msgid "Search Subscriptions" msgstr "" @@ -190,7 +190,7 @@ msgstr "" #: includes/admin/reports/class-wcs-report-subscription-events-by-date.php:654 #: includes/class-wcs-query.php:95 includes/class-wcs-query.php:115 #: includes/class-wcs-query.php:117 templates/admin/status.php:9 -#: woocommerce-subscriptions.php:224 woocommerce-subscriptions.php:237 +#: woocommerce-subscriptions.php:226 woocommerce-subscriptions.php:239 msgid "Subscriptions" msgstr "" @@ -215,7 +215,7 @@ msgstr "" #: includes/class-wc-product-subscription.php:72 #: includes/class-wc-product-variable-subscription.php:63 #: includes/class-wc-subscriptions-product.php:96 -#: woocommerce-subscriptions.php:483 +#: woocommerce-subscriptions.php:485 msgid "Sign Up Now" msgstr "" @@ -350,7 +350,7 @@ msgstr "" #: includes/admin/class-wc-subscriptions-admin.php:1195 #: includes/upgrades/templates/wcs-about-2-0.php:35 #: includes/upgrades/templates/wcs-about.php:34 -#: woocommerce-subscriptions.php:1022 +#: woocommerce-subscriptions.php:1024 msgid "Settings" msgstr "" @@ -542,7 +542,7 @@ msgstr "" #: templates/emails/subscription-info.php:18 #: templates/myaccount/my-subscriptions.php:25 #: templates/myaccount/related-subscriptions.php:20 -#: woocommerce-subscriptions.php:225 +#: woocommerce-subscriptions.php:227 msgid "Subscription" msgstr "" @@ -1446,66 +1446,66 @@ msgstr "" msgid "The %s date of a subscription can not be deleted. You must delete the order." msgstr "" -#: includes/class-wc-subscription.php:1681 +#: includes/class-wc-subscription.php:1682 msgid "Sign-up complete." msgstr "" -#: includes/class-wc-subscription.php:1683 +#: includes/class-wc-subscription.php:1684 msgid "Payment received." msgstr "" -#: includes/class-wc-subscription.php:1714 +#: includes/class-wc-subscription.php:1715 msgid "Payment failed." msgstr "" -#: includes/class-wc-subscription.php:1719 +#: includes/class-wc-subscription.php:1720 msgid "Subscription Cancelled: maximum number of failed payments reached." msgstr "" -#: includes/class-wc-subscription.php:1921 +#: includes/class-wc-subscription.php:1922 #: includes/class-wcs-change-payment-method-admin.php:156 msgid "Manual Renewal" msgstr "" -#: includes/class-wc-subscription.php:2000 +#: includes/class-wc-subscription.php:2001 msgid "Payment method meta must be an array." msgstr "" -#: includes/class-wc-subscription.php:2235 +#: includes/class-wc-subscription.php:2236 msgid "Invalid format. First parameter needs to be an array." msgstr "" -#: includes/class-wc-subscription.php:2239 +#: includes/class-wc-subscription.php:2240 msgid "Invalid data. First parameter was empty when passed to update_dates()." msgstr "" -#: includes/class-wc-subscription.php:2246 +#: includes/class-wc-subscription.php:2247 msgid "" "Invalid data. First parameter has a date that is not in the registered date " "types." msgstr "" -#: includes/class-wc-subscription.php:2310 +#: includes/class-wc-subscription.php:2311 msgid "The %s date must occur after the cancellation date." msgstr "" -#: includes/class-wc-subscription.php:2315 +#: includes/class-wc-subscription.php:2316 msgid "The %s date must occur after the last payment date." msgstr "" -#: includes/class-wc-subscription.php:2319 +#: includes/class-wc-subscription.php:2320 msgid "The %s date must occur after the next payment date." msgstr "" -#: includes/class-wc-subscription.php:2324 +#: includes/class-wc-subscription.php:2325 msgid "The %s date must occur after the trial end date." msgstr "" -#: includes/class-wc-subscription.php:2328 +#: includes/class-wc-subscription.php:2329 msgid "The %s date must occur after the start date." msgstr "" -#: includes/class-wc-subscription.php:2357 +#: includes/class-wc-subscription.php:2358 #: includes/class-wc-subscriptions-checkout.php:313 #: includes/wcs-order-functions.php:279 msgid "Backordered" @@ -2153,27 +2153,27 @@ msgid "Weekly" msgstr "" #: includes/class-wcs-cart-initial-payment.php:56 -#: includes/class-wcs-cart-renewal.php:156 +#: includes/class-wcs-cart-renewal.php:176 msgid "That doesn't appear to be your order." msgstr "" -#: includes/class-wcs-cart-renewal.php:184 +#: includes/class-wcs-cart-renewal.php:204 msgid "Complete checkout to renew your subscription." msgstr "" -#: includes/class-wcs-cart-renewal.php:245 +#: includes/class-wcs-cart-renewal.php:285 #. translators: placeholder is an item name msgid "" "The %s product has been deleted and can no longer be renewed. Please choose " "a new product or contact us for assistance." msgstr "" -#: includes/class-wcs-cart-renewal.php:278 +#: includes/class-wcs-cart-renewal.php:319 #. translators: %s is subscription's number msgid "Subscription #%s has not been added to the cart." msgstr "" -#: includes/class-wcs-cart-renewal.php:409 +#: includes/class-wcs-cart-renewal.php:450 msgid "" "We couldn't find the original subscription for an item in your cart. The " "item was removed." @@ -2183,7 +2183,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: includes/class-wcs-cart-renewal.php:416 +#: includes/class-wcs-cart-renewal.php:457 msgid "" "We couldn't find the original renewal order for an item in your cart. The " "item was removed." @@ -2193,7 +2193,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: includes/class-wcs-cart-renewal.php:691 +#: includes/class-wcs-cart-renewal.php:732 msgid "All linked subscription items have been removed from the cart." msgstr "" @@ -2352,7 +2352,7 @@ msgid "Subscription Cancelled" msgstr "" #: includes/emails/class-wcs-email-cancelled-subscription.php:128 -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:183 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:180 #: includes/emails/class-wcs-email-expired-subscription.php:126 #: includes/emails/class-wcs-email-on-hold-subscription.php:126 msgid "Enable this email notification" @@ -2428,11 +2428,11 @@ msgid "" "download your files" msgstr "" -#: includes/emails/class-wcs-email-customer-payment-retry.php:27 +#: includes/emails/class-wcs-email-customer-payment-retry.php:24 msgid "Customer Payment Retry" msgstr "" -#: includes/emails/class-wcs-email-customer-payment-retry.php:28 +#: includes/emails/class-wcs-email-customer-payment-retry.php:25 msgid "" "Sent to a customer when an attempt to automatically process a subscription " "renewal payment has failed and a retry rule has been applied to retry the " @@ -2441,11 +2441,11 @@ msgid "" "for the renewal order manually instead of waiting for the automatic retry." msgstr "" -#: includes/emails/class-wcs-email-customer-payment-retry.php:35 +#: includes/emails/class-wcs-email-customer-payment-retry.php:32 msgid "Automatic payment failed for {order_number}, we will retry {retry_time}" msgstr "" -#: includes/emails/class-wcs-email-customer-payment-retry.php:36 +#: includes/emails/class-wcs-email-customer-payment-retry.php:33 msgid "Automatic payment failed for order {order_number}" msgstr "" @@ -2468,11 +2468,11 @@ msgstr "" msgid "Your {blogname} renewal order receipt from {order_date}" msgstr "" -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:31 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:28 msgid "Customer Renewal Invoice" msgstr "" -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:32 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:29 msgid "" "Sent to a customer when the subscription is due for renewal and the renewal " "requires a manual payment, either because it uses manual renewals or the " @@ -2481,11 +2481,11 @@ msgid "" "and payment links." msgstr "" -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:39 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:36 msgid "Invoice for renewal order {order_number} from {order_date}" msgstr "" -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:40 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:37 msgid "Invoice for renewal order {order_number}" msgstr "" @@ -3998,71 +3998,71 @@ msgstr "" msgid "Date type can not be an empty string." msgstr "" -#: woocommerce-subscriptions.php:239 +#: woocommerce-subscriptions.php:241 msgid "This is where subscriptions are stored." msgstr "" -#: woocommerce-subscriptions.php:283 +#: woocommerce-subscriptions.php:285 msgid "No Subscriptions found" msgstr "" -#: woocommerce-subscriptions.php:285 +#: woocommerce-subscriptions.php:287 msgid "" "Subscriptions will appear here for you to view and manage once purchased by " "a customer." msgstr "" -#: woocommerce-subscriptions.php:287 +#: woocommerce-subscriptions.php:289 #. translators: placeholders are opening and closing link tags msgid "%sLearn more about managing subscriptions »%s" msgstr "" -#: woocommerce-subscriptions.php:289 +#: woocommerce-subscriptions.php:291 #. translators: placeholders are opening and closing link tags msgid "%sAdd a subscription product »%s" msgstr "" -#: woocommerce-subscriptions.php:403 +#: woocommerce-subscriptions.php:405 msgid "" "A subscription renewal has been removed from your cart. Multiple " "subscriptions can not be purchased at the same time." msgstr "" -#: woocommerce-subscriptions.php:409 +#: woocommerce-subscriptions.php:411 msgid "" "A subscription has been removed from your cart. Due to payment gateway " "restrictions, different subscription products can not be purchased at the " "same time." msgstr "" -#: woocommerce-subscriptions.php:415 +#: woocommerce-subscriptions.php:417 msgid "" "A subscription has been removed from your cart. Products and subscriptions " "can not be purchased at the same time." msgstr "" -#: woocommerce-subscriptions.php:552 woocommerce-subscriptions.php:569 +#: woocommerce-subscriptions.php:554 woocommerce-subscriptions.php:571 #. translators: placeholder is a number, this is for the teens #. translators: placeholder is a number, numbers ending in 4-9, 0 msgid "%sth" msgstr "" -#: woocommerce-subscriptions.php:557 +#: woocommerce-subscriptions.php:559 #. translators: placeholder is a number, numbers ending in 1 msgid "%sst" msgstr "" -#: woocommerce-subscriptions.php:561 +#: woocommerce-subscriptions.php:563 #. translators: placeholder is a number, numbers ending in 2 msgid "%snd" msgstr "" -#: woocommerce-subscriptions.php:565 +#: woocommerce-subscriptions.php:567 #. translators: placeholder is a number, numbers ending in 3 msgid "%srd" msgstr "" -#: woocommerce-subscriptions.php:595 +#: woocommerce-subscriptions.php:597 #. translators: 1$-2$: opening and closing tags, 3$-4$: link tags, #. takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, #. leads to plugins.php in admin @@ -4072,7 +4072,7 @@ msgid "" "%5$sinstall & activate WooCommerce »%6$s" msgstr "" -#: woocommerce-subscriptions.php:602 +#: woocommerce-subscriptions.php:604 #. translators: 1$-2$: opening and closing tags, 3$-4$: opening and #. closing link tags, leads to plugin admin msgid "" @@ -4081,11 +4081,11 @@ msgid "" "WooCommerce to version 2.4 or newer »%4$s" msgstr "" -#: woocommerce-subscriptions.php:628 +#: woocommerce-subscriptions.php:630 msgid "Variable Subscription" msgstr "" -#: woocommerce-subscriptions.php:815 +#: woocommerce-subscriptions.php:817 #. translators: 1$-2$: opening and closing tags, 3$-4$: opening and #. closing link tags. Leads to duplicate site article on docs msgid "" @@ -4095,19 +4095,19 @@ msgid "" "environment. %3$sLearn more »%4$s." msgstr "" -#: woocommerce-subscriptions.php:817 +#: woocommerce-subscriptions.php:819 msgid "Quit nagging me (but don't enable automatic payments)" msgstr "" -#: woocommerce-subscriptions.php:818 +#: woocommerce-subscriptions.php:820 msgid "Enable automatic payments" msgstr "" -#: woocommerce-subscriptions.php:1024 +#: woocommerce-subscriptions.php:1026 msgid "Support" msgstr "" -#: woocommerce-subscriptions.php:1129 +#: woocommerce-subscriptions.php:1131 #. translators: placeholders are opening and closing tags. Leads to docs on #. version 2 msgid "" @@ -4118,14 +4118,14 @@ msgid "" "2.0 »%s" msgstr "" -#: woocommerce-subscriptions.php:1144 +#: woocommerce-subscriptions.php:1146 msgid "" "Warning! You are running version %s of WooCommerce Subscriptions plugin " "code but your database has been upgraded to Subscriptions version 2.0. This " "will cause major problems on your store." msgstr "" -#: woocommerce-subscriptions.php:1145 +#: woocommerce-subscriptions.php:1147 msgid "" "Please upgrade the WooCommerce Subscriptions plugin to version 2.0 or newer " "immediately. If you need assistance, after upgrading to Subscriptions v2.0, " @@ -4453,7 +4453,7 @@ msgctxt "original denotes there is no date to display" msgid "-" msgstr "" -#: includes/class-wc-subscription.php:2273 +#: includes/class-wc-subscription.php:2274 #. translators: placeholder is date type (e.g. "end", "next_payment"...) msgctxt "appears in an error message if date is wrong format" msgid "Invalid %s date. The date must be of the format: \"Y-m-d H:i:s\"." @@ -4694,7 +4694,7 @@ msgctxt "input field placeholder for day field for annual subscriptions" msgid "Day" msgstr "" -#: includes/class-wcs-cart-renewal.php:720 +#: includes/class-wcs-cart-renewal.php:761 msgctxt "" "Used in WooCommerce by removed item notification: \"_All linked " "subscription items were_ removed. Undo?\" Filter for item title." @@ -4786,7 +4786,7 @@ msgid "[%s] Subscription Cancelled" msgstr "" #: includes/emails/class-wcs-email-cancelled-subscription.php:126 -#: includes/emails/class-wcs-email-customer-renewal-invoice.php:181 +#: includes/emails/class-wcs-email-customer-renewal-invoice.php:178 #: includes/emails/class-wcs-email-expired-subscription.php:124 #: includes/emails/class-wcs-email-on-hold-subscription.php:124 msgctxt "an email notification" @@ -5021,7 +5021,7 @@ msgid "" msgstr "" #: includes/upgrades/templates/wcs-about-2-0.php:36 -#: woocommerce-subscriptions.php:1023 +#: woocommerce-subscriptions.php:1025 msgctxt "short for documents" msgid "Docs" msgstr "" @@ -5499,68 +5499,68 @@ msgctxt "The post title for the new subscription" msgid "Subscription – %s" msgstr "" -#: woocommerce-subscriptions.php:226 +#: woocommerce-subscriptions.php:228 msgctxt "custom post type setting" msgid "Add Subscription" msgstr "" -#: woocommerce-subscriptions.php:227 +#: woocommerce-subscriptions.php:229 msgctxt "custom post type setting" msgid "Add New Subscription" msgstr "" -#: woocommerce-subscriptions.php:228 +#: woocommerce-subscriptions.php:230 msgctxt "custom post type setting" msgid "Edit" msgstr "" -#: woocommerce-subscriptions.php:229 +#: woocommerce-subscriptions.php:231 msgctxt "custom post type setting" msgid "Edit Subscription" msgstr "" -#: woocommerce-subscriptions.php:230 +#: woocommerce-subscriptions.php:232 msgctxt "custom post type setting" msgid "New Subscription" msgstr "" -#: woocommerce-subscriptions.php:231 woocommerce-subscriptions.php:232 +#: woocommerce-subscriptions.php:233 woocommerce-subscriptions.php:234 msgctxt "custom post type setting" msgid "View Subscription" msgstr "" -#: woocommerce-subscriptions.php:235 +#: woocommerce-subscriptions.php:237 msgctxt "custom post type setting" msgid "No Subscriptions found in trash" msgstr "" -#: woocommerce-subscriptions.php:236 +#: woocommerce-subscriptions.php:238 msgctxt "custom post type setting" msgid "Parent Subscriptions" msgstr "" -#: woocommerce-subscriptions.php:303 +#: woocommerce-subscriptions.php:305 msgctxt "post status label including post count" msgid "Active (%s)" msgid_plural "Active (%s)" msgstr[0] "" msgstr[1] "" -#: woocommerce-subscriptions.php:304 +#: woocommerce-subscriptions.php:306 msgctxt "post status label including post count" msgid "Switched (%s)" msgid_plural "Switched (%s)" msgstr[0] "" msgstr[1] "" -#: woocommerce-subscriptions.php:305 +#: woocommerce-subscriptions.php:307 msgctxt "post status label including post count" msgid "Expired (%s)" msgid_plural "Expired (%s)" msgstr[0] "" msgstr[1] "" -#: woocommerce-subscriptions.php:306 +#: woocommerce-subscriptions.php:308 msgctxt "post status label including post count" msgid "Pending Cancellation (%s)" msgid_plural "Pending Cancellation (%s)" diff --git a/readme.txt b/readme.txt index 16e1e09..05f0fc2 100644 --- a/readme.txt +++ b/readme.txt @@ -6,4 +6,5 @@ Tested up to: 4.5 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html WC requires at least: 2.5 -WC tested up to: 3.0 \ No newline at end of file +WC tested up to: 3.1 +Woo: 27147:6115e6d7e297b623a169fdcf5728b224 \ No newline at end of file diff --git a/woocommerce-subscriptions.php b/woocommerce-subscriptions.php index a5cd2d5..199d615 100644 --- a/woocommerce-subscriptions.php +++ b/woocommerce-subscriptions.php @@ -5,7 +5,9 @@ * Description: Sell products and services with recurring payments in your WooCommerce Store. * Author: Prospress Inc. * Author URI: http://prospress.com/ - * Version: 2.2.10 + * Version: 2.2.11 + * + * Woo: 27147:6115e6d7e297b623a169fdcf5728b224 * * Copyright 2017 Prospress, Inc. (email : freedoms@prospress.com) * @@ -126,7 +128,7 @@ class WC_Subscriptions { public static $plugin_file = __FILE__; - public static $version = '2.2.10'; + public static $version = '2.2.11'; private static $total_subscription_count = null;