Updates to 6.3.1

This commit is contained in:
WooCommerce
2024-05-24 10:13:15 +00:00
parent 7bd88fa86c
commit fbfd2242d2
8 changed files with 37 additions and 23 deletions

View File

@@ -1,5 +1,8 @@
*** WooCommerce Subscriptions Changelog ***
2024-05-24 - version 6.3.2
* Fix: Prevent overriding line item totals provided in request data when creating Orders via the REST API.
2024-05-09 - version 6.3.1
* Fix: Resolved an issue that caused "WC_DateTime could not be converted to int" warnings to occur on non-hpos sites while editing a subscription.

View File

@@ -85,17 +85,28 @@ class WCS_API {
* @since 6.3.0
*
* @param WC_Order_Item $item Order item object.
* @param array $item_request_data Data posted to the API about the order item.
*/
public static function add_sign_up_fee_to_order_item( $item ) {
public static function add_sign_up_fee_to_order_item( $item, $item_request_data = array() ) {
if ( 'line_item' !== $item->get_type() || ! self::is_orders_api_request() ) {
return;
}
// If the request includes an item subtotal or total, we don't want to override the provided total.
if ( isset( $item_request_data['subtotal'] ) || isset( $item_request_data['total'] ) ) {
return;
}
$product = $item->get_product();
if ( ! WC_Subscriptions_Product::is_subscription( $product ) ) {
return;
}
$sign_up_fee = WC_Subscriptions_Product::get_sign_up_fee( $product );
$sign_up_fee = is_numeric( $sign_up_fee ) ? (float) $sign_up_fee : 0;
if ( 0 !== $sign_up_fee ) {
if ( 0 < $sign_up_fee ) {
// Recalculate the totals as in `prepare_line_items`, but including the sign up fee in the price.
$trial_length = WC_Subscriptions_Product::get_trial_length( $product );

View File

@@ -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.3.1\n"
"Project-Id-Version: WooCommerce Subscriptions 6.3.2\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-05-09T07:38:54+00:00\n"
"POT-Creation-Date: 2024-05-24T04:44:48+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: woocommerce-subscriptions\n"

2
vendor/autoload.php vendored
View File

@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef::getLoader();
return ComposerAutoloaderInit2a572b7cb1c49650721c1f7426949a4c::getLoader();

View File

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

View File

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

View File

@@ -1,11 +1,11 @@
<?php return array(
'root' => array(
'pretty_version' => 'dev-release/6.3.1',
'version' => 'dev-release/6.3.1',
'pretty_version' => 'dev-release/6.3.2',
'version' => 'dev-release/6.3.2',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'b5a7272b9b055ce77d66fde677421f816ed0e83d',
'reference' => '1d9382ce5301ebe8df492ad898947a5d4534b5b1',
'name' => 'woocommerce/woocommerce-subscriptions',
'dev' => false,
),
@@ -41,12 +41,12 @@
'dev_requirement' => false,
),
'woocommerce/woocommerce-subscriptions' => array(
'pretty_version' => 'dev-release/6.3.1',
'version' => 'dev-release/6.3.1',
'pretty_version' => 'dev-release/6.3.2',
'version' => 'dev-release/6.3.2',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'b5a7272b9b055ce77d66fde677421f816ed0e83d',
'reference' => '1d9382ce5301ebe8df492ad898947a5d4534b5b1',
'dev_requirement' => false,
),
),

View File

@@ -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.3.1
* Version: 6.3.2
* Requires Plugins: woocommerce
*
* WC requires at least: 7.9.0
@@ -78,7 +78,7 @@ class WC_Subscriptions {
public static $plugin_file = __FILE__;
/** @var string */
public static $version = '6.3.1'; // WRCS: DEFINED_VERSION.
public static $version = '6.3.2'; // WRCS: DEFINED_VERSION.
/** @var string */
public static $wc_minimum_supported_version = '7.7';