Skip to content

Commit 4a6bf0e

Browse files
Merge pull request #35 from godaddy-wordpress/release/1.10.1
2 parents 19e2bf6 + 9e6c011 commit 4a6bf0e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: woocommerce, order number, sequential order number, woocommerce orders
44
Requires at least: 5.6
55
Tested up to: 6.2.2
66
Requires PHP: 7.4
7-
Stable tag: 1.10.0
7+
Stable tag: 1.10.1-dev.1
88

99
This plugin extends WooCommerce by setting sequential order numbers for new orders.
1010

@@ -102,6 +102,9 @@ $order_number = $order->get_order_number();
102102

103103
== Changelog ==
104104

105+
- 2023.nn.nn - version 1.10.1-dev.1 =
106+
* Fix - Call save order method only in HPOS installs to avoid setting the same order number meta twice in CPT installations
107+
105108
- 2023.08.02 - version 1.10.0 =
106109
* Tweak - Also set sequential order numbers for orders sent via the WooCommerce Checkout Block
107110
* Misc - Add compatibility for WooCommerce High Performance Order Storage (HPOS)

woocommerce-sequential-order-numbers.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Provides sequential order numbers for WooCommerce orders
66
* Author: SkyVerge
77
* Author URI: http://www.skyverge.com
8-
* Version: 1.10.0
8+
* Version: 1.10.1-dev.1
99
* Text Domain: woocommerce-sequential-order-numbers
1010
* Domain Path: /i18n/languages/
1111
*
@@ -33,7 +33,7 @@ class WC_Seq_Order_Number {
3333

3434

3535
/** version number */
36-
const VERSION = '1.10.0';
36+
const VERSION = '1.10.1-dev.1';
3737

3838
/** minimum required wc version */
3939
const MINIMUM_WC_VERSION = '3.9.4';
@@ -351,8 +351,11 @@ public function set_sequential_order_number( $order_id = null, $object = null )
351351
", (int) $order_id ) );
352352
}
353353

354-
// with HPOS we need to trigger a save to update the order number or it won't persist by using the direct query above alone
355-
$order->save();
354+
// with HPOS we need to trigger a save to update the order number,
355+
// or it won't persist by using the direct query above alone
356+
if ( $using_hpos ) {
357+
$order->save();
358+
}
356359
}
357360
}
358361
}

0 commit comments

Comments
 (0)