Product Import Export for WooCommerce - Version 2.1.5

Version Description

  • Add Supports auto mapping of default fields from the CSV exported using default WC export tool.
  • Add - Option to include Taxonomies (categories/tags/shipping-class), attributes in quick export.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Product Import Export for WooCommerce
Version 2.1.5
Comparing to
See all releases

Code changes from version 2.1.4 to 2.1.5

admin/modules/export/views/_export_method_export_page.php CHANGED
@@ -20,6 +20,9 @@ if (!defined('ABSPATH')) {
20
  <td colspan="2" style="width:75%;">
21
  <div class="wt_iew_radio_block">
22
  <?php
 
 
 
23
  foreach($this->export_obj->export_methods as $key => $value)
24
  {
25
  ?>
@@ -34,8 +37,8 @@ if (!defined('ABSPATH')) {
34
 
35
  </td>
36
  </tr>
37
-
38
- <!-- <tr class="wt-iew-export-method-options wt-iew-export-method-options-quick">
39
  <th style="width:150px; text-align:left; vertical-align:top;"><label><?php _e('Include fields from the respective groups');?></label></th>
40
  <td colspan="2" style="width:75%;">
41
  <?php
@@ -63,8 +66,8 @@ if (!defined('ABSPATH')) {
63
  ?>
64
  <span class="wt-iew_form_help"><?php _e('Enabling any of these ensures that all the fields from the respective groups are included in your export.');?></span>
65
  </td>
66
- </tr>-->
67
-
68
 
69
  <tr class="wt-iew-export-method-options wt-iew-export-method-options-template" style="display:none;">
70
  <th><label><?php _e('Export template');?></label></th>
20
  <td colspan="2" style="width:75%;">
21
  <div class="wt_iew_radio_block">
22
  <?php
23
+ if(empty($this->mapping_templates)){
24
+ unset($this->export_obj->export_methods['template']);
25
+ }
26
  foreach($this->export_obj->export_methods as $key => $value)
27
  {
28
  ?>
37
 
38
  </td>
39
  </tr>
40
+ <?php if(!empty($this->mapping_enabled_fields)):?>
41
+ <tr class="wt-iew-export-method-options wt-iew-export-method-options-quick">
42
  <th style="width:150px; text-align:left; vertical-align:top;"><label><?php _e('Include fields from the respective groups');?></label></th>
43
  <td colspan="2" style="width:75%;">
44
  <?php
66
  ?>
67
  <span class="wt-iew_form_help"><?php _e('Enabling any of these ensures that all the fields from the respective groups are included in your export.');?></span>
68
  </td>
69
+ </tr>
70
+ <?php endif; ?>
71
 
72
  <tr class="wt-iew-export-method-options wt-iew-export-method-options-template" style="display:none;">
73
  <th><label><?php _e('Export template');?></label></th>
admin/modules/import/classes/class-import-ajax.php CHANGED
@@ -221,6 +221,19 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
221
 
222
  /* This is the sample data from input file */
223
  $file_heading_meta_fields=(isset($_POST['file_head_meta']) ? json_decode(stripslashes($_POST['file_head_meta']), true) : array());
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
  //taking current page form data
226
  $meta_step_form_data=(isset($this->selected_template_form_data['meta_step_form_data']) ? $this->selected_template_form_data['meta_step_form_data'] : array());
@@ -295,11 +308,15 @@ class Wt_Import_Export_For_Woo_Basic_Import_Ajax
295
  $checked=1; /* import this column? */
296
  $val='{'.$key.'}';
297
  unset($file_heading_meta_fields[$key]); //remove the field from file heading list
 
 
 
 
298
  }
299
  $temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
300
  }
301
  }
302
-
303
  if(count($file_heading_meta_fields)>0)
304
  {
305
  $current_field_group_prefix_arr=(isset($this->field_group_prefixes[$meta_mapping_screen_field_key]) ? $this->field_group_prefixes[$meta_mapping_screen_field_key] : array());
221
 
222
  /* This is the sample data from input file */
223
  $file_heading_meta_fields=(isset($_POST['file_head_meta']) ? json_decode(stripslashes($_POST['file_head_meta']), true) : array());
224
+
225
+
226
+ $sample_data = array();
227
+ include_once WT_P_IEW_PLUGIN_PATH . 'admin/classes/class-csvreader.php';
228
+ $delimiter = (isset($_POST['delimiter']) ? ($_POST['delimiter']) : ','); //no sanitization
229
+ $reader = new Wt_Import_Export_For_Woo_Basic_Csvreader($delimiter);
230
+
231
+ /* take first two rows in csv and in xml takes column keys and a sample data */
232
+ $temp_import_file = (isset($_POST['temp_import_file']) ? sanitize_file_name($_POST['temp_import_file']) : '');
233
+ if ($temp_import_file != "") {
234
+ $file_path = $this->import_obj->get_file_path($temp_import_file);
235
+ $sample_data = $reader->get_sample_data($file_path, true);
236
+ }
237
 
238
  //taking current page form data
239
  $meta_step_form_data=(isset($this->selected_template_form_data['meta_step_form_data']) ? $this->selected_template_form_data['meta_step_form_data'] : array());
308
  $checked=1; /* import this column? */
309
  $val='{'.$key.'}';
310
  unset($file_heading_meta_fields[$key]); //remove the field from file heading list
311
+ }elseif(isset($val_arr['field_type']) && 'alternates' == $val_arr['field_type'] && isset ($sample_data[$val_arr['similar_fields']]) ){
312
+ $checked=1; /* import this column? */
313
+ $val='{'.$val_arr['similar_fields'].'}';
314
+ unset($file_heading_meta_fields[$key]); //remove the field from file heading list
315
  }
316
  $temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
317
  }
318
  }
319
+
320
  if(count($file_heading_meta_fields)>0)
321
  {
322
  $current_field_group_prefix_arr=(isset($this->field_group_prefixes[$meta_mapping_screen_field_key]) ? $this->field_group_prefixes[$meta_mapping_screen_field_key] : array());
admin/modules/import/views/_import_mapping_page.php CHANGED
@@ -143,7 +143,7 @@ if (!defined('ABSPATH')) {
143
  if(count($mapping_fields)>0)
144
  {
145
  $array_keys_file_heading_default_fields = array_keys($file_heading_default_fields);
146
- $allowed_field_types=array('start_with', 'end_with', 'contain');
147
  foreach($mapping_fields as $key=>$val_arr)
148
  {
149
  $label=(isset($val_arr['title']) ? $val_arr['title'] : '');
@@ -174,10 +174,11 @@ if (!defined('ABSPATH')) {
174
 
175
  $field_type=(isset($val_arr['field_type']) ? $val_arr['field_type'] : '');
176
  if($field_type!="" && in_array($field_type, $allowed_field_types)) // it may be a different field type
177
- {
178
  foreach ($file_heading_default_fields as $def_key => $def_val)
179
  {
180
  $matched=false;
 
181
  if($field_type=='start_with' && strpos($def_key, $key)===0)
182
  {
183
  $matched=true;
@@ -190,8 +191,19 @@ if (!defined('ABSPATH')) {
190
  {
191
  $matched=true;
192
  }
193
- if($matched)
 
 
 
 
 
194
  {
 
 
 
 
 
 
195
  $checked=1; // import this column?
196
  $val='{'.$def_key.'}';
197
  $label=$def_key;
@@ -200,7 +212,7 @@ if (!defined('ABSPATH')) {
200
  unset($file_heading_default_fields[$def_key]); //remove the field from file heading list
201
  include "_import_mapping_tr_html.php";
202
  $tr_count++;
203
- $key=$key_backup;
204
  }
205
  }
206
  }else /* unmatched keys */
143
  if(count($mapping_fields)>0)
144
  {
145
  $array_keys_file_heading_default_fields = array_keys($file_heading_default_fields);
146
+ $allowed_field_types=array('start_with', 'end_with', 'contains', 'alternates');
147
  foreach($mapping_fields as $key=>$val_arr)
148
  {
149
  $label=(isset($val_arr['title']) ? $val_arr['title'] : '');
174
 
175
  $field_type=(isset($val_arr['field_type']) ? $val_arr['field_type'] : '');
176
  if($field_type!="" && in_array($field_type, $allowed_field_types)) // it may be a different field type
177
+ {
178
  foreach ($file_heading_default_fields as $def_key => $def_val)
179
  {
180
  $matched=false;
181
+ $alternate_set = false;
182
  if($field_type=='start_with' && strpos($def_key, $key)===0)
183
  {
184
  $matched=true;
191
  {
192
  $matched=true;
193
  }
194
+ elseif($field_type=='alternates' && in_array($def_key, $val_arr['similar_fields']))
195
+ {
196
+ $alternate_set = true;
197
+ $matched = true;
198
+ }
199
+ if($matched && $alternate_set)
200
  {
201
+ $checked=1; // import this column?
202
+ $val='{'.$def_key.'}';
203
+ unset($file_heading_default_fields[$def_key]); //remove the field from file heading list
204
+ include "_import_mapping_tr_html.php";
205
+ $tr_count++;
206
+ }elseif($matched){
207
  $checked=1; // import this column?
208
  $val='{'.$def_key.'}';
209
  $label=$def_key;
212
  unset($file_heading_default_fields[$def_key]); //remove the field from file heading list
213
  include "_import_mapping_tr_html.php";
214
  $tr_count++;
215
+ $key=$key_backup;
216
  }
217
  }
218
  }else /* unmatched keys */
admin/modules/import/views/_import_method_import_page.php CHANGED
@@ -14,6 +14,9 @@ if (!defined('ABSPATH')) {
14
  <td colspan="2" style="width:75%;">
15
  <div class="wt_iew_radio_block">
16
  <?php
 
 
 
17
  foreach($this->import_obj->import_methods as $key => $value)
18
  {
19
  ?>
14
  <td colspan="2" style="width:75%;">
15
  <div class="wt_iew_radio_block">
16
  <?php
17
+ if(empty($this->mapping_templates)){
18
+ unset($this->import_obj->import_methods['template']);
19
+ }
20
  foreach($this->import_obj->import_methods as $key => $value)
21
  {
22
  ?>
admin/modules/product/data/data/data-wf-reserved-fields-pair.php CHANGED
@@ -1,52 +1,57 @@
1
  <?php
 
 
 
2
 
 
 
3
  // Reserved column names
4
  $post_columns = array(
5
- 'post_title' => array('title'=>'Product name','description'=>'Product Title. ie Name of the product'),
6
- 'post_name' => array('title'=>'Product permalink','description'=>'Unique part of the product URL'),
7
  'ID' => array('title'=>'ID','description'=>'Product ID'),
8
  'post_parent' => array('title'=>'Parent ID','description'=>'Parent Product ID , if you are importing variation Product'),
9
- 'post_status' => array('title'=>'Status','description'=>'Product Status ( published , draft ...)'),
10
- 'post_content' => array('title'=>'Description','description'=>'Description about the Product'),
11
- 'post_excerpt' => array('title'=>'Short description','description'=>'Short description about the Product'),
12
  'post_date' => array('title'=>'Post date','description'=>'Product posted date', 'type' => 'date'),
13
  'post_password' => array('title'=>'Post password','description'=>'To Protect a post with password'),
14
  'post_author' => array('title'=>'Product author','description'=>'Product Author ( 1 - Admin )'),
15
  'menu_order' => array('title'=>'Menu order','description'=>'If menu enabled , menu order'),
16
- 'comment_status' => array('title'=>'Comment status','description'=>'Comment Status ( Open or Closed comments for this prodcut)'),
17
  //'post_date_gmt' => array('title'=>'Post Date GMT','description'=>'Tooltip data Status'),
18
 
19
  'sku' => array('title'=>'SKU','description'=>'Product SKU - This will unique and Product identifier'),
20
  'parent_sku' => array('title'=>'Parent SKU','description'=>'Parent Product SKU , if you are importing variation Product'),
21
- 'children' => array('title'=>'Child product ID','description'=>'Linked Products id if you are importing Grouped products'),
22
  'downloadable' => array('title'=>'Type: Downloadable','description'=>'Is Product is downloadable eg:- Book'),
23
  'virtual' => array('title'=>'Type: Virtual','description'=>'Is Product is virtual'),
24
- 'visibility' => array('title'=>'Visibility: Visibility','description'=>'Visibility status ( hidden or visible)'),
25
- 'purchase_note' => array('title'=>'Purchase note','description'=>'Purchase note'),
26
  'stock' => array('title'=>'Inventory: Stock','description'=>'Stock quantity'),
27
- 'stock_status' => array('title'=>'Inventory: Stock status','description'=>'InStock or OutofStock'),
28
- 'backorders' => array('title'=>'Inventory: Backorders','description'=>'Backorders'),
29
- 'sold_individually' => array('title'=>'Inventory: Sold individually','description'=>'Sold individually'),
30
- 'low_stock_amount' => array('title'=>'Inventory: Low stock amount','description'=>'Low stock amount'),
31
  'manage_stock' => array('title'=>'Inventory: Manage stock','description'=>'yes to enable no to disable'),
32
- 'sale_price' => array('title'=>'Price: sale price','description'=>'Sale Price'),
33
- 'regular_price' => array('title'=>'Price: regular price','description'=>'Regular Price'),
34
- 'sale_price_dates_from' => array('title'=>'Sale price dates: From','description'=>'Sale Price Dates effect from', 'type' => 'date'),
35
- 'sale_price_dates_to' => array('title'=>'Sale price dates: To','description'=>'Sale Price Dates effect to', 'type' => 'date'),
36
- 'weight' => array('title'=>'Dimensions: Weight','description'=>'Wight of product in LB , OZ , KG as of your woocommerce Unit'),
37
- 'length' => array('title'=>'Dimensions: Length','description'=>'Length'),
38
- 'width' => array('title'=>'Dimensions: Width','description'=>'Width'),
39
- 'height' => array('title'=>'Dimensions: Height','description'=>'Height'),
40
- 'tax_status' => array('title'=>'Tax: Tax status','description'=>'Taxable product or not'),
41
- 'tax_class' => array('title'=>'Tax: Tax class','description'=>'Tax class ( eg:- reduced rate)'),
42
- 'upsell_ids' => array('title'=>'Related products: Upsell IDs','description'=>'Upsell Product ids'),
43
- 'crosssell_ids' => array('title'=>'Related products: Crosssell IDs','description'=>'Crosssell Product ids'),
44
  'file_paths' => array('title'=>'Downloads: File paths (WC 2.0.x)','description'=>'File Paths'),
45
  'downloadable_files' => array('title'=>'Downloads: Downloadable files (WC 2.1.x)','description'=>'Downloadable Files'),
46
- 'download_limit' => array('title'=>'Downloads: Download limit','description'=>'Download Limit'),
47
- 'download_expiry' => array('title'=>'Downloads: Download expiry','description'=>'Download Expiry'),
48
- 'product_url' => array('title'=>'External: Product URL','description'=>'Product URL if the Product is external'),
49
- 'button_text' => array('title'=>'External: Button text','description'=>'Buy button text for Product , if the Product is external'),
50
  'images' => array('title'=>'Images/Gallery','description'=>'Image URLs seperated with &#124;'),
51
  'product_page_url' => array('title'=>'Product page URL','description'=>'Product Page URL'),
52
  'meta:total_sales' => array('title'=>'meta:total_sales','description'=>'Total sales for the Product'),
1
  <?php
2
+ if (!defined('WPINC')) {
3
+ exit;
4
+ }
5
 
6
+ $wc_weight_unit = get_option('woocommerce_weight_unit');
7
+ $wc_dimension_unit = get_option('woocommerce_dimension_unit');
8
  // Reserved column names
9
  $post_columns = array(
10
+ 'post_title' => array('title'=>'Product name','description'=>'Product Title. ie Name of the product', 'field_type' => 'alternates', 'similar_fields' => array('Name')),
11
+ 'post_name' => array('title'=>'Product permalink','description'=>'Unique part of the product URL', 'field_type' => 'alternates', 'similar_fields' => array('slug')),
12
  'ID' => array('title'=>'ID','description'=>'Product ID'),
13
  'post_parent' => array('title'=>'Parent ID','description'=>'Parent Product ID , if you are importing variation Product'),
14
+ 'post_status' => array('title'=>'Status','description'=>'Product Status ( published , draft ...)', 'field_type' => 'alternates', 'similar_fields' => array('Published')),
15
+ 'post_content' => array('title'=>'Description','description'=>'Description about the Product', 'field_type' => 'alternates', 'similar_fields' => array('Description')),
16
+ 'post_excerpt' => array('title'=>'Short description','description'=>'Short description about the Product', 'field_type' => 'alternates', 'similar_fields' => array('Short description')),
17
  'post_date' => array('title'=>'Post date','description'=>'Product posted date', 'type' => 'date'),
18
  'post_password' => array('title'=>'Post password','description'=>'To Protect a post with password'),
19
  'post_author' => array('title'=>'Product author','description'=>'Product Author ( 1 - Admin )'),
20
  'menu_order' => array('title'=>'Menu order','description'=>'If menu enabled , menu order'),
21
+ 'comment_status' => array('title'=>'Comment status','description'=>'Comment Status ( Open or Closed comments for this prodcut)', 'field_type' => 'alternates', 'similar_fields' => array('Allow customer reviews?')),
22
  //'post_date_gmt' => array('title'=>'Post Date GMT','description'=>'Tooltip data Status'),
23
 
24
  'sku' => array('title'=>'SKU','description'=>'Product SKU - This will unique and Product identifier'),
25
  'parent_sku' => array('title'=>'Parent SKU','description'=>'Parent Product SKU , if you are importing variation Product'),
26
+ 'children' => array('title'=>'Child product ID','description'=>'Linked Products id if you are importing Grouped products'),
27
  'downloadable' => array('title'=>'Type: Downloadable','description'=>'Is Product is downloadable eg:- Book'),
28
  'virtual' => array('title'=>'Type: Virtual','description'=>'Is Product is virtual'),
29
+ 'visibility' => array('title'=>'Visibility: Visibility','description'=>'Visibility status ( hidden or visible)', 'field_type' => 'alternates', 'similar_fields' => array('Visibility in catalog')),
30
+ 'purchase_note' => array('title'=>'Purchase note','description'=>'Purchase note', 'field_type' => 'alternates', 'similar_fields' => array('Purchase note')),
31
  'stock' => array('title'=>'Inventory: Stock','description'=>'Stock quantity'),
32
+ 'stock_status' => array('title'=>'Inventory: Stock status','description'=>'InStock or OutofStock', 'field_type' => 'alternates', 'similar_fields' => array('In stock?')),
33
+ 'backorders' => array('title'=>'Inventory: Backorders','description'=>'Backorders', 'field_type' => 'alternates', 'similar_fields' => array('Backorders allowed?')),
34
+ 'sold_individually' => array('title'=>'Inventory: Sold individually','description'=>'Sold individually', 'field_type' => 'alternates', 'similar_fields' => array('Sold individually?')),
35
+ 'low_stock_amount' => array('title'=>'Inventory: Low stock amount','description'=>'Low stock amount', 'field_type' => 'alternates', 'similar_fields' => array('Low stock amount')),
36
  'manage_stock' => array('title'=>'Inventory: Manage stock','description'=>'yes to enable no to disable'),
37
+ 'sale_price' => array('title'=>'Price: sale price','description'=>'Sale Price', 'field_type' => 'alternates', 'similar_fields' => array('Sale price')),
38
+ 'regular_price' => array('title'=>'Price: regular price','description'=>'Regular Price', 'field_type' => 'alternates', 'similar_fields' => array('Regular price')),
39
+ 'sale_price_dates_from' => array('title'=>'Sale price dates: From','description'=>'Sale Price Dates effect from', 'type' => 'date', 'field_type' => 'alternates', 'similar_fields' => array('Date sale price starts')),
40
+ 'sale_price_dates_to' => array('title'=>'Sale price dates: To','description'=>'Sale Price Dates effect to', 'type' => 'date', 'field_type' => 'alternates', 'similar_fields' => array('Date sale price ends')),
41
+ 'weight' => array('title'=>'Dimensions: Weight','description'=>'Wight of product in LB , OZ , KG as of your woocommerce Unit', 'field_type' => 'alternates', 'similar_fields' => array("Weight ($wc_weight_unit)")),
42
+ 'length' => array('title'=>'Dimensions: Length','description'=>'Length', 'field_type' => 'alternates', 'similar_fields' => array("Length ($wc_dimension_unit)")),
43
+ 'width' => array('title'=>'Dimensions: Width','description'=>'Width', 'field_type' => 'alternates', 'similar_fields' => array("Width ($wc_dimension_unit)")),
44
+ 'height' => array('title'=>'Dimensions: Height','description'=>'Height', 'field_type' => 'alternates', 'similar_fields' => array("Height ($wc_dimension_unit)")),
45
+ 'tax_status' => array('title'=>'Tax: Tax status','description'=>'Taxable product or not', 'field_type' => 'alternates', 'similar_fields' => array('Tax status')),
46
+ 'tax_class' => array('title'=>'Tax: Tax class','description'=>'Tax class ( eg:- reduced rate)', 'field_type' => 'alternates', 'similar_fields' => array('Tax class')),
47
+ 'upsell_ids' => array('title'=>'Related products: Upsell IDs','description'=>'Upsell Product ids', 'field_type' => 'alternates', 'similar_fields' => array('Upsells')),
48
+ 'crosssell_ids' => array('title'=>'Related products: Crosssell IDs','description'=>'Crosssell Product ids', 'field_type' => 'alternates', 'similar_fields' => array('Cross-sells')),
49
  'file_paths' => array('title'=>'Downloads: File paths (WC 2.0.x)','description'=>'File Paths'),
50
  'downloadable_files' => array('title'=>'Downloads: Downloadable files (WC 2.1.x)','description'=>'Downloadable Files'),
51
+ 'download_limit' => array('title'=>'Downloads: Download limit','description'=>'Download Limit', 'field_type' => 'alternates', 'similar_fields' => array('Download limit')),
52
+ 'download_expiry' => array('title'=>'Downloads: Download expiry','description'=>'Download Expiry', 'field_type' => 'alternates', 'similar_fields' => array('Download expiry days')),
53
+ 'product_url' => array('title'=>'External: Product URL','description'=>'Product URL if the Product is external', 'field_type' => 'alternates', 'similar_fields' => array('External URL')),
54
+ 'button_text' => array('title'=>'External: Button text','description'=>'Buy button text for Product , if the Product is external', 'field_type' => 'alternates', 'similar_fields' => array('Button text')),
55
  'images' => array('title'=>'Images/Gallery','description'=>'Image URLs seperated with &#124;'),
56
  'product_page_url' => array('title'=>'Product page URL','description'=>'Product Page URL'),
57
  'meta:total_sales' => array('title'=>'meta:total_sales','description'=>'Total sales for the Product'),
admin/modules/product/import/import.php CHANGED
@@ -471,7 +471,7 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
471
  $this->item_data['wpml'][] = array('key' => esc_attr($column), 'value' => $value);
472
  }
473
  }
474
-
475
  if(empty($this->item_data['id'])){
476
  $this->item_data['id'] = $this->wt_parse_id_field($mapped_data);
477
  }
471
  $this->item_data['wpml'][] = array('key' => esc_attr($column), 'value' => $value);
472
  }
473
  }
474
+
475
  if(empty($this->item_data['id'])){
476
  $this->item_data['id'] = $this->wt_parse_id_field($mapped_data);
477
  }
admin/modules/product/product.php CHANGED
@@ -283,7 +283,7 @@ class Wt_Import_Export_For_Woo_Basic_Product {
283
  public function exporter_alter_mapping_enabled_fields($mapping_enabled_fields, $base, $form_data_mapping_enabled_fields) {
284
  if ($base == $this->module_base) {
285
  $mapping_enabled_fields = array();
286
- $mapping_enabled_fields['taxonomies'] = array(__('Taxonomies (cat/tags/shipping-class)'), 1);
287
 
288
  $mapping_enabled_fields['attributes'] = array(__('Attributes'), 1);
289
 
@@ -345,7 +345,30 @@ class Wt_Import_Export_For_Woo_Basic_Product {
345
  $out=array();
346
  foreach ($fields as $key => $value)
347
  {
348
- $value['fields']=array_map(function($vl){ return array('title'=>$vl, 'description'=>$vl); }, $value['fields']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  $out[$key]=$value;
350
  }
351
  return $out;
283
  public function exporter_alter_mapping_enabled_fields($mapping_enabled_fields, $base, $form_data_mapping_enabled_fields) {
284
  if ($base == $this->module_base) {
285
  $mapping_enabled_fields = array();
286
+ $mapping_enabled_fields['taxonomies'] = array(__('Taxonomies (categories/tags/shipping-class)'), 1);
287
 
288
  $mapping_enabled_fields['attributes'] = array(__('Attributes'), 1);
289
 
345
  $out=array();
346
  foreach ($fields as $key => $value)
347
  {
348
+ $value['fields'] = array_map(function($vl){
349
+ $meta_mapping_temp = array('title'=>$vl, 'description'=>$vl);
350
+
351
+ // For fileds other than default fields, the alternates slect firlds cannot be set as of now
352
+ // Its called after loading the default fields so need to load head again in backend to set from similar array
353
+ // Here user alternate field as single value. ( For defaults, its array )
354
+ if( 'tax:product_type' === $vl){
355
+ $meta_mapping_temp['field_type'] = 'alternates';
356
+ $meta_mapping_temp['similar_fields'] = 'Type';
357
+ }
358
+ if( 'tax:product_tag' === $vl){
359
+ $meta_mapping_temp['field_type'] = 'alternates';
360
+ $meta_mapping_temp['similar_fields'] = 'Tags';
361
+ }
362
+ if( 'tax:product_cat' === $vl){
363
+ $meta_mapping_temp['field_type'] = 'alternates';
364
+ $meta_mapping_temp['similar_fields'] = 'Categories';
365
+ }
366
+ if( 'tax:product_shipping_class' === $vl){
367
+ $meta_mapping_temp['field_type'] = 'alternates';
368
+ $meta_mapping_temp['similar_fields'] = 'Shipping class';
369
+ }
370
+
371
+ return $meta_mapping_temp; }, $value['fields']);
372
  $out[$key]=$value;
373
  }
374
  return $out;
admin/partials/_form_field_generator.php CHANGED
@@ -229,7 +229,7 @@ foreach($form_fields as $key=>$value)
229
  }
230
  }
231
  }
232
- if(in_array('wc-customer-search', $css_class_arr)){
233
  foreach($vl as $single_vl)
234
  {
235
  $single_vl=(int) $single_vl;
229
  }
230
  }
231
  }
232
+ if(in_array('wc-customer-search', $css_class_arr) || in_array('wt-user-search', $css_class_arr) ){
233
  foreach($vl as $single_vl)
234
  {
235
  $single_vl=(int) $single_vl;
includes/class-wt-import-export-for-woo.php CHANGED
@@ -80,7 +80,7 @@ class Wt_Import_Export_For_Woo_Basic {
80
  if ( defined( 'WT_P_IEW_VERSION' ) ) {
81
  $this->version = WT_P_IEW_VERSION;
82
  } else {
83
- $this->version = '2.1.4';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
80
  if ( defined( 'WT_P_IEW_VERSION' ) ) {
81
  $this->version = WT_P_IEW_VERSION;
82
  } else {
83
+ $this->version = '2.1.5';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
product-import-export-for-woo.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
- Version: 2.1.4
9
  WC tested up to: 6.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -43,7 +43,7 @@ if ( !defined( 'WT_IEW_DEBUG_BASIC_TROUBLESHOOT' ) ) {
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
- define( 'WT_P_IEW_VERSION', '2.1.4' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
+ Version: 2.1.5
9
  WC tested up to: 6.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
+ define( 'WT_P_IEW_VERSION', '2.1.5' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: product export, product import, CSV import export, woocommerce, CSV, produ
5
  Requires at least: 3.0.1
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 2.1.4
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -29,6 +29,8 @@ The Product Import Export for WooCommerce plugin exports and imports WooCommerce
29
  * <strong>Bulk edit products</strong>.
30
  * Import and export <strong>product categories [New]</strong>.
31
  * Import and export <strong>product tags [New]</strong>.
 
 
32
 
33
  ##Additional Features##
34
 
@@ -128,6 +130,11 @@ Other useful plugins from WebToffee for migrating WooCommerce/WordPress data:
128
 
129
  == Frequently Asked Questions ==
130
 
 
 
 
 
 
131
  = Why am I getting empty CSV while exporting? =
132
 
133
  The plugin supports simple, grouped, and affiliate/external product types only. Hence, if you export variable products with the plugin the resulting CSV will be empty.
@@ -187,6 +194,9 @@ Yes. You can import grouped, affiliate/external products in addition to simple p
187
 
188
  == Changelog ==
189
 
 
 
 
190
  = 2.1.4 =
191
  * WC 6.1 tested OK.
192
  * Enhancement – Export all language products if WPML is active and the language selected is all.
@@ -529,8 +539,6 @@ Yes. You can import grouped, affiliate/external products in addition to simple p
529
 
530
  == Upgrade Notice ==
531
 
532
- = 2.1.4 =
533
- * WC 6.1 tested OK.
534
- * Enhancement Export all language products if WPML is active and the language selected is all.
535
- * Enhancement – Inform user when no products to export instead of empty CSV.
536
- * Add – Export products based on stock status.
5
  Requires at least: 3.0.1
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.1.5
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
29
  * <strong>Bulk edit products</strong>.
30
  * Import and export <strong>product categories [New]</strong>.
31
  * Import and export <strong>product tags [New]</strong>.
32
+ * Export products based on stock status <strong>[New]</strong>.
33
+
34
 
35
  ##Additional Features##
36
 
130
 
131
  == Frequently Asked Questions ==
132
 
133
+ = Import of attributes not working using the WooCommerce export CSV? =
134
+
135
+ Product import export plugin lets you import the CSV exported using WooCommerce default export tools by mapping all default fields automatically. However, due to the data format difference in the CSV, attribute fields aren’t supported at the moment. To successfully import the attributes, you can alter the attribute columns.
136
+ For more details, refer: <a href="https://www.webtoffee.com/how-to-import-product-attributes-exported-using-woocommerce-export-tool/">How to import product attributes exported using WooCommerce export tool?</a>
137
+
138
  = Why am I getting empty CSV while exporting? =
139
 
140
  The plugin supports simple, grouped, and affiliate/external product types only. Hence, if you export variable products with the plugin the resulting CSV will be empty.
194
 
195
  == Changelog ==
196
 
197
+ = 2.1.5 =
198
+ * Add – Supports auto mapping of default fields from the CSV exported using default WC export tool.
199
+ * Add - Option to include Taxonomies (categories/tags/shipping-class), attributes in quick export.
200
  = 2.1.4 =
201
  * WC 6.1 tested OK.
202
  * Enhancement – Export all language products if WPML is active and the language selected is all.
539
 
540
  == Upgrade Notice ==
541
 
542
+ = 2.1.5 =
543
+ * Add – Supports auto mapping of default fields from the CSV exported using default WC export tool.
544
+ * Add - Option to include Taxonomies (categories/tags/shipping-class), attributes in quick export.