From 60a125d93611b26d33920bc81bac8d97a704db52 Mon Sep 17 00:00:00 2001 From: WooCommerce Date: Wed, 18 Dec 2024 10:16:31 +0000 Subject: [PATCH] Updates to 7.0.0 --- changelog.txt | 8 + includes/admin/class-wcs-admin-reports.php | 28 -- .../class-wc-report-retention-rate.php | 20 - ...ass-wc-report-subscription-by-customer.php | 19 - ...lass-wc-report-subscription-by-product.php | 20 - ...-wc-report-subscription-events-by-date.php | 19 - ...s-wc-report-subscription-payment-retry.php | 18 - ...s-wc-report-upcoming-recurring-revenue.php | 19 - ...ss-wc-rest-subscriptions-v1-controller.php | 74 ---- includes/class-wcs-autoloader.php | 7 +- .../class-wcs-early-renewal-modal-handler.php | 6 +- .../class-wc-subscriptions-switcher.php | 404 ------------------ languages/woocommerce-subscriptions.pot | 113 +++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.json | 16 +- vendor/composer/installed.php | 18 +- .../assets/css/view-subscription.css | 5 + .../subscriptions-core/changelog.txt | 7 + ...lass-wc-product-subscription-variation.php | 2 +- .../class-wc-subscriptions-core-plugin.php | 2 +- .../class-wc-subscriptions-data-copier.php | 1 + .../includes/class-wc-subscriptions-order.php | 2 +- .../class-wc-subscriptions-product.php | 3 + .../class-wc-subscriptions-renewal-order.php | 3 +- .../includes/class-wcs-query.php | 2 +- .../includes/class-wcs-remove-item.php | 4 + .../includes/wcs-order-functions.php | 2 +- .../checkout/form-change-payment-method.php | 2 +- .../templates/myaccount/my-subscriptions.php | 2 +- .../templates/myaccount/related-orders.php | 2 +- .../myaccount/related-subscriptions.php | 2 +- .../myaccount/subscription-details.php | 12 +- .../add-to-cart/subscription.php | 2 +- .../add-to-cart/variable-subscription.php | 2 +- .../woocommerce-subscriptions-core.php | 2 +- woocommerce-subscriptions.php | 4 +- 38 files changed, 139 insertions(+), 731 deletions(-) delete mode 100644 includes/admin/reports/deprecated/class-wc-report-retention-rate.php delete mode 100644 includes/admin/reports/deprecated/class-wc-report-subscription-by-customer.php delete mode 100644 includes/admin/reports/deprecated/class-wc-report-subscription-by-product.php delete mode 100644 includes/admin/reports/deprecated/class-wc-report-subscription-events-by-date.php delete mode 100644 includes/admin/reports/deprecated/class-wc-report-subscription-payment-retry.php delete mode 100644 includes/admin/reports/deprecated/class-wc-report-upcoming-recurring-revenue.php diff --git a/changelog.txt b/changelog.txt index 924478a..d28d40f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,13 @@ *** WooCommerce Subscriptions Changelog *** +2024-12-16 - version 7.0.0 +* Fix: Prevent failing non-recent renewal order from suspending the subscription and marking the most recent renewal order as failed. +* Fix: Use block theme-styled buttons for subscription and related-orders actions on My Account pages. +* Fix: Subscription totals not properly updating when customers remove items via the My Account > View Subscription page on some stores with caching enabled. +* Fix: Resolved unexpected errors during the renewal process when a subscription contains metadata with key "id". +* Update: Changed the link on the order thank-you page to take customers directly to their "My Account > Subscriptions" page. +* Dev: Update subscriptions-core to 7.8.0 + 2024-11-27 - version 6.9.1 * Fix: Resolved compatibility issues with WordPress 6.7 caused by translating strings too early. * Dev: Update subscriptions-core to 7.7.2 diff --git a/includes/admin/class-wcs-admin-reports.php b/includes/admin/class-wcs-admin-reports.php index a7be91d..1853abc 100644 --- a/includes/admin/class-wcs-admin-reports.php +++ b/includes/admin/class-wcs-admin-reports.php @@ -223,32 +223,4 @@ public static function get_report( $name ) { WC_Tracks::record_event( $reports[ $name ], $properties ); } } - - /** - * If we hit one of our reports in the WC get_report function, change the path to our dir. - * - * @param string $report_path the parth to the report. - * @param string $name the name of the report. - * @param string $class the class of the report. - * - * @return string path to the report template. - * @since 2.1 - * @deprecated in favor of autoloading - * @access private - */ - public static function initialize_reports_path( $report_path, $name, $class ) { - _deprecated_function( __METHOD__, '2.4.0' ); - if ( in_array( strtolower( $class ), array( - 'wc_report_subscription_events_by_date', - 'wc_report_upcoming_recurring_revenue', - 'wc_report_retention_rate', - 'wc_report_subscription_by_product', - 'wc_report_subscription_by_customer', - 'wc_report_subscription_payment_retry', - ) ) ) { - $report_path = dirname( __FILE__ ) . '/reports/classwcsreport' . $name . '.php'; - } - - return $report_path; - } } diff --git a/includes/admin/reports/deprecated/class-wc-report-retention-rate.php b/includes/admin/reports/deprecated/class-wc-report-retention-rate.php deleted file mode 100644 index e222fd0..0000000 --- a/includes/admin/reports/deprecated/class-wc-report-retention-rate.php +++ /dev/null @@ -1,20 +0,0 @@ -billing_interval = $request['billing_interval']; - $data->billing_period = $request['billing_period']; - - foreach ( array( 'start', 'trial_end', 'end', 'next_payment' ) as $date_type ) { - if ( ! empty( $request[ $date_type . '_date' ] ) ) { - $date_type_key = ( 'start' === $date_type ) ? 'date_created' : $date_type . '_date'; - $data->{$date_type_key} = $request[ $date_type . '_date' ]; - } - } - - $data->payment_details = ! empty( $request['payment_details'] ) ? $request['payment_details'] : ''; - $data->payment_method = ! empty( $request['payment_method'] ) ? $request['payment_method'] : ''; - - return $data; - } - - /** - * Update or set the subscription schedule with the request data. - * - * - * @since 2.1 - * @param WC_Subscription $subscription - * @param array $data - * @deprecated 2.2 - */ - public function update_schedule( $subscription, $data ) { - wcs_deprecated_function( __METHOD__, '2.2', 'WC_REST_Subscriptions_Controller::prepare_item_for_database() now prepares the billing interval/period and dates' ); - - if ( isset( $data['billing_interval'] ) ) { - $subscription->set_billing_interval( absint( $data['billing_interval'] ) ); - } - - if ( ! empty( $data['billing_period'] ) ) { - $subscription->set_billing_period( $data['billing_period'] ); - } - - try { - $dates_to_update = array(); - - foreach ( array( 'start', 'trial_end', 'end', 'next_payment' ) as $date_type ) { - if ( isset( $data[ $date_type . '_date' ] ) ) { - $date_type_key = ( 'start' === $date_type ) ? 'date_created' : $date_type; - $dates_to_update[ $date_type_key ] = $data[ $date_type . '_date' ]; - } - } - - if ( ! empty( $dates_to_update ) ) { - $subscription->update_dates( $dates_to_update ); - } - } catch ( Exception $e ) { - // translators: placeholder is an error message. - throw new WC_REST_Exception( 'woocommerce_rest_cannot_update_subscription_dates', sprintf( __( 'Updating subscription dates errored with message: %s', 'woocommerce-subscriptions' ), $e->getMessage() ), 400 ); - } - } } diff --git a/includes/class-wcs-autoloader.php b/includes/class-wcs-autoloader.php index 56ba70b..5bbadf0 100644 --- a/includes/class-wcs-autoloader.php +++ b/includes/class-wcs-autoloader.php @@ -93,8 +93,6 @@ protected function get_relative_class_path( $class ) { if ( stripos( $class, 'switch' ) !== false || 'wcs_add_cart_item' === $class ) { $path .= '/switching'; - } elseif ( false !== strpos( $class, 'wc_report' ) ) { - $path .= '/admin/reports/deprecated'; } elseif ( false !== strpos( $class, 'wcs_report' ) ) { $path .= '/admin/reports'; } elseif ( false !== strpos( $class, 'retry' ) || false !== strpos( $class, 'retries' ) ) { @@ -122,13 +120,10 @@ protected function get_relative_class_path( $class ) { */ protected function should_autoload( $class ) { static $legacy = array( - 'wc_order_item_pending_switch' => 1, - 'wc_report_retention_rate' => 1, - 'wc_report_upcoming_recurring_revenue' => 1, + 'wc_order_item_pending_switch' => 1, ); return isset( $legacy[ $class ] ) ? true : parent::should_autoload( $class ); - } /** diff --git a/includes/early-renewal/class-wcs-early-renewal-modal-handler.php b/includes/early-renewal/class-wcs-early-renewal-modal-handler.php index 04eb8e8..2990501 100644 --- a/includes/early-renewal/class-wcs-early-renewal-modal-handler.php +++ b/includes/early-renewal/class-wcs-early-renewal-modal-handler.php @@ -39,7 +39,7 @@ public static function maybe_print_early_renewal_modal( $subscription ) { 'text' => __( 'Pay now', 'woocommerce-subscriptions' ), 'attributes' => array( 'id' => 'early_renewal_modal_submit', - 'class' => 'button alt ', + 'class' => 'button alt', 'href' => add_query_arg( array( 'subscription_id' => $subscription->get_id(), 'process_early_renewal' => true, @@ -49,6 +49,10 @@ public static function maybe_print_early_renewal_modal( $subscription ) { ), ); + if ( wc_wp_theme_get_element_class_name( 'button' ) ) { + $place_order_action['attributes']['class'] .= ' ' . wc_wp_theme_get_element_class_name( 'button' ); + } + $callback_args = array( 'callback' => array( __CLASS__, 'output_early_renewal_modal' ), 'parameters' => array( 'subscription' => $subscription ), diff --git a/includes/switching/class-wc-subscriptions-switcher.php b/includes/switching/class-wc-subscriptions-switcher.php index ff7fe0e..043d40a 100644 --- a/includes/switching/class-wc-subscriptions-switcher.php +++ b/includes/switching/class-wc-subscriptions-switcher.php @@ -1695,19 +1695,6 @@ public static function customise_product_string_inclusions( $inclusions, $produc return $inclusions; } - /** - * If a product is being marked as not purchasable because it is limited and the customer has a subscription, - * but the current request is to switch the subscription, then mark it as purchasable. - * - * @since 1.4.4 - * @return bool - * @deprecated 2.1 - */ - public static function is_purchasable( $is_purchasable, $product ) { - _deprecated_function( __METHOD__, '2.1', 'WCS_Limiter::is_purchasable_switch' ); - return WCS_Limiter::is_purchasable_switch( $is_purchasable, $product ); - } - /** * Do not carry over switch related meta data to renewal orders. * @@ -1795,26 +1782,6 @@ public static function process_subscription_switches( $order_id, $order_old_stat } } - /** - * Checks if a product can be switched based on it's type and the types which can be switched - * - * @since 1.5.21 - */ - public static function is_product_of_switchable_type( $product ) { - - _deprecated_function( __METHOD__, '2.0.7', 'wcs_is_product_switchable_type' ); - - $allow_switching = false; - $switch_setting = get_option( WC_Subscriptions_Admin::$option_prefix . '_allow_switching', 'no' ); - - // does the current switch setting allow switching for variable or variable_grouped - if ( 'variable_grouped' == $switch_setting || ( $product->is_type( array( 'variable-subscription', 'subscription_variation' ) ) && 'variable' == $switch_setting ) || ( 'grouped' == $switch_setting && ( $product->is_type( 'grouped' ) || wcs_get_objects_property( $product, 'parent_id' ) ) ) ) { - $allow_switching = true; - } - - return $allow_switching; - } - /** * Check if a given subscription item was for upgrading/downgrading an existing item. * @@ -2436,40 +2403,6 @@ public static function display_switches_in_related_order_metabox( $orders_to_dis return $orders_to_display; } - /** Deprecated Methods **/ - - /** - * Automatically set a switch order's status to complete (even if the items require shipping because - * the order is simply a record of the switch and not indicative of an item needing to be shipped) - * - * @since 1.5 - */ - public static function subscription_switch_autocomplete( $new_order_status, $order_id ) { - _deprecated_function( __METHOD__, '2.1.3', 'WC_Subscriptions_Order::maybe_autocomplete_order' ); - return WC_Subscriptions_Order::maybe_autocomplete_order( $new_order_status, $order_id ); - } - - /** - * Once payment is processed on a switch from a $0 / period subscription to a non-zero $ / period subscription, if - * payment was completed with a payment method which supports automatic payments, update the payment on the subscription - * and the manual renewals flag so that future renewals are processed automatically. - * - * @param array $payment_processing_result - * @param int $order_id - * @since 2.0.16 - * @deprecated 2.1 - */ - public static function maybe_set_payment_method( $payment_processing_result, $order_id ) { - _deprecated_function( __METHOD__, '2.1', __CLASS__ . '::maybe_set_payment_method_after_switch( $order )' ); - - $order = wc_get_order( $order_id ); - if ( wcs_order_contains_switch( $order_id ) && false !== (bool) $order->get_meta( '_paid_date', true ) ) { - self::maybe_set_payment_method_after_switch( $order ); - } - - return $payment_processing_result; - } - /** * Override the order item quantity used to reduce stock levels when the order item is to record a switch and where no * prorated amount is being charged. @@ -2651,343 +2584,6 @@ public static function display_switch_add_to_cart_text( $add_to_cart_text ) { return $add_to_cart_text; } - /** - * Don't allow switched subscriptions to be cancelled. - * - * @param bool $subscription_can_be_changed - * @param array $subscription A subscription of the form created by @see WC_Subscriptions_Manager::get_subscription() - * @since 1.4 - * @deprecated 2.0 - */ - public static function can_subscription_be_cancelled( $subscription_can_be_changed, $subscription ) { - _deprecated_function( __METHOD__, '2.0' ); - - if ( 'switched' == $subscription['status'] ) { - $subscription_can_be_changed = false; - } - - return $subscription_can_be_changed; - } - - /** - * Adds a "Switch" button to the "My Subscriptions" table for those subscriptions can be upgraded/downgraded. - * - * @param array $all_actions The $subscription_key => $actions array with all actions that will be displayed for a subscription on the "My Subscriptions" table - * @param array $subscriptions All of a given users subscriptions that will be displayed on the "My Subscriptions" table - * @since 1.4 - * @deprecated 2.0 - */ - public static function add_switch_button( $all_actions, $subscriptions ) { - _deprecated_function( __METHOD__, '2.0', __CLASS__ . '::print_switch_button( $subscription, $item )' ); - - $user_id = get_current_user_id(); - - foreach ( $all_actions as $subscription_key => $actions ) { - - if ( WC_Subscriptions_Manager::can_subscription_be_changed_to( 'new-subscription', $subscription_key, $user_id ) ) { - $all_actions[ $subscription_key ] = array( - 'switch' => array( - 'url' => self::get_switch_link( $subscription_key ), - 'name' => get_option( WC_Subscriptions_Admin::$option_prefix . '_switch_button_text', __( 'Upgrade or Downgrade', 'woocommerce-subscriptions' ) ), - ), - ) + $all_actions[ $subscription_key ]; - } - } - - return $all_actions; - } - - /** - * The link for switching a subscription - the product page for variable subscriptions, or grouped product page for grouped subscriptions. - * - * @param string $subscription_key A subscription key of the form created by @see self::get_subscription_key() - * @since 1.4 - * @deprecated 2.0 - */ - public static function get_switch_link( $subscription_key ) { - _deprecated_function( __METHOD__, '2.0', __CLASS__ . '::get_switch_url( $item_id, $item, $subscription )' ); - } - - /** - * Add a 'new-subscription' handler to the WC_Subscriptions_Manager::can_subscription_be_changed_to() function. - * - * For the subscription to be switchable, switching must be enabled, and the subscription must: - * - be active or on-hold - * - be a variable subscription or part of a grouped product (at the time the check is made, not at the time the subscription was purchased) - * - be using manual renewals or use a payment method which supports cancellation - * - * @param bool $subscription_can_be_changed Flag of whether the subscription can be changed to - * @param string $new_status_or_meta The status or meta data you want to change the subscription to. Can be 'active', 'on-hold', 'cancelled', 'expired', 'trash', 'deleted', 'failed', 'AMQPChannel to the 'woocommerce_can_subscription_be_changed_to' filter. - * @param object $args Set of values used in @see WC_Subscriptions_Manager::can_subscription_be_changed_to() for determining if a subscription can be changed - * @since 1.4 - * @deprecated 2.0 - */ - public static function can_subscription_be_changed_to( $subscription_can_be_changed, $new_status_or_meta, $args ) { - _deprecated_function( __METHOD__, '2.0', __CLASS__ . '::can_item_be_switched( $item, $subscription )' ); - return false; - } - - /** - * Check if the cart includes a request to switch a subscription. - * - * @return bool Returns true if any item in the cart is a subscription switch request, otherwise, false. - * @since 1.4 - * @deprecated 2.0 - */ - public static function cart_contains_subscription_switch() { - _deprecated_function( __METHOD__, '2.0', __CLASS__ . '::cart_contains_switches()' ); - - $cart_contains_subscription_switch = self::cart_contains_switches(); - - // For backward compatiblity, only send the first switch item, not all of them - if ( false !== $cart_contains_subscription_switch ) { - $cart_contains_subscription_switch = array_pop( $cart_contains_subscription_switch ); - } - - return $cart_contains_subscription_switch; - } - - /** - * Previously, we used a trial period to make sure totals are calculated correctly (i.e. order total does not include any recurring - * amounts) but we didn't want switched subscriptions to actually have a trial period, so reset the value on the order after checkout. - * - * This is all redundant now that trial period isn't stored on a subscription item. The first payment date will be used instead. - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function fix_order_item_meta( $item_id, $values ) { - _deprecated_function( __METHOD__, '2.0' ); - } - - /** - * Add the next payment date to the end of the subscription to clarify when the new rate will be charged - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function customise_subscription_price_string( $subscription_string ) { - _deprecated_function( __METHOD__, '2.0' ); - } - - /** - * Never display the trial period for a subscription switch (we're only setting it to calculate correct totals) - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function customise_cart_subscription_string_details( $subscription_details ) { - _deprecated_function( __METHOD__, '2.0' ); - return $subscription_details; - } - - /** - * Make sure when calculating the first payment date for a switched subscription, the date takes into - * account the switch (i.e. prepaid days and possibly a downgrade). - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function calculate_first_payment_date( $next_payment_date, $order, $product_id, $type ) { - _deprecated_function( __METHOD__, '2.0' ); - return self::get_first_payment_date( $next_payment_date, WC_Subscriptions_Manager::get_subscription_key( wcs_get_objects_property( $order, 'id' ), $product_id ), $order->get_user_id(), $type ); - } - - /** - * Make sure anything requesting the first payment date for a switched subscription receives a date which - * takes into account the switch (i.e. prepaid days and possibly a downgrade). - * - * This is necessary as the self::calculate_first_payment_date() is not called when the subscription is active - * (which it isn't until the first payment is completed and the subscription is activated). - * - * @deprecated 2.0 - */ - public static function get_first_payment_date( $next_payment_date, $subscription_key, $user_id, $type ) { - _deprecated_function( __METHOD__, '2.0' ); - - $subscription = wcs_get_subscription_from_key( $subscription_key ); - if ( $subscription->has_status( 'active' ) && $subscription->get_parent_id() && wcs_order_contains_switch( $subscription->get_parent_id() ) && 1 >= $subscription->get_payment_count() ) { - $first_payment_timestamp = (int) $subscription->get_meta( '_switched_subscription_first_payment_timestamp', true ); - if ( 0 !== $first_payment_timestamp ) { - $next_payment_date = ( 'mysql' === $type ) ? gmdate( 'Y-m-d H:i:s', $first_payment_timestamp ) : $first_payment_timestamp; - } - } - - return $next_payment_date; - } - - /** - * Add an i18n'ified string for the "switched" subscription status. - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function add_switched_status_string( $status_string ) { - _deprecated_function( __METHOD__, '2.0' ); - - if ( 'switched' === strtolower( $status_string ) ) { - $status_string = _x( 'Switched', 'Subscription status', 'woocommerce-subscriptions' ); - } - - return $status_string; - } - - /** - * Set the subscription prices to be used in calculating totals by @see WC_Subscriptions_Cart::calculate_subscription_totals() - * - * @since 1.4 - * @deprecated 2.0 - */ - public static function maybe_set_apporitioned_totals( $total ) { - _deprecated_function( __METHOD__, '2.0', __CLASS__ . '::calculate_prorated_totals()' ); - return $total; - } - - /** - * If the subscription purchased in an order has since been switched, include a link to the order placed to switch the subscription - * in the "Related Orders" meta box (displayed on the Edit Order screen). - * - * @param WC_Order $order The current order. - * @since 1.4 - * @deprecated 2.0 - */ - public static function switch_order_meta_box_section( $order ) { - _deprecated_function( __METHOD__, '2.0' ); - } - - /** - * After payment is completed on an order for switching a subscription, complete the switch. - * - * @param WC_Order|int $order A WC_Order object or ID of a WC_Order order. - * @since 1.4 - * @deprecated 2.0 - */ - public static function maybe_complete_switch( $order_id ) { - _deprecated_function( __METHOD__, '2.0' ); - } - - /** - * Check if a given order was created to switch a subscription. - * - * @param WC_Order $order An order to check. - * @return bool Returns true if the order switched a subscription, otherwise, false. - * @since 1.4 - */ - public static function order_contains_subscription_switch( $order_id ) { - _deprecated_function( __METHOD__, '2.0', 'wcs_order_contains_switch( $order_id )' ); - return wcs_order_contains_switch( $order_id ); - } - - /** - * Store the order line item id so it can be retrieved when we're processing the switch on checkout - * - * @param int $order_id - * @param array $checkout_posted_data - * @since 2.2.0 - */ - public static function set_switch_order_item_id( $order_id, $posted_checkout_data ) { - _deprecated_function( __METHOD__, '2.2.1', 'WCS_Cart_Switch::set_cart_item_order_item_id()' ); - - $order = wc_get_order( $order_id ); - - foreach ( $order->get_items( 'line_item' ) as $order_item_id => $order_item ) { - - $cart_item_key = $order_item->get_meta( '_switched_cart_item_key' ); - - if ( ! empty( $cart_item_key ) ) { - foreach ( WC()->cart->recurring_carts as $recurring_cart_key => $recurring_cart ) { - - // If this cart item belongs to this recurring cart - if ( in_array( $cart_item_key, array_keys( $recurring_cart->cart_contents ) ) && isset( WC()->cart->recurring_carts[ $recurring_cart_key ]->cart_contents[ $cart_item_key ]['subscription_switch'] ) ) { - WC()->cart->recurring_carts[ $recurring_cart_key ]->cart_contents[ $cart_item_key ]['subscription_switch']['order_line_item_id'] = $order_item_id; - wc_add_order_item_meta( WC()->cart->recurring_carts[ $recurring_cart_key ]->cart_contents[ $cart_item_key ]['subscription_switch']['item_id'], '_switched_subscription_new_item_id', $order_item_id, true ); - } - } - } - } - } - - /** - * Filter the WC_Subscription::get_related_orders() method to include switch orders. - * - * @since 2.0 - * @deprecated - * - * @param array $related_orders - * @param WC_Subscription $subscription - * @param string $return_fields - * @param string $order_type - * - * @return array - */ - public static function add_related_orders( $related_orders, $subscription, $return_fields, $order_type ) { - wcs_deprecated_function( __METHOD__, '2.3.0', 'wcs_get_switch_orders_for_subscription()' ); - if ( in_array( $order_type, array( 'all', 'switch' ) ) ) { - - $switch_orders = wcs_get_switch_orders_for_subscription( $subscription->get_id() ); - - if ( 'all' == $return_fields ) { - $related_orders += $switch_orders; - } else { - foreach ( $switch_orders as $order_id => $order ) { - $related_orders[ $order_id ] = $order_id; - } - } - - // This will change the ordering to be by ID instead of the default of date - krsort( $related_orders ); - } - - return $related_orders; - } - - /** - * If the subscription purchased in an order has since been switched, include a link to the order placed to switch the subscription - * in the "Related Orders" meta box (displayed on the Edit Order screen). - * - * @param WC_Order $order The current order. - * @since 1.4 - * @deprecated 3.1.0 - */ - public static function switch_order_meta_box_rows( $post ) { - wcs_deprecated_function( __METHOD__, '3.1.0' ); - $subscriptions = array(); - $switched_subscriptions = array(); - $orders = array(); - - // On the subscription page, just show related orders - if ( wcs_is_subscription( $post->ID ) ) { - - // Select the orders which switched item/s from this subscription - $orders = wcs_get_switch_orders_for_subscription( $post->ID ); - - foreach ( $orders as $order_id => $order ) { - wcs_set_objects_property( $order, 'relationship', __( 'Switch Order', 'woocommerce-subscriptions' ), 'set_prop_only' ); - } - - // Select the subscriptions which had item/s switched to this subscription by its parent order - if ( ! empty( $post->post_parent ) ) { - $switched_subscriptions = wcs_get_subscriptions_for_switch_order( $post->post_parent ); - } - - // On the Edit Order screen, show any subscriptions with items switched by this order - } else { - $switched_subscriptions = wcs_get_subscriptions_for_switch_order( $post->ID ); - } - - if ( is_array( $switched_subscriptions ) ) { - foreach ( $switched_subscriptions as $subscription_id => $subscription ) { - wcs_set_objects_property( $subscription, 'relationship', __( 'Switched Subscription', 'woocommerce-subscriptions' ), 'set_prop_only' ); - $orders[ $subscription_id ] = $subscription; - } - } - - foreach ( $orders as $order ) { - include( WC_Subscriptions_Core_Plugin::instance()->get_subscriptions_core_directory( 'includes/admin/meta-boxes/views/html-related-orders-row.php' ) ); - } - - } - /** * Removes subscription items from recurring carts which have been handled. * diff --git a/languages/woocommerce-subscriptions.pot b/languages/woocommerce-subscriptions.pot index 4e6bda9..ab628e1 100644 --- a/languages/woocommerce-subscriptions.pot +++ b/languages/woocommerce-subscriptions.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the WooCommerce Subscriptions plugin. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Subscriptions 6.9.1\n" +"Project-Id-Version: WooCommerce Subscriptions 7.0.0\n" "Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-11-27T02:14:55+00:00\n" +"POT-Creation-Date: 2024-12-16T23:30:24+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" "X-Domain: woocommerce-subscriptions\n" @@ -905,7 +905,6 @@ msgstr "" #. translators: placeholder is an error message. #: includes/api/legacy/class-wc-rest-subscriptions-controller.php:287 #: includes/api/v1/class-wc-rest-subscriptions-v1-controller.php:475 -#: includes/api/v1/class-wc-rest-subscriptions-v1-controller.php:781 msgid "Updating subscription dates errored with message: %s" msgstr "" @@ -1111,8 +1110,8 @@ msgstr "" #: includes/class-wcs-call-to-action-button-text-manager.php:55 #: includes/class-wcs-call-to-action-button-text-manager.php:58 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php:657 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:1199 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:1231 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:1202 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:1234 msgid "Sign up now" msgstr "" @@ -1338,7 +1337,7 @@ msgstr "" #: includes/early-renewal/wcs-early-renewal-functions.php:136 #: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-related-orders-row.php:18 #: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-unknown-related-orders-row.php:18 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:171 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:172 #: vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php:36 #: vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php:45 #: vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php:34 @@ -1386,37 +1385,37 @@ msgstr "" msgid "Pay now" msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:57 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:61 msgid "Renew early" msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:73 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:77 #: vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-subscription-schedule.php:24 msgid "Payment:" msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:107 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:111 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-change-payment-gateway.php:226 msgid "There was an error with your request. Please try again." msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:114 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:118 msgid "We were unable to locate that subscription, please try again." msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:119 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:123 msgid "You can't renew the subscription at this time. Please try again." msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:129 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:133 msgid "We couldn't create a renewal order for your subscription, please try again." msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:146 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:150 msgid "Payment for the renewal order was unsuccessful with your payment method on file, please try again." msgstr "" -#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:158 +#: includes/early-renewal/class-wcs-early-renewal-modal-handler.php:162 msgid "Your early renewal order was successful." msgstr "" @@ -1804,7 +1803,6 @@ msgstr "" #: includes/switching/class-wc-subscriptions-switcher.php:450 #: includes/switching/class-wc-subscriptions-switcher.php:552 -#: includes/switching/class-wc-subscriptions-switcher.php:2691 msgid "Upgrade or Downgrade" msgstr "" @@ -1847,68 +1845,60 @@ msgstr "" msgid "There was an error locating the switch details." msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:1879 +#: includes/switching/class-wc-subscriptions-switcher.php:1846 msgctxt "a switch type" msgid "Downgrade" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:1882 +#: includes/switching/class-wc-subscriptions-switcher.php:1849 msgctxt "a switch type" msgid "Upgrade" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:1885 +#: includes/switching/class-wc-subscriptions-switcher.php:1852 msgctxt "a switch type" msgid "Crossgrade" msgstr "" #. translators: %1: product subtotal, %2: HTML span tag, %3: direction (upgrade, downgrade, crossgrade), %4: closing HTML span tag -#: includes/switching/class-wc-subscriptions-switcher.php:1890 +#: includes/switching/class-wc-subscriptions-switcher.php:1857 msgctxt "product subtotal string" msgid "%1$s %2$s(%3$s)%4$s" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2006 +#: includes/switching/class-wc-subscriptions-switcher.php:1973 msgid "The original subscription item being switched cannot be found." msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2008 +#: includes/switching/class-wc-subscriptions-switcher.php:1975 msgid "The item on the switch order cannot be found." msgstr "" #. translators: 1$: old item, 2$: new item when switching -#: includes/switching/class-wc-subscriptions-switcher.php:2019 +#: includes/switching/class-wc-subscriptions-switcher.php:1986 msgctxt "used in order notes" msgid "Customer switched from: %1$s to %2$s." msgstr "" #. translators: %s: new item name. -#: includes/switching/class-wc-subscriptions-switcher.php:2022 +#: includes/switching/class-wc-subscriptions-switcher.php:1989 msgctxt "used in order notes" msgid "Customer added %s." msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2417 -#: includes/switching/class-wc-subscriptions-switcher.php:2965 +#: includes/switching/class-wc-subscriptions-switcher.php:2384 msgid "Switch Order" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2432 -#: includes/switching/class-wc-subscriptions-switcher.php:2980 +#: includes/switching/class-wc-subscriptions-switcher.php:2399 msgid "Switched Subscription" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2648 +#: includes/switching/class-wc-subscriptions-switcher.php:2581 msgctxt "add to cart button text while switching a subscription" msgid "Switch subscription" msgstr "" -#: includes/switching/class-wc-subscriptions-switcher.php:2829 -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:223 -msgctxt "Subscription status" -msgid "Switched" -msgstr "" - #: includes/switching/class-wcs-cart-switch.php:180 msgctxt "The place order button text while switching a subscription" msgid "Switch subscription" @@ -2678,12 +2668,12 @@ msgid "Delete Permanently" msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:1406 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:762 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:765 msgid "Restore this item from the Trash" msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:1408 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:763 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:766 msgid "Restore" msgstr "" @@ -4094,14 +4084,14 @@ msgid "Parent Order" msgstr "" #. translators: %1$s refers to the price. This string is meant to prefix another string below, e.g. "$5 now, and $5 on March 15th each year" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:287 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:290 msgid "%1$s now, and " msgstr "" #. translators: 1$: recurring amount string, 2$: day of the week (e.g. "$10 every Wednesday"). #. translators: 1$: recurring amount string, 2$: day of the week (e.g. "$10 every Wednesday") #. translators: %1$: recurring amount (e.g. "$15"), %2$: subscription period (e.g. "month") (e.g. "$15 every 2nd month") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:296 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:299 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:116 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:201 msgid "%1$s every %2$s" @@ -4109,56 +4099,56 @@ msgstr "" #. translators: 1$: recurring amount string, 2$: period, 3$: day of the week (e.g. "$10 every 2nd week on Wednesday"). #. translators: 1$: recurring amount string, 2$: period, 3$: day of the week (e.g. "$10 every 2nd week on Wednesday") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:300 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:303 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:125 msgid "%1$s every %2$s on %3$s" msgstr "" #. translators: placeholder is recurring amount. #. translators: placeholder is recurring amount -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:311 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:314 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:143 msgid "%s on the last day of each month" msgstr "" #. translators: 1$: recurring amount, 2$: day of the month (e.g. "23rd") (e.g. "$5 every 23rd of each month"). #. translators: 1$: recurring amount, 2$: day of the month (e.g. "23rd") (e.g. "$5 every 23rd of each month") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:315 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:318 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:146 msgid "%1$s on the %2$s of each month" msgstr "" #. translators: 1$: recurring amount, 2$: interval (e.g. "3rd") (e.g. "$10 on the last day of every 3rd month"). #. translators: 1$: recurring amount, 2$: interval (e.g. "3rd") (e.g. "$10 on the last day of every 3rd month") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:324 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:327 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:162 msgid "%1$s on the last day of every %2$s month" msgstr "" #. translators: 1$: on the, 2$: day of every, 3$: month (e.g. "$10 on the 23rd day of every 2nd month"). #. translators: 1$: recurring amount, 2$: day of the month (e.g. "23rd") (e.g. "$5 every 23rd of each month") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:331 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:334 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:165 msgid "%1$s on the %2$s day of every %3$s month" msgstr "" #. translators: 1$: on, 2$: , 3$: each year (e.g. "$15 on March 15th each year"). #. translators: 1$: recurring amount, 2$: month (e.g. "March"), 3$: day of the month (e.g. "23rd") (e.g. "$15 on March 15th every 3rd year") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:343 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:346 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:178 msgid "%1$s on %2$s %3$s each year" msgstr "" #. translators: 1$: recurring amount, 2$: month (e.g. "March"), 3$: day of the month (e.g. "23rd"). #. translators: 1$: recurring amount, 2$: month (e.g. "March"), 3$: day of the month (e.g. "23rd") (e.g. "$15 on March 15th every 3rd year") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:351 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:354 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:187 msgid "%1$s on %2$s %3$s every %4$s year" msgstr "" #. translators: 1$: recurring amount, 2$: subscription period (e.g. "month" or "3 months") (e.g. "$15 / month" or "$15 every 2nd month"). #. translators: 1$: recurring amount, 2$: subscription period (e.g. "month" or "3 months") (e.g. "$15 / month" or "$15 every 2nd month") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:363 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:366 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:198 msgid "%1$s / %2$s" msgid_plural "%1$s every %2$s" @@ -4166,37 +4156,37 @@ msgstr[0] "" msgstr[1] "" #. translators: billing period (e.g. "every week"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:373 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:376 msgid "every %s" msgstr "" #. translators: 1$: subscription string (e.g. "$10 up front then $5 on March 23rd every 3rd year"), 2$: length (e.g. "4 years"). #. translators: 1$: subscription string (e.g. "$10 up front then $5 on March 23rd every 3rd year"), 2$: length (e.g. "4 years") -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:383 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:386 #: vendor/woocommerce/subscriptions-core/includes/wcs-formatting-functions.php:209 msgid "%1$s for %2$s" msgstr "" #. translators: 1$: subscription string (e.g. "$15 on March 15th every 3 years for 6 years"), 2$: trial length (e.g.: "with 4 months free trial"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:389 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:392 msgid "%1$s with %2$s free trial" msgstr "" #. translators: 1$: subscription string (e.g. "$15 on March 15th every 3 years for 6 years with 2 months free trial"), 2$: signup fee price (e.g. "and a $30 sign-up fee"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:394 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:397 msgid "%1$s and a %2$s sign-up fee" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:972 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php:975 msgid "This variation can not be removed because it is associated with existing subscriptions. To remove this variation, please permanently delete any related subscriptions." msgstr "" #. translators: placeholder is order ID -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:174 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:175 msgid "Order %s created to record renewal." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:194 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php:195 msgid "Subscription renewal orders cannot be cancelled." msgstr "" @@ -4558,20 +4548,20 @@ msgstr "" msgid "You have successfully removed \"%1$s\" from your subscription. %2$sUndo?%3$s" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:176 +#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:180 #: vendor/woocommerce/subscriptions-core/includes/class-wcs-user-change-status-handler.php:107 msgid "Security error. Please contact us if you need assistance." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:180 +#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:184 msgid "You cannot modify a subscription that does not belong to you." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:184 +#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:188 msgid "You cannot remove an item that does not exist. " msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:188 +#: vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php:192 msgid "The item was not removed because this Subscription's payment method does not support removing an item." msgstr "" @@ -7288,11 +7278,11 @@ msgstr "" msgid "Actions" msgstr "" -#: vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php:101 +#: vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php:107 msgid "Subscription updates" msgstr "" -#: vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php:107 +#: vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php:113 msgctxt "date on subscription updates list. Will be localized" msgid "l jS \\o\\f F Y, h:ia" msgstr "" @@ -7347,6 +7337,11 @@ msgctxt "Subscription status" msgid "On hold" msgstr "" +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:223 +msgctxt "Subscription status" +msgid "Switched" +msgstr "" + #: vendor/woocommerce/subscriptions-core/wcs-functions.php:225 msgctxt "Subscription status" msgid "Pending Cancellation" diff --git a/vendor/autoload.php b/vendor/autoload.php index 6022a94..9051bfa 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf69ce3861bce49b808df374cef4fccba::getLoader(); +return ComposerAutoloaderInit8696b4ce4243ef30c3ff87b4ec42d61a::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 71c160c..e564e91 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf69ce3861bce49b808df374cef4fccba +class ComposerAutoloaderInit8696b4ce4243ef30c3ff87b4ec42d61a { private static $loader; @@ -24,12 +24,12 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInitf69ce3861bce49b808df374cef4fccba', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8696b4ce4243ef30c3ff87b4ec42d61a', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitf69ce3861bce49b808df374cef4fccba', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8696b4ce4243ef30c3ff87b4ec42d61a', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitf69ce3861bce49b808df374cef4fccba::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit8696b4ce4243ef30c3ff87b4ec42d61a::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5734148..b1b8ffb 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf69ce3861bce49b808df374cef4fccba +class ComposerStaticInit8696b4ce4243ef30c3ff87b4ec42d61a { public static $prefixLengthsPsr4 = array ( 'C' => @@ -129,9 +129,9 @@ class ComposerStaticInitf69ce3861bce49b808df374cef4fccba public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf69ce3861bce49b808df374cef4fccba::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf69ce3861bce49b808df374cef4fccba::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf69ce3861bce49b808df374cef4fccba::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit8696b4ce4243ef30c3ff87b4ec42d61a::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit8696b4ce4243ef30c3ff87b4ec42d61a::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit8696b4ce4243ef30c3ff87b4ec42d61a::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ef38c4f..d07917a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -156,21 +156,21 @@ }, { "name": "woocommerce/subscriptions-core", - "version": "7.7.2", - "version_normalized": "7.7.2.0", + "version": "7.8.0", + "version_normalized": "7.8.0.0", "source": { "type": "git", "url": "https://github.com/Automattic/woocommerce-subscriptions-core.git", - "reference": "f4bce1c1368e0e547922df7580ad578b0c9beea2" + "reference": "14e7b3d5df82a0f4d4942b8119e85087e4863a65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/f4bce1c1368e0e547922df7580ad578b0c9beea2", - "reference": "f4bce1c1368e0e547922df7580ad578b0c9beea2", + "url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/14e7b3d5df82a0f4d4942b8119e85087e4863a65", + "reference": "14e7b3d5df82a0f4d4942b8119e85087e4863a65", "shasum": "" }, "require": { - "composer/installers": "~1.2", + "composer/installers": "^1.2 || ^2.2", "php": "^7.1" }, "require-dev": { @@ -179,7 +179,7 @@ "woocommerce/woocommerce-sniffs": "0.1.0", "yoast/phpunit-polyfills": "1.1.0" }, - "time": "2024-11-27T00:02:10+00:00", + "time": "2024-12-16T23:11:09+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/7.7.2", + "source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.8.0", "issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues" }, "install-path": "../woocommerce/subscriptions-core" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 161264d..7b0e523 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'woocommerce/woocommerce-subscriptions', - 'pretty_version' => 'dev-release/6.9.1', - 'version' => 'dev-release/6.9.1', - 'reference' => 'c2bc23e1cc88e5c38bc2cc63365cca6a2a7dd741', + 'pretty_version' => 'dev-release/7.0.0', + 'version' => 'dev-release/7.0.0', + 'reference' => '71fd6cf0194bb9921cb70197177e77436a8fe3d8', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -32,18 +32,18 @@ ), ), 'woocommerce/subscriptions-core' => array( - 'pretty_version' => '7.7.2', - 'version' => '7.7.2.0', - 'reference' => 'f4bce1c1368e0e547922df7580ad578b0c9beea2', + 'pretty_version' => '7.8.0', + 'version' => '7.8.0.0', + 'reference' => '14e7b3d5df82a0f4d4942b8119e85087e4863a65', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../woocommerce/subscriptions-core', 'aliases' => array(), 'dev_requirement' => false, ), 'woocommerce/woocommerce-subscriptions' => array( - 'pretty_version' => 'dev-release/6.9.1', - 'version' => 'dev-release/6.9.1', - 'reference' => 'c2bc23e1cc88e5c38bc2cc63365cca6a2a7dd741', + 'pretty_version' => 'dev-release/7.0.0', + 'version' => 'dev-release/7.0.0', + 'reference' => '71fd6cf0194bb9921cb70197177e77436a8fe3d8', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css b/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css index 5c75d7c..9154b1a 100644 --- a/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css +++ b/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css @@ -7,6 +7,11 @@ } } +.subscription_details .button { + display: inline-block; + margin-bottom: 0.5em; +} + .subscription-auto-renew-toggle { margin-left: 5px; margin-bottom: 2px; diff --git a/vendor/woocommerce/subscriptions-core/changelog.txt b/vendor/woocommerce/subscriptions-core/changelog.txt index 0cf2e87..2ee95b2 100644 --- a/vendor/woocommerce/subscriptions-core/changelog.txt +++ b/vendor/woocommerce/subscriptions-core/changelog.txt @@ -1,5 +1,12 @@ *** WooCommerce Subscriptions Core Changelog *** += 7.8.0 - 2024-12-16 = +* Fix - Prevent failing non-recent renewal order from suspending the subscription and marking the most recent renewal order as failed. +* Fix - Use block theme-styled buttons for subscription and related-orders actions on My Account pages. +* Fix - Subscription totals not properly updating when customers remove items via the My Account > View Subscription page on some stores with caching enabled. +* Fix - Resolved unexpected errors during the renewal process when a subscription contains metadata with key "id". +* Update - Changed the link on the order thank-you page to take customers directly to their "My Account > Subscriptions" page. + = 7.7.2 - 2024-11-26 = * Fix - Prevents notices being displayed on WordPress 6.7 due to loading translations too early. diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-product-subscription-variation.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-product-subscription-variation.php index 8782936..063a76d 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-product-subscription-variation.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-product-subscription-variation.php @@ -110,7 +110,7 @@ public function add_to_cart_text() { * @return string */ public function single_add_to_cart_text() { - return apply_filters( 'woocommerce_product_single_add_to_cart_text', self::add_to_cart_text(), $this ); + return apply_filters( 'woocommerce_product_single_add_to_cart_text', WC_Subscriptions_Product::get_add_to_cart_text(), $this ); } /** diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php index e35189a..05f31e2 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php @@ -16,7 +16,7 @@ class WC_Subscriptions_Core_Plugin { * The version of subscriptions-core library. * @var string */ - protected $library_version = '7.7.2'; // WRCS: DEFINED_VERSION. + protected $library_version = '7.8.0'; // WRCS: DEFINED_VERSION. /** * The subscription scheduler instance. diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-data-copier.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-data-copier.php index 5d4f04e..e06e5b1 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-data-copier.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-data-copier.php @@ -41,6 +41,7 @@ class WC_Subscriptions_Data_Copier { '_trial_period', '_created_via', '_order_stock_reduced', + 'id', ]; /** diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php index 75b8704..d6c10f2 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php @@ -339,7 +339,7 @@ public static function subscription_thank_you( $order_id ) { $subscriptions = wcs_get_subscriptions_for_order( $order_id, array( 'order_type' => 'any' ) ); $subscription_count = count( $subscriptions ); $thank_you_message = ''; - $my_account_subscriptions_url = get_permalink( wc_get_page_id( 'myaccount' ) ); + $my_account_subscriptions_url = wc_get_endpoint_url( 'subscriptions', '', wc_get_page_permalink( 'myaccount' ) ); if ( $subscription_count ) { foreach ( $subscriptions as $subscription ) { diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php index f4057c2..73f3cf7 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php @@ -127,6 +127,9 @@ public static function get_grouped_price_html( $price, $grouped_product ) { foreach ( $grouped_product->get_children() as $child_product_id ) { $child_product = wc_get_product( $child_product_id ); + if ( ! $child_product instanceof WC_Product ) { + continue; + } if ( self::is_subscription( $child_product_id ) ) { $contains_subscription = true; diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php index 127fa52..6f2b62b 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php @@ -139,7 +139,8 @@ public static function maybe_record_subscription_payment( $order_id, $orders_old if ( $is_failed_renewal_order ) { do_action( 'woocommerce_subscriptions_paid_for_failed_renewal_order', wc_get_order( $order_id ), $subscription ); } - } elseif ( 'failed' == $orders_new_status ) { + } elseif ( 'failed' === $orders_new_status && wcs_is_order_last_renewal_of_subscription( $order, $subscription ) ) { + // We will suspend the subscription if the latest renewal order fails. $subscription->payment_failed(); } } diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php index 85646f4..3363936 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php @@ -152,7 +152,7 @@ public function add_menu_items( $menu_items ) { * @return string */ public function maybe_redirect_to_only_subscription( $url, $endpoint ) { - if ( $this->query_vars['subscriptions'] === $endpoint && is_account_page() ) { + if ( $this->query_vars['subscriptions'] === $endpoint && ( is_account_page() || is_order_received_page() ) ) { $subscriptions = wcs_get_users_subscriptions(); if ( is_array( $subscriptions ) && 1 === count( $subscriptions ) && apply_filters( 'wcs_my_account_redirect_to_single_subscription', true ) ) { diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php index 0906d5f..650ea30 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-remove-item.php @@ -143,6 +143,10 @@ public static function maybe_remove_or_add_item_to_subscription() { } } + // Clear cache after updating subscription items. + clean_post_cache( $subscription->get_id() ); + wc_delete_shop_order_transients( $subscription ); + /** * In WooCommerce 3.0 the subscription object and its items override the database with their current content, * so we lost the changes we just did with `wc_update_order_item`. Re-reading the object fixes this problem. diff --git a/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php b/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php index 32e26b4..15ff0b4 100644 --- a/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php +++ b/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php @@ -25,7 +25,7 @@ * 'product_id' The post ID of a WC_Product_Subscription, WC_Product_Variable_Subscription or WC_Product_Subscription_Variation object * 'order_id' The post ID of a shop_order post/WC_Order object which was used to create the subscription * 'subscription_status' Any valid subscription status. Can be 'any', 'active', 'cancelled', 'on-hold', 'expired', 'pending' or 'trash'. Defaults to 'any'. - * 'order_type' Get subscriptions for the any order type in this array. Can include 'any', 'parent', 'renewal' or 'switch', defaults to parent. + * 'order_type' Get subscriptions for the any order type in this array. Can include 'any', 'parent', 'renewal', 'resubscribe' or 'switch', defaults to 'parent'. * @return WC_Subscription[] Subscription details in post_id => WC_Subscription form. * @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.0 */ diff --git a/vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php b/vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php index e0c8b08..9b27af1 100644 --- a/vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php +++ b/vendor/woocommerce/subscriptions-core/templates/checkout/form-change-payment-method.php @@ -111,7 +111,7 @@ ' ), + apply_filters( 'woocommerce_change_payment_button_html', '' ), array( 'input' => array( 'type' => array(), diff --git a/vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php b/vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php index 017f8d9..953e42c 100644 --- a/vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php +++ b/vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php @@ -50,7 +50,7 @@ get_formatted_order_total() ); ?> - + diff --git a/vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php b/vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php index b004eec..c737641 100644 --- a/vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php +++ b/vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php @@ -89,7 +89,7 @@ if ( $actions ) { foreach ( $actions as $key => $action ) { - echo wp_kses_post( '' . esc_html( $action['name'] ) . '' ); + echo wp_kses_post( '' . esc_html( $action['name'] ) . '' ); } } ?> diff --git a/vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php b/vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php index 5a2156b..176ca34 100644 --- a/vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php +++ b/vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php @@ -44,7 +44,7 @@ get_formatted_order_total() ); ?> - + diff --git a/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php b/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php index 81015ed..562f3c1 100644 --- a/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php +++ b/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-details.php @@ -81,11 +81,17 @@ $action ) : ?> - - + diff --git a/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php b/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php index 80622e5..6d17c52 100644 --- a/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php +++ b/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/subscription.php @@ -26,7 +26,7 @@ is_purchasable() && 0 !== $user_id && 'no' !== wcs_get_product_limitation( $product ) && wcs_is_product_limited_for_user( $product, $user_id ) ) : ?> get_id() ); ?> get_id(), wcs_get_product_limitation( $product ) ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'active' ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'on-hold' ) ) : // customer has an inactive subscription, maybe offer the renewal button. ?> - +

diff --git a/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php b/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php index 9232bbc..813ea48 100644 --- a/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php +++ b/vendor/woocommerce/subscriptions-core/templates/single-product/add-to-cart/variable-subscription.php @@ -25,7 +25,7 @@ is_purchasable() && 0 !== $user_id && 'no' !== wcs_get_product_limitation( $product ) && wcs_is_product_limited_for_user( $product, $user_id ) ) : ?> get_id() ); ?> get_id(), wcs_get_product_limitation( $product ) ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'active' ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'on-hold' ) ) : // customer has an inactive subscription, maybe offer the renewal button. ?> - +

diff --git a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php index 0d9d40c..d8d6ef2 100644 --- a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php +++ b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php @@ -6,5 +6,5 @@ * Author: Automattic * Author URI: https://woocommerce.com/ * Requires WP: 5.6 - * Version: 7.7.2 + * Version: 7.8.0 */ diff --git a/woocommerce-subscriptions.php b/woocommerce-subscriptions.php index d7820c5..117cc29 100644 --- a/woocommerce-subscriptions.php +++ b/woocommerce-subscriptions.php @@ -5,7 +5,7 @@ * Description: Sell products and services with recurring payments in your WooCommerce Store. * Author: WooCommerce * Author URI: https://woocommerce.com/ - * Version: 6.9.1 + * Version: 7.0.0 * Requires Plugins: woocommerce * * WC requires at least: 8.7.1 @@ -78,7 +78,7 @@ class WC_Subscriptions { public static $plugin_file = __FILE__; /** @var string */ - public static $version = '6.9.1'; // WRCS: DEFINED_VERSION. + public static $version = '7.0.0'; // WRCS: DEFINED_VERSION. /** @var string */ public static $wc_minimum_supported_version = '7.7';