Show link to create custom orders table.

This commit is contained in:
vedanshujain 2022-02-08 21:57:39 +05:30
parent 3d29e8329c
commit fc0c45a204
2 changed files with 8 additions and 0 deletions

View File

@ -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(

View File

@ -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;
}