Updates to 6.1.0

This commit is contained in:
WooCommerce 2024-03-28 10:12:12 +00:00
parent e40fc0f53b
commit d3348c6c8f
30 changed files with 423 additions and 183 deletions

View File

@ -1,10 +1,26 @@
*** Woo Subscriptions Changelog ***
2024-03-28 - version 6.1.0
* Fix: Ensure the subscription renewal payment process doesn't attempt to reprocess previously paid renewal orders.
* Fix: Resolved an issue where discounts, when reapplied to failed or manual subscription order payments, would incorrectly account for inclusive tax.
* Fix: Resolved an issue that could cause an empty error notice to appear on the My Account > Payment methods page when a customer attempted to delete a token used by subscriptions.
* Fix: Make sure we always clear the subscription object from cache after updating dates.
* Fix: Use block theme styles for the 'Add to Cart' button on subscription product pages.
* Fix: Customer notes not being saved on the Edit Subscription page for stores with HPOS enabled.
* Fix: Ensure products that have a yearly billing period can choose a date that the subscription is synchronized to.
* Fix: Improved alignment of subscription product pricing fields on the edit product screen for consistency with other fields.
* Fix: Avoid setting empty meta keys on subscriptions when changing the customer's default payment method.
* Fix: Use a more scalable way to filter the orders admin list table by parent orders on HPOS stores.
* Fix: Resolved an issue that prevented subscription custom place order button labels from working on the block checkout.
* Update: Change the update all subscriptions checkbox displayed on the change payment method page to be enabled by default.
* Dev: Update subscriptions-core to 6.9.0
2024-02-08 - version 6.0.0
* Add: Subscription plugin settings can now be fetched via the /wc/v3/settings/subscriptions REST API endpoint.
* Fix: Trigger the subscription.updated webhook event for all subscription updates.
* Fix: Block the UI after a customer clicks actions on the My Account > Subscriptions page to prevent multiple requests from being sent.
* Fix: WC 8.6.0 compatibility: Resolved wc_get_log_file_path() deprecation warnings.
* Dev: Update subscriptions-core to 6.8.0
2024-01-17 - version 5.9.1
* Fix: Resolved an error that would occur with WooCommerce 8.5.0 when editing a subscription customer from the admin dashboard.

View File

@ -21,7 +21,7 @@ class WC_Subscriptions_Plugin extends WC_Subscriptions_Core_Plugin {
public function init() {
parent::init();
WC_Subscriptions_Switcher::init();
new WCS_Cart_Switch();
$this->add_cart_handler( new WCS_Cart_Switch() );
WCS_Manual_Renewal_Manager::init();
WCS_Customer_Suspension_Manager::init();
WCS_Drip_Downloads_Manager::init();
@ -72,7 +72,7 @@ class WC_Subscriptions_Plugin extends WC_Subscriptions_Core_Plugin {
require_once $this->get_plugin_directory( 'includes/early-renewal/wcs-early-renewal-functions.php' );
if ( WCS_Early_Renewal_Manager::is_early_renewal_enabled() ) {
new WCS_Cart_Early_Renewal();
$this->add_cart_handler( new WCS_Cart_Early_Renewal() );
}
}
}

View File

@ -77,8 +77,29 @@ class WC_Subscriptions_Payment_Gateways extends WC_Subscriptions_Core_Payment_Ga
throw new InvalidArgumentException( sprintf( __( 'Subscription doesn\'t exist in scheduled action: %d', 'woocommerce-subscriptions' ), $subscription_id ) );
}
// If the subscription's payment method uses gateway scheduled payments, don't process the payment here. The gateway will handle it.
if ( $subscription->payment_method_supports( 'gateway_scheduled_payments' ) ) {
return;
}
if ( ! $subscription->is_manual() && ! $subscription->has_status( wcs_get_subscription_ended_statuses() ) ) {
self::trigger_gateway_renewal_payment_hook( $subscription->get_last_order( 'all', 'renewal' ) );
$latest_renewal_order = $subscription->get_last_order( 'all', 'renewal' );
if ( empty( $latest_renewal_order ) ) {
return;
}
if ( $latest_renewal_order->needs_payment() ) {
self::trigger_gateway_renewal_payment_hook( $latest_renewal_order );
} elseif ( $latest_renewal_order->get_total() > 0 ) {
$subscription->add_order_note(
sprintf(
/* Translators: placeholder is a subscription renewal order ID as a link */
__( 'Payment processing of the renewal order %s was skipped because it is already paid.', 'woocommerce_subscriptions' ),
'<a href="' . esc_url( $latest_renewal_order->get_edit_order_url() ) . '">' . _x( '#', 'hash before order number', 'woocommerce' ) . $latest_renewal_order->get_order_number() . '</a>'
)
);
}
}
}
@ -91,7 +112,7 @@ class WC_Subscriptions_Payment_Gateways extends WC_Subscriptions_Core_Payment_Ga
public static function trigger_gateway_renewal_payment_hook( $renewal_order ) {
if ( ! empty( $renewal_order ) && $renewal_order->get_total() > 0 && $renewal_order->get_payment_method() ) {
// Make sure gateways are setup
// Make sure gateways are setup.
WC()->payment_gateways();
do_action( 'woocommerce_scheduled_subscription_payment_' . $renewal_order->get_payment_method(), $renewal_order->get_total(), $renewal_order );

View File

@ -2,16 +2,16 @@
# This file is distributed under the same license as the Woo Subscriptions plugin.
msgid ""
msgstr ""
"Project-Id-Version: Woo Subscriptions 6.0.0\n"
"Project-Id-Version: Woo Subscriptions 6.1.0\n"
"Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-02-08T06:42:10+00:00\n"
"POT-Creation-Date: 2024-03-28T06:13:35+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.8.1\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: woocommerce-subscriptions\n"
#. Plugin Name of the plugin
@ -54,8 +54,8 @@ msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-system-status.php:59
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:38
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:80
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:336
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:349
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:372
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:385
#: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:108
#: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:133
#: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:289
@ -1029,7 +1029,7 @@ msgid "Add a Subscription Product"
msgstr ""
#: includes/class-wc-subscriptions-plugin.php:223
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:512
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:548
#: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php:35
#: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about.php:34
msgid "Settings"
@ -1390,7 +1390,7 @@ msgid "Subscription doesn't exist in scheduled action: %d"
msgstr ""
#. translators: $1-$2: opening and closing tags. Link to documents->payment gateways, 3$-4$: opening and closing tags. Link to WooCommerce extensions shop page
#: includes/gateways/class-wc-subscriptions-payment-gateways.php:129
#: includes/gateways/class-wc-subscriptions-payment-gateways.php:150
msgid "Find new gateways that %1$ssupport automatic subscription payments%2$s in the official %3$sWooCommerce Marketplace%4$s."
msgstr ""
@ -2140,7 +2140,7 @@ msgid "Manage Subscriptions"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:1008
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:345
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:381
msgid "Search Subscriptions"
msgstr ""
@ -2442,7 +2442,7 @@ msgid "Status"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:463
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:337
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:373
#: vendor/woocommerce/subscriptions-core/templates/emails/cancelled-subscription.php:21
#: vendor/woocommerce/subscriptions-core/templates/emails/expired-subscription.php:21
#: vendor/woocommerce/subscriptions-core/templates/emails/on-hold-subscription.php:21
@ -2900,13 +2900,13 @@ msgid "Customer's notes about the order"
msgstr ""
#. translators: %s: parent order number (linked to its details screen).
#: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php:425
#: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php:430
msgctxt "subscription note after linking to a parent order"
msgid "Subscription linked to parent order %s via admin."
msgstr ""
#. translators: placeholder is error message from the payment gateway or subscriptions when updating the status
#: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php:440
#: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php:445
msgid "Error updating some information: %s"
msgstr ""
@ -3343,53 +3343,53 @@ msgstr ""
msgid "Purchasing a subscription product requires an account. Please go to the %1$sMy Account%2$s page to login or contact us if you need assistance."
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:338
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:374
msgctxt "custom post type setting"
msgid "Add Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:339
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:375
msgctxt "custom post type setting"
msgid "Add New Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:340
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:376
msgctxt "custom post type setting"
msgid "Edit"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:341
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:377
msgctxt "custom post type setting"
msgid "Edit Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:342
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:378
msgctxt "custom post type setting"
msgid "New Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:343
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:344
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:379
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:380
msgctxt "custom post type setting"
msgid "View Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:347
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:383
msgctxt "custom post type setting"
msgid "No Subscriptions found in trash"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:348
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:384
msgctxt "custom post type setting"
msgid "Parent Subscriptions"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:351
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:387
msgid "This is where subscriptions are stored."
msgstr ""
#. translators: placeholder is a post count.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:409
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:445
msgctxt "post status label including post count"
msgid "Active <span class=\"count\">(%s)</span>"
msgid_plural "Active <span class=\"count\">(%s)</span>"
@ -3397,7 +3397,7 @@ msgstr[0] ""
msgstr[1] ""
#. translators: placeholder is a post count.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:411
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:447
msgctxt "post status label including post count"
msgid "Switched <span class=\"count\">(%s)</span>"
msgid_plural "Switched <span class=\"count\">(%s)</span>"
@ -3405,7 +3405,7 @@ msgstr[0] ""
msgstr[1] ""
#. translators: placeholder is a post count.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:413
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:449
msgctxt "post status label including post count"
msgid "Expired <span class=\"count\">(%s)</span>"
msgid_plural "Expired <span class=\"count\">(%s)</span>"
@ -3413,29 +3413,29 @@ msgstr[0] ""
msgstr[1] ""
#. translators: placeholder is a post count.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:415
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:451
msgctxt "post status label including post count"
msgid "Pending Cancellation <span class=\"count\">(%s)</span>"
msgid_plural "Pending Cancellation <span class=\"count\">(%s)</span>"
msgstr[0] ""
msgstr[1] ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:464
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:500
msgid "Variable Subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:513
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:549
#: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php:36
msgctxt "short for documents"
msgid "Docs"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:514
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:550
msgid "Support"
msgstr ""
#. translators: placeholders are opening and closing tags. Leads to docs on version 2
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:537
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:573
msgid "Warning! Version 2.0 is a major update to the WooCommerce Subscriptions extension. Before updating, please create a backup, update all WooCommerce extensions and test all plugins, custom code and payment gateways with version 2.0 on a staging site. %1$sLearn more about the changes in version 2.0 &raquo;%2$s"
msgstr ""
@ -3841,75 +3841,75 @@ msgstr ""
msgid "Date Changed"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:345
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:347
msgid "Your subscription will be activated when payment clears."
msgid_plural "Your subscriptions will be activated when payment clears."
msgstr[0] ""
msgstr[1] ""
#. translators: placeholders are opening and closing link tags
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:352
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:354
msgid "View the status of your subscription in %1$syour account%2$s."
msgid_plural "View the status of your subscriptions in %1$syour account%2$s."
msgstr[0] ""
msgstr[1] ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:415
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:417
msgid "Subscription Relationship"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:498
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:517
msgid "Payment completed on order after subscription was cancelled."
msgstr ""
#. translators: $1: opening link tag, $2: order number, $3: closing link tag
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:1060
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:1085
msgid "Subscription cancelled for refunded order %1$s#%2$s%3$s."
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2327
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2381
msgctxt "An order type"
msgid "Original"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2328
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2382
msgctxt "An order type"
msgid "Subscription Parent"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2329
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2383
msgctxt "An order type"
msgid "Subscription Renewal"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2330
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2384
msgctxt "An order type"
msgid "Subscription Resubscribe"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2331
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2385
msgctxt "An order type"
msgid "Subscription Switch"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2332
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2386
msgctxt "An order type"
msgid "Non-subscription"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2341
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2395
msgid "All orders types"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2368
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2422
msgid "Renewal Order"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2370
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2424
msgid "Resubscribe Order"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2372
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php:2426
msgid "Parent Order"
msgstr ""
@ -4083,43 +4083,36 @@ msgstr ""
msgid "Month for Synchronisation"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:315
#: vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php:36
#: vendor/woocommerce/subscriptions-core/templates/admin/html-variation-synchronisation.php:42
msgctxt "input field placeholder for day field for annual subscriptions"
msgid "Day"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:746
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:763
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:752
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:769
msgid "Do not synchronise"
msgstr ""
#. translators: placeholder is a day of the week
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:771
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:777
msgid "%s each week"
msgstr ""
#. translators: placeholder is a number of day with language specific suffix applied (e.g. "1st", "3rd", "5th", etc...)
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:777
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:783
msgid "%s day of the month"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:779
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:785
msgid "Last day of the month"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:827
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:833
msgid "Today!"
msgstr ""
#. translators: placeholder is a date
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:834
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:840
msgid "First payment prorated. Next payment: %s"
msgstr ""
#. translators: placeholder is a date
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:837
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php:843
msgid "First payment: %s"
msgstr ""
@ -6166,7 +6159,7 @@ msgid "no"
msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/wcs-user-functions.php:319
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php:30
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php:29
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php:28
msgid "Resubscribe"
msgstr ""
@ -6215,6 +6208,12 @@ msgstr ""
msgid "Synchronise Renewals"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php:36
#: vendor/woocommerce/subscriptions-core/templates/admin/html-variation-synchronisation.php:42
msgctxt "input field placeholder for day field for annual subscriptions"
msgid "Day"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/admin/deprecated/order-shipping-html.php:8
msgid "Label"
msgstr ""
@ -6286,30 +6285,30 @@ msgstr ""
msgid "There are no shipping methods available. Please double check your address, or contact us if you need any help."
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:20
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:19
#: vendor/woocommerce/subscriptions-core/templates/emails/email-order-details.php:36
#: vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php:21
msgctxt "table headings in notification email"
msgid "Product"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:21
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:20
#: vendor/woocommerce/subscriptions-core/templates/emails/email-order-details.php:37
msgctxt "table headings in notification email"
msgid "Quantity"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:22
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:21
msgctxt "table headings in notification email"
msgid "Totals"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:47
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:46
msgctxt "text on button on checkout page"
msgid "Change payment method"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:49
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:48
msgctxt "text on button on checkout page"
msgid "Add payment method"
msgstr ""
@ -6320,7 +6319,7 @@ msgstr ""
#. translators: $1: opening <strong> tag, $2: closing </strong> tag
#: vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php:92
msgid "Update the payment method used for %1$sall%2$s of my current subscriptions"
msgid "Use this payment method for %1$sall%2$s of my current subscriptions"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/checkout/recurring-subscription-totals.php:18
@ -6814,7 +6813,7 @@ msgstr ""
msgid "Subscription totals"
msgstr ""
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php:32
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php:31
#: vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php:30
msgid "You have an active subscription to this product already."
msgstr ""

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit355d724f37b9eb5e851f078727e57a07::getLoader();
return ComposerAutoloaderInite5f25043b4323431d48e7e46b04aa2c9::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit355d724f37b9eb5e851f078727e57a07
class ComposerAutoloaderInite5f25043b4323431d48e7e46b04aa2c9
{
private static $loader;
@ -24,12 +24,12 @@ class ComposerAutoloaderInit355d724f37b9eb5e851f078727e57a07
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit355d724f37b9eb5e851f078727e57a07', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite5f25043b4323431d48e7e46b04aa2c9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit355d724f37b9eb5e851f078727e57a07', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite5f25043b4323431d48e7e46b04aa2c9', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit355d724f37b9eb5e851f078727e57a07::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite5f25043b4323431d48e7e46b04aa2c9::getInitializer($loader));
$loader->register(true);

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit355d724f37b9eb5e851f078727e57a07
class ComposerStaticInite5f25043b4323431d48e7e46b04aa2c9
{
public static $prefixLengthsPsr4 = array (
'C' =>
@ -129,9 +129,9 @@ class ComposerStaticInit355d724f37b9eb5e851f078727e57a07
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit355d724f37b9eb5e851f078727e57a07::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit355d724f37b9eb5e851f078727e57a07::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit355d724f37b9eb5e851f078727e57a07::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInite5f25043b4323431d48e7e46b04aa2c9::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite5f25043b4323431d48e7e46b04aa2c9::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite5f25043b4323431d48e7e46b04aa2c9::$classMap;
}, null, ClassLoader::class);
}

View File

@ -156,17 +156,17 @@
},
{
"name": "woocommerce/subscriptions-core",
"version": "6.8.0",
"version_normalized": "6.8.0.0",
"version": "6.9.0",
"version_normalized": "6.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/woocommerce-subscriptions-core.git",
"reference": "19d4f2acf246c7f8275438c9356eb79a141bdf4d"
"reference": "baf73669ba923b544aec87421282b753e277171f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/19d4f2acf246c7f8275438c9356eb79a141bdf4d",
"reference": "19d4f2acf246c7f8275438c9356eb79a141bdf4d",
"url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/baf73669ba923b544aec87421282b753e277171f",
"reference": "baf73669ba923b544aec87421282b753e277171f",
"shasum": ""
},
"require": {
@ -179,7 +179,7 @@
"woocommerce/woocommerce-sniffs": "0.1.0",
"yoast/phpunit-polyfills": "1.1.0"
},
"time": "2024-02-08T06:17:51+00:00",
"time": "2024-03-28T05:12:56+00:00",
"type": "wordpress-plugin",
"extra": {
"phpcodesniffer-search-depth": 2
@ -209,7 +209,7 @@
"description": "Sell products and services with recurring payments in your WooCommerce Store.",
"homepage": "https://github.com/Automattic/woocommerce-subscriptions-core",
"support": {
"source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/6.8.0",
"source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/6.9.0",
"issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues"
},
"install-path": "../woocommerce/subscriptions-core"

View File

@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'woocommerce/woocommerce-subscriptions',
'pretty_version' => 'dev-release/6.0.0',
'version' => 'dev-release/6.0.0',
'reference' => 'b739a4cf35dc85bdd84a335c27295258c480fc4e',
'pretty_version' => 'dev-release/6.1.0',
'version' => 'dev-release/6.1.0',
'reference' => 'a609ac6f082f5fff09d0059eebcc48aa11229f58',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -32,18 +32,18 @@
),
),
'woocommerce/subscriptions-core' => array(
'pretty_version' => '6.8.0',
'version' => '6.8.0.0',
'reference' => '19d4f2acf246c7f8275438c9356eb79a141bdf4d',
'pretty_version' => '6.9.0',
'version' => '6.9.0.0',
'reference' => 'baf73669ba923b544aec87421282b753e277171f',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../woocommerce/subscriptions-core',
'aliases' => array(),
'dev_requirement' => false,
),
'woocommerce/woocommerce-subscriptions' => array(
'pretty_version' => 'dev-release/6.0.0',
'version' => 'dev-release/6.0.0',
'reference' => 'b739a4cf35dc85bdd84a335c27295258c480fc4e',
'pretty_version' => 'dev-release/6.1.0',
'version' => 'dev-release/6.1.0',
'reference' => 'a609ac6f082f5fff09d0059eebcc48aa11229f58',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@ -77,6 +77,28 @@ a.close-subscriptions-search {
display: block;
width: 50%;
}
/* Variation Subscription Product Sync Settings */
.variable_subscription_sync .subscription_sync_annual > .select2-container {
max-width: 48%;
}
.variable_subscription_sync .subscription_sync_annual > .select2-container:last-child {
float: right;
}
#woocommerce-product-data .variable_subscription_pricing ._subscription_length_field .wc_input_subscription_length + .select2,
#woocommerce-product-data .variable_subscription_sync .subscription_sync_week_month .wc_input_subscription_payment_sync + .select2 {
width: 100% !important;
}
/* Simple Subscription Product Sync Settings */
._subscription_trial_length_field .select2-container:last-child,
#general_product_data .subscription_sync_annual .select2-container:last-child {
width: 45% !important;
margin-left: 5%;
}
._subscription_trial_length_field .select2-container:not( :last-child ),
#general_product_data .subscription_sync_annual .select2-container:not( :last-child ) {
width: 50% !important;
}
@media only screen and ( max-width: 1280px ) {
.woocommerce_options_panel ._subscription_price_fields .wrap,
.woocommerce_options_panel ._subscription_trial_length_field .wrap,
@ -88,11 +110,9 @@ a.close-subscriptions-search {
}
.woocommerce_options_panel ._subscription_price_fields .wrap input,
.woocommerce_options_panel ._subscription_price_fields .wrap select {
width: 30.75%;
margin-right: 3.8%;
width: 30%;
margin-right: 5%;
}
.woocommerce_options_panel ._subscription_trial_length_field .wrap input,
.woocommerce_options_panel ._subscription_trial_length_field .wrap select,
.woocommerce_options_panel
._subscription_payment_sync_date_day_field
.wrap
@ -301,23 +321,25 @@ a.close-subscriptions-search {
width: auto !important;
}
.wc_input_subscription_payment_sync +.select2,
.wc_input_subscription_length +.select2,
#woocommerce-product-data .wc_input_subscription_length +.select2,
#woocommerce-product-data .wc_input_subscription_payment_sync +.select2,
#_subscription_limit +.select2 {
min-width: 180px;
width: 80% !important;
width: 50% !important;
margin-bottom: 4px;
}
.wc_input_subscription_period + .select2,
.wc_input_subscription_period + .select2 {
width: 30% !important;
margin-top: 0;
}
.wc_input_subscription_trial_period + .select2 {
width: 30.75% !important;
width: 50% !important;
margin-top: 0;
}
.wc_input_subscription_period_interval + .select2 {
margin-right: 3.8%;
width: 30.75% !important;
#general_product_data .wc_input_subscription_period_interval + .select2 {
margin-right: 5%;
width: 30% !important;
}
.variable_subscription_sync p._subscription_payment_sync_field {
@ -363,31 +385,38 @@ a.close-subscriptions-search {
.wc_input_subscription_price,
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_period_interval {
max-width: 33%;
.wc_input_subscription_period + .select2,
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_period_interval + .select2 {
width: calc( 100% / 3 ) !important;
float: left;
margin-right: 2px;
}
#variable_product_options .select2 {
margin: 2px 2px 0 0;
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_period + .select2,
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_period_interval + .select2 {
padding-bottom: 2px;
margin-top: 2px;
}
#variable_product_options
.select2-container
.select2-container
.select2-selection--single {
min-height: 40px;
}
#variable_product_options
.select2-container
.select2-selection--single
#variable_product_options
.select2-container
.select2-selection--single
.select2-selection__rendered {
line-height: 36px;
}
#variable_product_options
.select2-container
.select2-selection--single
#variable_product_options
.select2-container
.select2-selection--single
.select2-selection__arrow {
height: 36px;
}
@ -406,13 +435,14 @@ a.close-subscriptions-search {
}
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_trial_period,
.wc_input_subscription_trial_period + .select2,
#variable_product_options
.variable_subscription_pricing_2_3
.wc_input_subscription_trial_length {
max-width: 50%;
width: 50%;
}
.variable_subscription_pricing_2_3 .wc_input_subscription_trial_period {
.variable_subscription_pricing_2_3 .wc_input_subscription_trial_period + .select2 {
margin-top: 2px;
float: right;
}
.variable_subscription_pricing_2_3 .variable_subscription_length,

View File

@ -708,16 +708,21 @@ jQuery( function ( $ ) {
);
if ( 0 < $( this ).val() ) {
$syncDayOfMonthInput
.val( 1 )
.attr( {
step: '1',
min: '1',
max: $.daysInMonth( $( this ).val() ),
} )
.prop( 'disabled', false );
// Clear existing options.
$syncDayOfMonthInput.empty();
// Add options for each day in the month.
for ( var day = 1; day <= $.daysInMonth( $( this ).val() ); day++ ) {
$syncDayOfMonthInput.append( $( '<option>', {
value: day,
text: day
} ) );
}
$syncDayOfMonthInput.prop( 'disabled', false );
} else {
$syncDayOfMonthInput.val( 0 ).trigger( 'change' );
$syncDayOfMonthInput.prop( 'disabled', true );
}
}
);

View File

@ -5,15 +5,18 @@ jQuery( function ( $ ) {
$( '.wcs_deletion_error' ).on( 'click', function ( e ) {
e.preventDefault();
var notice_content_container = $( '#wcs_delete_token_warning' ).find( 'li' );
// For block based WC notices we need to find the notice content container.
if ( $( '#wcs_delete_token_warning' ).find( '.wc-block-components-notice-banner' ).length > 0 ) {
notice_content_container = $( '#wcs_delete_token_warning' ).find( '.wc-block-components-notice-banner__content' );
}
// Use the href to determine which notice needs to be displayed.
if ( '#choose_default' === $( this ).attr( 'href' ) ) {
$( '#wcs_delete_token_warning' )
.find( 'li' )
.html( wcs_payment_methods.choose_default_error );
notice_content_container.html( wcs_payment_methods.choose_default_error );
} else {
$( '#wcs_delete_token_warning' )
.find( 'li' )
.html( wcs_payment_methods.add_method_error );
notice_content_container.html( wcs_payment_methods.add_method_error );
}
// Display the notice.

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wc-blocks-checkout', 'wc-price-format', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '5386ce4810e198e8d50d4e1491067c34');
<?php return array('dependencies' => array('wc-blocks-checkout', 'wc-price-format', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'b439c53b9fc89572bb98cb7ea362b3e0');

View File

@ -1,4 +1,4 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,n),c.l=!0,c.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(r,c,function(t){return e[t]}.bind(null,c));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t,n){var r=n(7);e.exports=function(e,t){if(null==e)return{};var n,c,i=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(c=0;c<o.length;c++)n=o[c],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t){e.exports=window.wp.plugins},function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,c={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(c[n]=e[n]);return c}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),c=n(4),i=n(2),o=n(3),s=n.n(o),l=n(0),a=n(5),u=n(6);function p(e){return{day:Object(l._nx)("day","days",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),week:Object(l._nx)("week","weeks",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),month:Object(l._nx)("month","months",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),year:Object(l._nx)("year","years",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions")}}function b(e,t,n){var r=e.billing_interval,c=e.billing_period,i=p(r)[c];switch(t=t.trim(),r){case 1:return"".concat(n," ").concat(t," ").concat(i);default:return Object(l.sprintf)(
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,n),c.l=!0,c.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(r,c,function(t){return e[t]}.bind(null,c));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t,n){var r=n(7);e.exports=function(e,t){if(null==e)return{};var n,c,i=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(c=0;c<o.length;c++)n=o[c],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.plugins},function(e,t){e.exports=window.wc.priceFormat},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,c={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(c[n]=e[n]);return c}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),c=n(5),i=n(2),o=n(3),s=n.n(o),l=n(0),a=n(6),u=n(4);function p(e){return{day:Object(l._nx)("day","days",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),week:Object(l._nx)("week","weeks",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),month:Object(l._nx)("month","months",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions"),year:Object(l._nx)("year","years",e,"Used in recurring totals section in Cart. 2+ will need plural, 1 will need singular.","woocommerce-subscriptions")}}function b(e,t,n){var r=e.billing_interval,c=e.billing_period,i=p(r)[c];switch(t=t.trim(),r){case 1:return"".concat(n," ").concat(t," ").concat(i);default:return Object(l.sprintf)(
/*
* translators: %1$s is the price of the product. %2$s is the separator used e.g "every" or "/",
* %3$d is the length, %4$s is week, month, year
@ -23,4 +23,4 @@ Object(l.__)("%1$s (%2$s)","woocommerce-subscriptions"),e,function(e){switch(e){
/* translators: %s is the subscription price to pay immediately (ie: $10). */
Object(l.__)("Due today %s","woocommerce-subscriptions"),e):Object(l.sprintf)(
/* translators: %s is the subscription price to pay immediately (ie: $10). */
Object(l.__)("%s due today","woocommerce-subscriptions"),e):e}})}]);
Object(l.__)("%s due today","woocommerce-subscriptions"),e):e},placeOrderButtonLabel:function(e){var t=Object(u.getSetting)("subscriptions_data");return null!=t&&t.place_order_override?null==t?void 0:t.place_order_override:e}})}]);

View File

@ -1,5 +1,18 @@
*** WooCommerce Subscriptions Core Changelog ***
= 6.9.0 - 2024-03-28 =
* Fix - Resolved an issue where discounts, when reapplied to failed or manual subscription order payments, would incorrectly account for inclusive tax.
* Fix - Resolved an issue that could cause an empty error notice to appear on the My Account > Payment methods page when a customer attempted to delete a token used by subscriptions.
* Fix - Make sure we always clear the subscription object from cache after updating dates.
* Fix - Use block theme styles for the 'Add to Cart' button on subscription product pages.
* Fix - Customer notes not being saved on the Edit Subscription page for stores with HPOS enabled.
* Fix - Ensure products that have a yearly billing period can choose a date that the subscription is synchronized to.
* Fix - Improved alignment of subscription product pricing fields on the edit product screen for consistency with other fields.
* Fix - Avoid setting empty meta keys on subscriptions when changing the customer's default payment method.
* Fix - Use a more scalable way to filter the orders admin list table by parent orders on HPOS stores.
* Fix - Resolved an issue that prevented subscription custom place order button labels from working on the block checkout.
* Update - Change the update all subscriptions checkbox displayed on the change payment method page to be enabled by default.
= 6.8.0 - 2024-02-08 =
* Fix - Block the UI after a customer clicks actions on the My Account > Subscriptions page to prevent multiple requests from being sent.
* Fix - WC 8.6.0 compatibility: Resolved wc_get_log_file_path() deprecation warnings.

View File

@ -408,6 +408,11 @@ class WCS_Meta_Box_Subscription_Data extends WC_Meta_Box_Order_Data {
}
}
// Customer note.
if ( isset( $_POST['excerpt'] ) ) {
$props['customer_note'] = sanitize_textarea_field( wp_unslash( $_POST['excerpt'] ) );
}
$subscription->set_props( $props );
$subscription->save();

View File

@ -16,7 +16,7 @@ class WC_Subscriptions_Core_Plugin {
* The version of subscriptions-core library.
* @var string
*/
protected $library_version = '6.8.0'; // WRCS: DEFINED_VERSION.
protected $library_version = '6.9.0'; // WRCS: DEFINED_VERSION.
/**
* The subscription scheduler instance.
@ -46,6 +46,16 @@ class WC_Subscriptions_Core_Plugin {
*/
protected static $instance = null;
/**
* An array of cart handler objects.
*
* Use @see WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( '{class}' ) to fetch a cart handler instance.
* eg WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( 'WCS_Cart_Renewal' ).
*
* @var WCS_Cart_Renewal[]
*/
protected $cart_handlers = [];
/**
* Initialise class and attach callbacks.
*/
@ -121,9 +131,9 @@ class WC_Subscriptions_Core_Plugin {
WCS_PayPal_Standard_Change_Payment_Method::init();
WC_Subscriptions_Tracker::init();
WCS_Upgrade_Logger::init();
new WCS_Cart_Renewal();
new WCS_Cart_Resubscribe();
new WCS_Cart_Initial_Payment();
$this->add_cart_handler( new WCS_Cart_Renewal() );
$this->add_cart_handler( new WCS_Cart_Resubscribe() );
$this->add_cart_handler( new WCS_Cart_Initial_Payment() );
WCS_Download_Handler::init();
WCS_Limiter::init();
WCS_Admin_System_Status::init();
@ -319,6 +329,32 @@ class WC_Subscriptions_Core_Plugin {
return 'WC_Subscriptions_Core_Payment_Gateways';
}
/**
* Gets the cart handler instance.
*
* @param string $class The class name of the cart handler. eg 'WCS_Cart_Renewal'.
* @return WCS_Cart_Renewal|null The cart handler instance or null if not found.
*/
public function get_cart_handler( $class ) {
if ( ! isset( $this->cart_handlers[ $class ] ) ) {
return null;
}
return $this->cart_handlers[ $class ];
}
/**
* Adds a cart handler instance.
*
* This is used to add cart handlers for different cart types. For example, renewal, resubscribe, initial, switch etc.
* To access a cart handler instance, use WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( $class ).
*
* @param WCS_Cart_Renewal $cart_handler An instance of a cart handler.
*/
protected function add_cart_handler( $cart_handler ) {
$this->cart_handlers[ get_class( $cart_handler ) ] = $cart_handler;
}
/**
* Registers Subscriptions order types.
*

View File

@ -75,6 +75,8 @@ class WC_Subscriptions_Order {
add_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( __CLASS__, 'add_subscription_order_query_args' ), 10, 2 );
add_filter( 'woocommerce_order_query_args', array( __CLASS__, 'map_order_query_args_for_subscriptions' ) );
add_filter( 'woocommerce_orders_table_query_clauses', [ __CLASS__, 'filter_orders_query_by_parent_orders' ], 10, 2 );
}
/*
@ -481,6 +483,23 @@ class WC_Subscriptions_Order {
$unpaid_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'on-hold', 'failed' ), $order );
$order_completed = in_array( $new_order_status, $paid_statuses, true ) && in_array( $old_order_status, $unpaid_statuses, true );
/**
* Filter whether the subscription order is considered completed.
*
* Allow third party extensions to modify whether the order is considered
* completed and the subscription should activate. This allows for different
* treatment of orders and subscriptions during the completion flow.
*
* @since 6.9.0
*
* @param bool $order_completed Whether the order is considered completed.
* @param string $new_order_status The new order status.
* @param string $old_order_status The old order status.
* @param WC_Subscription[] $subscriptions The subscriptions in the order.
* @param WC_Order $order The order object.
*/
$order_completed = apply_filters( 'wcs_is_subscription_order_completed', $order_completed, $new_order_status, $old_order_status, $subscriptions, $order );
foreach ( $subscriptions as $subscription ) {
// A special case where payment completes after user cancels subscription
if ( $order_completed && $subscription->has_status( 'cancelled' ) ) {
@ -800,9 +819,11 @@ class WC_Subscriptions_Order {
);
} elseif ( 'parent' === $selected_shop_order_subtype ) {
$order_query_args['post__in'] = wcs_get_subscription_orders();
if ( wcs_is_custom_order_tables_usage_enabled() ) {
$order_query_args['subscription_parent'] = true;
} else {
$order_query_args['post__in'] = wcs_get_subscription_orders();
}
} else {
switch ( $selected_shop_order_subtype ) {
@ -832,7 +853,11 @@ class WC_Subscriptions_Order {
// Also exclude parent orders from non-subscription query
if ( 'regular' === $selected_shop_order_subtype ) {
$order_query_args['post__not_in'] = wcs_get_subscription_orders();
if ( wcs_is_custom_order_tables_usage_enabled() ) {
$order_query_args['subscription_parent'] = false;
} else {
$order_query_args['post__not_in'] = wcs_get_subscription_orders();
}
}
return $order_query_args;
@ -1306,6 +1331,35 @@ class WC_Subscriptions_Order {
return $query_vars;
}
/**
* Modifies the query clauses of a wc_get_orders() query to include/exclude parent orders based on the 'subscription_parent' argument.
*
* @param array $query_clauses The query clauses.
* @param OrdersTableQuery $order_query The order query object.
*
* @return $query_clauses The modified query clauses to include/exclude parent orders.
*/
public static function filter_orders_query_by_parent_orders( $query_clauses, $order_query ) {
$include_parent_orders = $order_query->get( 'subscription_parent' );
// Bail if there's no argument to include/exclude parent orders.
if ( is_null( $include_parent_orders ) ) {
return $query_clauses;
}
if ( true === $include_parent_orders ) {
// Limit query to parent orders.
$query_clauses['join'] = ( empty( $query_clauses['join'] ) ? '' : $query_clauses['join'] . ' ' );
$query_clauses['join'] .= "INNER JOIN {$order_query->get_table_name( 'orders' )} as subscriptions ON subscriptions.parent_order_id = {$order_query->get_table_name( 'orders' )}.id AND subscriptions.type = 'shop_subscription'";
} elseif ( false === $include_parent_orders ) {
// Exclude parent orders.
$query_clauses['where'] = ( empty( $query_clauses['where'] ) ? '1=1 ' : $query_clauses['where'] . ' ' );
$query_clauses['where'] .= "AND {$order_query->get_table_name( 'orders' )}.id NOT IN (SELECT parent_order_id FROM {$order_query->get_table_name( 'orders' )} WHERE type = 'shop_subscription')";
}
return $query_clauses;
}
/* Deprecated Functions */
/**

View File

@ -312,7 +312,13 @@ class WC_Subscriptions_Synchroniser {
</select>
<?php $days_in_month = $payment_month ? gmdate( 't', wc_string_to_timestamp( "2001-{$payment_month}-01" ) ) : 0; ?>
<input type="number" id="<?php echo esc_attr( self::$post_meta_key_day ); ?>" name="<?php echo esc_attr( self::$post_meta_key_day ); ?>" class="wc_input_subscription_payment_sync wc-enhanced-select" value="<?php echo esc_attr( $payment_day ); ?>" placeholder="<?php echo esc_attr_x( 'Day', 'input field placeholder for day field for annual subscriptions', 'woocommerce-subscriptions' ); ?>" step="1" min="<?php echo esc_attr( min( 1, $days_in_month ) ); ?>" max="<?php echo esc_attr( $days_in_month ); ?>" <?php disabled( 0, $payment_month, true ); ?> />
<select id="<?php echo esc_attr( self::$post_meta_key_day ); ?>" name="<?php echo esc_attr( self::$post_meta_key_day ); ?>" class="wc_input_subscription_payment_sync wc-enhanced-select" <?php disabled( 0, $payment_month, true ); ?> />
<?php
foreach ( range( 1, $days_in_month ) as $day ) {
echo '<option value="' . esc_attr( $day ) . '"' . selected( $day, $payment_day, false ) . '>' . esc_html( $day ) . '</option>';
}
?>
</select>
</span>
<?php echo wcs_help_tip( self::$sync_description_year ); ?>
</p><?php

View File

@ -82,6 +82,7 @@ class WCS_Blocks_Integration implements IntegrationInterface {
public function get_script_data() {
return array(
'woocommerce-subscriptions-blocks' => 'active',
'place_order_override' => $this->get_place_order_button_text_override(),
);
}
@ -97,4 +98,36 @@ class WCS_Blocks_Integration implements IntegrationInterface {
}
return \WC_Subscriptions_Core_Plugin::instance()->get_library_version();
}
/**
* Fetches the place order button text if it has been overridden by one of Woo Subscription's methods.
*
* @return string|null The overridden place order button text or null if it hasn't been overridden.
*/
protected function get_place_order_button_text_override() {
$default = null;
$order_button_text = $default;
// Check if any of our button text override functions (hooked onto 'woocommerce_order_button_text') change the default text.
$callbacks = [
[ 'WC_Subscriptions_Checkout', 'order_button_text' ],
[ \WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( 'WCS_Cart_Renewal' ), 'order_button_text' ],
[ \WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( 'WCS_Cart_Switch' ), 'order_button_text' ],
[ \WC_Subscriptions_Core_Plugin::instance()->get_cart_handler( 'WCS_Cart_Resubscribe' ), 'order_button_text' ],
];
foreach ( $callbacks as $callback ) {
if ( ! is_callable( $callback ) ) {
continue;
}
$order_button_text = call_user_func( $callback, $default );
if ( $order_button_text !== $default ) {
break;
}
}
return $order_button_text;
}
}

View File

@ -1360,7 +1360,7 @@ class WCS_Cart_Renewal {
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.4.3
*/
public function setup_discounts( $order ) {
$order_discount = $order->get_total_discount();
$order_discount = $order->get_total_discount( ! $order->get_prices_include_tax() );
$coupon_items = $order->get_items( 'coupon' );
if ( empty( $order_discount ) && empty( $coupon_items ) ) {

View File

@ -30,23 +30,20 @@ class WCS_Payment_Tokens extends WC_Payment_Tokens {
public static function update_subscription_token( $subscription, $new_token, $old_token ) {
$token_payment_gateway = $old_token->get_gateway_id();
$payment_meta_table = self::get_subscription_payment_meta( $subscription, $token_payment_gateway );
$token_meta_key = '';
// Attempt to find the token meta key from the subscription payment meta and the old token.
if ( is_array( $payment_meta_table ) ) {
foreach ( $payment_meta_table as $meta ) {
foreach ( $meta as $meta_key => $meta_data ) {
if ( $old_token->get_token() === $meta_data['value'] ) {
$token_meta_key = $meta_key;
$subscription->update_meta_data( $meta_key, $new_token->get_token() );
$subscription->save();
break 2;
}
}
}
}
$subscription->update_meta_data( $token_meta_key, $new_token->get_token() );
$subscription->save();
// Copy the new token to the last renewal order if it needs payment so the retry system will pick up the new method.
$last_renewal_order = $subscription->get_last_order( 'all', 'renewal' );

View File

@ -796,6 +796,11 @@ class WCS_Orders_Table_Subscription_Data_Store extends \Automattic\WooCommerce\I
$dates_saved[ $date_prop ] = wcs_get_datetime_from( $subscription->get_time( $date_type ) );
}
// If dates were saved, clear the caches.
if ( ! empty( $dates_saved ) ) {
$this->clear_caches( $subscription );
}
return $dates_saved;
}

View File

@ -695,11 +695,11 @@ class WCS_PayPal_Reference_Transaction_API_Request {
* Format prices.
*
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.12
* @param float|int $price
* @param float|int|null $price
* @param int $decimals Optional. The number of decimal points.
* @return string
*/
private function price_format( $price, $decimals = 2 ) {
return number_format( $price, $decimals, '.', '' );
return number_format( (float) $price, $decimals, '.', '' );
}
}

View File

@ -36,6 +36,18 @@ class WCS_PayPal_Reference_Transaction_API extends WCS_SV_API_Base {
/** @var array the request parameters */
private $parameters = array();
/** @var string */
public $gateway_id;
/** @var string */
public $api_username;
/** @var string */
public $api_password;
/** @var string */
public $api_signature;
/**
* Constructor - setup request object and set endpoint
*

View File

@ -34,12 +34,16 @@ global $wp_locale;
<?php echo wcs_help_tip( WC_Subscriptions_Synchroniser::$sync_description_year ); ?>
</label>
<select name="variable_subscription_payment_sync_date_month[<?php echo esc_attr( $loop ); ?>]" class="wc_input_subscription_payment_sync wc_input_subscription_payment_sync_month wc-enhanced-select">
<?php foreach ( WC_Subscriptions_Synchroniser::get_year_sync_options() as $key => $value ) : ?>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $payment_month ); ?>><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
<?php foreach ( WC_Subscriptions_Synchroniser::get_year_sync_options() as $key => $value ) : ?>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $payment_month ); ?>><?php echo esc_html( $value ); ?></option>
<?php endforeach; ?>
</select>
<?php $days_in_month = $payment_month ? gmdate( 't', wc_string_to_timestamp( "2001-{$payment_month}-01" ) ) : 0; ?>
<select name="variable_subscription_payment_sync_date_day[<?php echo esc_attr( $loop ); ?>]" class="wc_input_subscription_payment_sync wc_input_subscription_payment_sync_day wc-enhanced-select form-row form-row-first" placeholder="<?php echo esc_attr_x( 'Day', 'input field placeholder for day field for annual subscriptions', 'woocommerce-subscriptions' ); ?>" <?php disabled( 0, $payment_month, true ); ?> />
<?php foreach ( range( 1, $days_in_month ) as $day ) {
echo '<option value="' . esc_attr( $day ) . '"' . selected( $day, $payment_day, false ) . '>' . esc_html( $day ) . '</option>';
} ?>
</select>
<?php $daysInMonth = $payment_month ? gmdate( 't', wc_string_to_timestamp( "2001-{$payment_month}-01" ) ) : 0; ?>
<input type="number" class="wc_input_subscription_payment_sync wc_input_subscription_payment_sync_day" name="variable_subscription_payment_sync_date_day[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $payment_day ); ?>" placeholder="<?php echo esc_attr_x( 'Day', 'input field placeholder for day field for annual subscriptions', 'woocommerce-subscriptions' ); ?>" step="1" min="<?php echo esc_attr( min( 1, $daysInMonth ) ); ?>" max="<?php echo esc_attr( $daysInMonth ); ?>" <?php disabled( 0, $payment_month, true ); ?> />
</div>
</div>
</div>

View File

@ -3,7 +3,6 @@
* Pay for order form displayed after a customer has clicked the "Change Payment method" button
* next to a subscription on their My Account page.
*
* @author Prospress
* @package WooCommerce/Templates
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.6.0
*/
@ -52,8 +51,9 @@ if ( ! defined( 'ABSPATH' ) ) {
$pay_order_button_text = apply_filters( 'woocommerce_change_payment_button_text', $pay_order_button_text );
$customer_subscription_ids = WCS_Customer_Store::instance()->get_users_subscription_ids( $subscription->get_customer_id() );
$payment_gateways_handler = WC_Subscriptions_Core_Plugin::instance()->get_gateways_handler_class();
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
if ( $available_gateways = WC()->payment_gateways->get_available_payment_gateways() ) :
if ( $available_gateways ) :
?>
<ul class="payment_methods methods">
<?php
@ -89,21 +89,21 @@ if ( ! defined( 'ABSPATH' ) ) {
<span class="update-all-subscriptions-payment-method-wrap">
<?php
// translators: $1: opening <strong> tag, $2: closing </strong> tag
$label = sprintf( esc_html__( 'Update the payment method used for %1$sall%2$s of my current subscriptions', 'woocommerce-subscriptions' ), '<strong>', '</strong>' );
$label = sprintf( esc_html__( 'Use this payment method for %1$sall%2$s of my current subscriptions', 'woocommerce-subscriptions' ), '<strong>', '</strong>' );
woocommerce_form_field(
'update_all_subscriptions_payment_method',
array(
'type' => 'checkbox',
'class' => array( 'form-row-wide' ),
'label' => $label,
'default' => apply_filters( 'wcs_update_all_subscriptions_payment_method_checked', false ),
'type' => 'checkbox',
'class' => array( 'form-row-wide' ),
'label' => $label,
'required' => true, // Making the field required to help make it more prominent on the page.
'default' => apply_filters( 'wcs_update_all_subscriptions_payment_method_checked', true ),
)
);
?>
</span>
<?php endif; ?>
<div class="form-row">
<?php wp_nonce_field( 'wcs_change_payment_method', '_wcsnonce', true, true ); ?>

View File

@ -2,7 +2,6 @@
/**
* Subscription Product Add to Cart
*
* @author Prospress
* @package WooCommerce-Subscriptions/Templates
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.6.0
*/
@ -39,16 +38,18 @@ if ( $product->is_in_stock() ) : ?>
<?php
do_action( 'woocommerce_before_add_to_cart_quantity' );
woocommerce_quantity_input( array(
'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.
) );
woocommerce_quantity_input(
[
'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // phpcs:ignore WordPress.Security.NonceVerification.Missing -- input var ok.
]
);
do_action( 'woocommerce_after_add_to_cart_quantity' );
?>
<button type="submit" class="single_add_to_cart_button button alt" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
<button type="submit" class="single_add_to_cart_button button alt<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>

View File

@ -6,5 +6,5 @@
* Author: Automattic
* Author URI: https://woocommerce.com/
* Requires WP: 5.6
* Version: 6.8.0
* Version: 6.9.0
*/

View File

@ -5,10 +5,10 @@
* Description: Sell products and services with recurring payments in your WooCommerce Store.
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Version: 6.0.0
* Version: 6.1.0
*
* WC requires at least: 7.7.0
* WC tested up to: 8.2.0
* WC tested up to: 8.7.0
* Woo: 27147:6115e6d7e297b623a169fdcf5728b224
*
* Copyright 2019 WooCommerce
@ -77,7 +77,7 @@ class WC_Subscriptions {
public static $plugin_file = __FILE__;
/** @var string */
public static $version = '6.0.0'; // WRCS: DEFINED_VERSION.
public static $version = '6.1.0'; // WRCS: DEFINED_VERSION.
/** @var string */
public static $wc_minimum_supported_version = '7.7';