default.php
1 year ago
generic.php
8 years ago
mappings.php
7 years ago
shopify.php
7 years ago
wordpress.php
8 years ago
generic.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Generic mappings |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Importers |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Add generic mappings. |
| 14 | * |
| 15 | * @since 3.1.0 |
| 16 | * @param array $mappings Importer columns mappings. |
| 17 | * @return array |
| 18 | */ |
| 19 | function wc_importer_generic_mappings( $mappings ) { |
| 20 | $generic_mappings = array( |
| 21 | __( 'Title', 'woocommerce' ) => 'name', |
| 22 | __( 'Product Title', 'woocommerce' ) => 'name', |
| 23 | __( 'Price', 'woocommerce' ) => 'regular_price', |
| 24 | __( 'Parent SKU', 'woocommerce' ) => 'parent_id', |
| 25 | __( 'Quantity', 'woocommerce' ) => 'stock_quantity', |
| 26 | __( 'Menu order', 'woocommerce' ) => 'menu_order', |
| 27 | ); |
| 28 | |
| 29 | return array_merge( $mappings, $generic_mappings ); |
| 30 | } |
| 31 | add_filter( 'woocommerce_csv_product_import_mapping_default_columns', 'wc_importer_generic_mappings' ); |
| 32 |