Skip to content

Commit

Permalink
Sync: Add subscription type for HPOS orders conditinionally (#39118)
Browse files Browse the repository at this point in the history
* Check if WooCommerce Subscriptions Plugin is active and add subscription type.

* changelog

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10599546421

Upstream-Ref: Automattic/jetpack@ea0dc32
  • Loading branch information
darssen authored and matticbot committed Aug 28, 2024
1 parent a4a95d6 commit 3ef2577
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 93 deletions.
62 changes: 31 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-blaze/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"automattic/jetpack-plans": "^0.4.8",
"automattic/jetpack-redirect": "^2.0.3",
"automattic/jetpack-status": "^3.3.4",
"automattic/jetpack-sync": "^3.8.0"
"automattic/jetpack-sync": "^3.8.1-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions vendor/automattic/jetpack-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.8.1-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Sync: Add subscription type for HPOS orders only if WooCommerce Subscriptions plugin exists

## [3.8.0] - 2024-08-26
### Changed
- Sync: Updated allowed order types in HPOS Module [#39022]
Expand Down Expand Up @@ -1254,6 +1261,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Move sync to a classmapped package

[3.8.1-alpha]: https://github.com/Automattic/jetpack-sync/compare/v3.8.0...v3.8.1-alpha
[3.8.0]: https://github.com/Automattic/jetpack-sync/compare/v3.7.1...v3.8.0
[3.7.1]: https://github.com/Automattic/jetpack-sync/compare/v3.7.0...v3.7.1
[3.7.0]: https://github.com/Automattic/jetpack-sync/compare/v3.6.0...v3.7.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '3.8.0';
const PACKAGE_VERSION = '3.8.1-alpha';

const PACKAGE_SLUG = 'sync';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
*/
class WooCommerce_HPOS_Orders extends Module {

/**
* The slug of WooCommerce Subscriptions plugin.
*/
const WOOCOMMERCE_SUBSCRIPTIONS_PATH = 'woocommerce-subscriptions/woocommerce-subscriptions.php';

/**
* Order table name. There are four order tables (order, addresses, operational_data and meta), but for sync purposes we only care about the main table since it has the order ID.
*
Expand Down Expand Up @@ -65,7 +70,12 @@ public function __construct() {
* @return array Order types to sync.
*/
public static function get_order_types_to_sync( $prefixed = false ) {
$types = array( 'order', 'order_refund', 'subscription' );
$types = array( 'order', 'order_refund' );

if ( is_plugin_active( self::WOOCOMMERCE_SUBSCRIPTIONS_PATH ) ) {
$types[] = 'subscription';
}

if ( $prefixed ) {
$types = array_map(
function ( $type ) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/scheduled-updates/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": ">=7.0",
"automattic/jetpack-status": "^3.3.4",
"automattic/jetpack-sync": "^3.8.0",
"automattic/jetpack-sync": "^3.8.1-alpha",
"automattic/jetpack-plans": "^0.4.8",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-connection": "^2.12.5-alpha"
Expand Down
Loading

0 comments on commit 3ef2577

Please sign in to comment.