Skip to content

Commit

Permalink
Updates to 6.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WooCommerce committed May 24, 2024
1 parent 7bd88fa commit fbfd224
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 23 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
19 changes: 15 additions & 4 deletions includes/class-wcs-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,29 @@ public static function register_route_overrides() {
*
* @since 6.3.0
*
* @param WC_Order_Item $item Order item object.
* @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;
}

$product = $item->get_product();
// 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 );

Expand Down
4 changes: 2 additions & 2 deletions languages/woocommerce-subscriptions.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\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"
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef::getLoader();
return ComposerAutoloaderInit2a572b7cb1c49650721c1f7426949a4c::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef
class ComposerAutoloaderInit2a572b7cb1c49650721c1f7426949a4c
{
private static $loader;

Expand All @@ -24,12 +24,12 @@ public static function getLoader()

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);

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef
class ComposerStaticInit2a572b7cb1c49650721c1f7426949a4c
{
public static $prefixLengthsPsr4 = array (
'C' =>
Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -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,
),
Expand Down Expand Up @@ -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,
),
),
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit fbfd224

Please sign in to comment.