Show link to create custom orders table.
This commit is contained in:
parent
3d29e8329c
commit
fc0c45a204
|
@ -298,6 +298,11 @@ class CustomOrdersTableController {
|
|||
'type' => 'title',
|
||||
);
|
||||
|
||||
|
||||
if ( ! $this->data_synchronizer->check_orders_table_exists() ) {
|
||||
$title_item['desc'] = __( 'Generate custom tables first by going to WooCommerce > Status > Tools > Create and fill custom orders table', 'woocommerce' );
|
||||
}
|
||||
|
||||
$settings[] = $title_item;
|
||||
|
||||
$settings[] = array(
|
||||
|
|
|
@ -46,6 +46,9 @@ class DataSynchronizer {
|
|||
*/
|
||||
public function check_orders_table_exists(): bool {
|
||||
$missing_tables = DBUtil::verify_database_tables_exist( $this->data_store->get_schema() );
|
||||
if ( count( $missing_tables ) > 0 ) {
|
||||
delete_option( self::CUSTOM_ORDERS_TABLE_DATA_REGENERATION_IN_PROGRESS );
|
||||
}
|
||||
return count( $missing_tables ) === 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue