Remove COT enable requirement from sync and verify command. (#39998)

This commit is contained in:
Vedanshu Jain 2023-09-05 20:29:04 +05:30 committed by GitHub
parent 7b328cfabf
commit 919a51f682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Remove COT enable requirement from sync and verify command.

View File

@ -102,10 +102,6 @@ class CLIRunner {
* @return int The number of orders to be migrated.*
*/
public function count_unmigrated( $args = array(), $assoc_args = array() ) : int {
if ( ! $this->is_enabled() ) {
return 0;
}
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$order_count = $this->synchronizer->get_current_orders_pending_sync_count();
@ -152,10 +148,6 @@ class CLIRunner {
* @param array $assoc_args Associative arguments (options) passed to the command.
*/
public function sync( $args = array(), $assoc_args = array() ) {
if ( ! $this->is_enabled() ) {
return;
}
if ( ! $this->synchronizer->check_orders_table_exists() ) {
WP_CLI::warning( __( 'Custom order tables does not exist, creating...', 'woocommerce' ) );
$this->synchronizer->create_database_tables();
@ -324,7 +316,9 @@ class CLIRunner {
*/
public function verify_cot_data( $args = array(), $assoc_args = array() ) {
global $wpdb;
if ( ! $this->is_enabled() ) {
if ( ! $this->synchronizer->check_orders_table_exists() ) {
WP_CLI::error( __( 'Orders table does not exist.', 'woocommerce' ) );
return;
}