2017-05-29 18:16:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add generic mappings.
|
|
|
|
*
|
|
|
|
* @since 3.1.0
|
|
|
|
* @param array $mappings
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
function wc_importer_generic_mappings( $mappings ) {
|
|
|
|
$generic_mappings = array(
|
|
|
|
__( 'Title', 'woocommerce' ) => 'name',
|
|
|
|
__( 'Product Title', 'woocommerce' ) => 'name',
|
|
|
|
__( 'Price', 'woocommerce' ) => 'regular_price',
|
|
|
|
__( 'Parent SKU', 'woocommerce' ) => 'parent_id',
|
2017-05-30 16:04:16 +00:00
|
|
|
__( 'Quantity', 'woocommerce' ) => 'stock_quantity',
|
2017-08-22 20:22:39 +00:00
|
|
|
__( 'Menu order', 'woocommerce' ) => 'menu_order',
|
2017-05-29 18:16:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return array_merge( $mappings, $generic_mappings );
|
|
|
|
}
|
|
|
|
add_filter( 'woocommerce_csv_product_import_mapping_default_columns', 'wc_importer_generic_mappings' );
|