3));
}
list($aieo_si_open, $aieo_si_close) = AIEO_DMM_UI::card(array(
'anchor' => 'stock-import-1-how-is-your-csv-keyed',
'icon' => 'key',
'title' => __('1. Key column: SKU or product_id', 'ai-eshop-optimizer'),
'description' => __('The first column of your CSV must be either a WooCommerce SKU or a numeric product_id. The required "stock" column goes next.', 'ai-eshop-optimizer'),
'col' => 1,
));
echo $aieo_si_open;
?>
'stock-import-2-need-an-example-file',
'icon' => 'download',
'title' => __('2. Sample CSV or XLSX', 'ai-eshop-optimizer'),
'description' => __('The sample uses real products from your catalogue so column names and the key format match your shop. Overwrite the stock column with your desired values, then upload it back.', 'ai-eshop-optimizer'),
'col' => 2,
'footer' => ' '
. '',
));
echo $aieo_si_open . $aieo_si_close;
list($aieo_si_open, $aieo_si_close) = AIEO_DMM_UI::card(array(
'anchor' => 'stock-import-3-upload-and-process',
'icon' => 'import',
'title' => __('3. Upload and process', 'ai-eshop-optimizer'),
'description' => __('Upload a CSV with stock levels. Stock is set via the WooCommerce API, so stock-status updates and low-stock emails stay consistent.', 'ai-eshop-optimizer'),
'col' => 3,
));
echo $aieo_si_open;
?>
'aieo-dmm-stock-job',
'state' => 'idle',
'run' => __('Upload & process', 'ai-eshop-optimizer'),
'run_attrs' => array('form' => $aieo_si_form, 'data-action' => 'aieo_dmm_stock_import_upload'),
'detail' => '',
));
echo $aieo_si_job;
echo $aieo_si_close;
if (function_exists('rooster_admin_band_close')) {
rooster_admin_band_close();
}
?>
(string) $job['job_id'],
'created' => (string) $job['created_at'],
'status' => (string) $job['status'],
'processed' => number_format_i18n((int) $job['processed']) . ' / ' . number_format_i18n((int) $job['total']),
'done' => (int) $job['processed'],
'updated' => is_array($params) && isset($params['updated']) ? (int) $params['updated'] : 0,
);
}
if (function_exists('rooster_admin_band_open')) {
rooster_admin_band_open(array('cols' => 1));
}
AIEO_Table::card(array(
'anchor' => 'stock-import-recent-imports',
'icon' => 'clock',
'heading' => 'h2',
'title' => __('Recent imports', 'ai-eshop-optimizer'),
'description' => __('The stock imports run lately, with when each one ran and how it ended.', 'ai-eshop-optimizer'),
'page_id' => 'stock_import',
'row_key' => 'job_id',
'rows' => $aieo_si_rows,
'per_page' => 0,
'filters' => array(array('key' => 'status', 'label' => __('Status', 'ai-eshop-optimizer'), 'kind' => 'values', 'control' => 'select')),
'empty' => __('No imports yet.', 'ai-eshop-optimizer'),
'columns' => array(
array('key' => 'created', 'label' => __('Created', 'ai-eshop-optimizer'), 'nowrap' => true),
array('key' => 'status', 'label' => __('Status', 'ai-eshop-optimizer'), 'type' => 'badge'),
array('key' => 'processed', 'label' => __('Processed', 'ai-eshop-optimizer'), 'sort_key' => 'done', 'nowrap' => true),
array('key' => 'updated', 'label' => __('Updated', 'ai-eshop-optimizer'), 'type' => 'integer'),
),
'actions' => array(
array('id' => 'delete', 'label' => __('Delete', 'ai-eshop-optimizer'), 'class' => 'button button-small aieo-dmm-delete-export-job', 'description' => __('Removes this job from the list and deletes its file.', 'ai-eshop-optimizer')),
),
));
if (function_exists('rooster_admin_band_close')) {
rooster_admin_band_close();
}