WC_Product_CSV_Importer_Controller::mapping_form
Mapping step.
Метод класса: WC_Product_CSV_Importer_Controller{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->mapping_form();
Код WC_Product_CSV_Importer_Controller::mapping_form() WC Product CSV Importer Controller::mapping form WC 10.4.3
protected function mapping_form() {
check_admin_referer( 'woocommerce-csv-importer' );
self::validate_file_path( $this->file );
$args = array(
'lines' => 1,
'delimiter' => $this->delimiter,
'character_encoding' => $this->character_encoding,
);
$importer = self::get_importer( $this->file, $args );
$headers = $importer->get_raw_keys();
$mapped_items = $this->auto_map_columns( $headers );
$sample = current( $importer->get_raw_data() );
if ( empty( $sample ) ) {
$this->add_error(
__( 'The file is empty or using a different encoding than UTF-8, please try again with a new file.', 'woocommerce' ),
array(
array(
'url' => admin_url( 'edit.php?post_type=product&page=product_importer' ),
'label' => __( 'Upload a new file', 'woocommerce' ),
),
)
);
// Force output the errors in the same page.
$this->output_errors();
return;
}
include_once __DIR__ . '/views/html-csv-import-mapping.php';
}