id !== 'edit-shop_order') {
return;
}
// Check if HPOS is enabled - skip if it is
if (
function_exists('woocommerce_custom_orders_table_usage_is_enabled') &&
woocommerce_custom_orders_table_usage_is_enabled()
) {
return;
}
// Check post type to ensure we're on the shop order page
if (!isset($_GET['post_type']) || $_GET['post_type'] !== 'shop_order') {
return;
}
$jobManager = syncBasalamContainer()->get(JobManager::class);
$hasRunningJob = $jobManager->getCountJobs([
'job_type' => 'sync_basalam_fetch_orders',
'status' => ['pending', 'processing']
]) > 0;
$nonce = wp_create_nonce('add_unsync_orders_from_basalam_nonce');
?>