Product Import Export for WooCommerce - Version 2.0.2

Version Description

  • Tested OK with WC 5.4
Download this release

Release Info

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

Code changes from version 2.0.1 to 2.0.2

admin/classes/class-csvreader.php CHANGED
@@ -65,6 +65,7 @@ class Wt_Import_Export_For_Woo_Basic_Csvreader
65
 
66
  foreach($sample_data_key as $k => $key)
67
  {
 
68
  if(!$key)
69
  {
70
  continue;
@@ -212,7 +213,7 @@ class Wt_Import_Export_For_Woo_Basic_Csvreader
212
  /* clearing temp variables */
213
  $row_column_count=$head_column_count=null;
214
  unset($row_column_count, $head_column_count);
215
-
216
  /* preparing associative array */
217
  $data_row=array_combine($head_arr, $row);
218
 
65
 
66
  foreach($sample_data_key as $k => $key)
67
  {
68
+ $key = trim($key);
69
  if(!$key)
70
  {
71
  continue;
213
  /* clearing temp variables */
214
  $row_column_count=$head_column_count=null;
215
  unset($row_column_count, $head_column_count);
216
+ $head_arr = array_map('trim', $head_arr);
217
  /* preparing associative array */
218
  $data_row=array_combine($head_arr, $row);
219
 
admin/modules/export/export.php CHANGED
@@ -126,7 +126,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
126
  $fields['default_export_batch']=array(
127
  'label'=>__("Default Export batch count"),
128
  'type'=>'number',
129
- 'value' =>100,
130
  'field_name'=>'default_export_batch',
131
  'help_text'=>__('Provide the default count for the records to be exported in a batch.'),
132
  'validation_rule'=>array('type'=>'absint'),
@@ -634,7 +634,6 @@ class Wt_Import_Export_For_Woo_Basic_Export
634
  * @return array $export_data Altered export data
635
  */
636
  $export_data=apply_filters('wt_iew_alter_export_data_basic', $export_data, $offset, $is_last_offset, $file_as, $this->to_export, $csv_delimiter);
637
-
638
  $writer->write_to_file($export_data, $offset, $is_last_offset, $this->to_export);
639
  }
640
 
126
  $fields['default_export_batch']=array(
127
  'label'=>__("Default Export batch count"),
128
  'type'=>'number',
129
+ 'value' =>30,
130
  'field_name'=>'default_export_batch',
131
  'help_text'=>__('Provide the default count for the records to be exported in a batch.'),
132
  'validation_rule'=>array('type'=>'absint'),
634
  * @return array $export_data Altered export data
635
  */
636
  $export_data=apply_filters('wt_iew_alter_export_data_basic', $export_data, $offset, $is_last_offset, $file_as, $this->to_export, $csv_delimiter);
 
637
  $writer->write_to_file($export_data, $offset, $is_last_offset, $this->to_export);
638
  }
639
 
admin/modules/history/history.php CHANGED
@@ -166,7 +166,7 @@ class Wt_Import_Export_For_Woo_Basic_History
166
  }
167
  }else{
168
  $out['status']=1;
169
- $out['html']= sprintf( __( 'Please check the Save import log is enabled under <a target = "_blank" href="%s">settings</a>' ), admin_url('admin.php?page=wt_import_export_for_woo_basic'));
170
  }
171
  }
172
  }
166
  }
167
  }else{
168
  $out['status']=1;
169
+ $out['html']= sprintf( __( 'Please check the Generate import log is enabled under <a target = "_blank" href="%s">settings</a>' ), admin_url('admin.php?page=wt_import_export_for_woo_basic'));
170
  }
171
  }
172
  }
admin/modules/product/data/data-product-post-columns.php CHANGED
@@ -26,39 +26,38 @@ $post_columns = array(
26
  'comment_status' => 'comment_status',
27
  // Meta
28
 
29
- '_sku' => 'sku',
30
  'parent_sku' => 'parent_sku',
31
  'parent' => 'Parent Title',
32
- '_children' => 'children', //For Grouped products
33
- '_downloadable' => 'downloadable',
34
- '_virtual' => 'virtual',
35
- '_stock' => 'stock',
36
- '_regular_price' => 'Regular Price',
37
- '_sale_price' => 'Sale Price',
38
- '_weight' => 'weight',
39
- '_length' => 'length',
40
- '_width' => 'width',
41
- '_height' => 'height',
42
- '_tax_class' => 'tax_class',
43
- '_visibility' => 'visibility',
44
- '_stock_status' => 'stock_status',
45
- '_backorders' => 'backorders',
46
- '_sold_individually' => 'sold_individually',
47
- '_low_stock_amount' => 'low_stock_amount',
48
- '_manage_stock' => 'manage_stock',
49
- '_tax_status' => 'tax_status',
50
- '_upsell_ids' => 'upsell_ids',
51
- '_crosssell_ids' => 'crosssell_ids',
52
- '_featured' => 'featured',
53
- '_purchase_note' => '_purchase_note',
54
- '_sale_price_dates_from' => 'sale_price_dates_from',
55
- '_sale_price_dates_to' => 'sale_price_dates_to',
56
  // Downloadable products
57
- '_download_limit' => 'download_limit',
58
- '_download_expiry' => 'download_expiry',
59
  // Virtual products
60
- '_product_url' => 'product_url',
61
- '_button_text' => 'button_text',
62
 
63
 
64
 
26
  'comment_status' => 'comment_status',
27
  // Meta
28
 
29
+ 'sku' => 'sku',
30
  'parent_sku' => 'parent_sku',
31
  'parent' => 'Parent Title',
32
+ 'children' => 'children', //For Grouped products
33
+ 'downloadable' => 'downloadable',
34
+ 'virtual' => 'virtual',
35
+ 'stock' => 'stock',
36
+ 'regular_price' => 'Regular Price',
37
+ 'sale_price' => 'Sale Price',
38
+ 'weight' => 'weight',
39
+ 'length' => 'length',
40
+ 'width' => 'width',
41
+ 'height' => 'height',
42
+ 'tax_class' => 'tax_class',
43
+ 'visibility' => 'visibility',
44
+ 'stock_status' => 'stock_status',
45
+ 'backorders' => 'backorders',
46
+ 'sold_individually' => 'sold_individually',
47
+ 'low_stock_amount' => 'low_stock_amount',
48
+ 'manage_stock' => 'manage_stock',
49
+ 'tax_status' => 'tax_status',
50
+ 'upsell_ids' => 'upsell_ids',
51
+ 'crosssell_ids' => 'crosssell_ids',
52
+ 'purchase_note' => '_purchase_note',
53
+ 'sale_price_dates_from' => 'sale_price_dates_from',
54
+ 'sale_price_dates_to' => 'sale_price_dates_to',
 
55
  // Downloadable products
56
+ 'download_limit' => 'download_limit',
57
+ 'download_expiry' => 'download_expiry',
58
  // Virtual products
59
+ 'product_url' => 'product_url',
60
+ 'button_text' => 'button_text',
61
 
62
 
63
 
admin/modules/product/data/data/data-wf-reserved-fields-pair.php CHANGED
@@ -18,37 +18,36 @@ $post_columns = array(
18
 
19
  'parent' => array('title'=>'Parent Title','description'=>'Parent Product Title , if you are importing variation Product'),
20
  'parent_sku' => array('title'=>'Parent SKU','description'=>'Parent Product SKU , if you are importing variation Product'),
21
- '_sku' => array('title'=>'Product SKU','description'=>'Product SKU - This will unique and Product identifier'),
22
- '_children' => array('title'=>'Children Product ID','description'=>'Linked Products id if you are importing Grouped products'),
23
- '_downloadable' => array('title'=>'Type: Downloadable','description'=>'Is Product is downloadable eg:- Book'),
24
- '_virtual' => array('title'=>'Type: Virtual','description'=>'Is Product is virtual'),
25
- '_visibility' => array('title'=>'Visibility: Visibility','description'=>'Visibility status ( hidden or visible)'),
26
- '_featured' => array('title'=>'Visibility: Featured','description'=>'Featured Product'),
27
- '_purchase_note' => array('title'=>'Purchase note','description'=>'Purchase note'),
28
- '_stock' => array('title'=>'Inventory: Stock','description'=>'Stock quantity'),
29
- '_stock_status' => array('title'=>'Inventory: Stock Status','description'=>'InStock or OutofStock'),
30
- '_backorders' => array('title'=>'Inventory: Backorders','description'=>'Backorders'),
31
- '_sold_individually' => array('title'=>'Inventory: Sold individually','description'=>'Sold individually'),
32
- '_low_stock_amount' => array('title'=>'Inventory: Low stock amount','description'=>'Low stock amount'),
33
- '_manage_stock' => array('title'=>'Inventory: Manage Stock','description'=>'yes to enable no to disable'),
34
- '_sale_price' => array('title'=>'Price: Sale Price','description'=>'Sale Price'),
35
- '_regular_price' => array('title'=>'Price: Regular Price','description'=>'Regular Price'),
36
- '_sale_price_dates_from' => array('title'=>'Sale Price Dates: From','description'=>'Sale Price Dates effect from', 'type' => 'date'),
37
- '_sale_price_dates_to' => array('title'=>'Sale Price Dates: To','description'=>'Sale Price Dates effect to', 'type' => 'date'),
38
- '_weight' => array('title'=>'Dimensions: Weight','description'=>'Wight of product in LB , OZ , KG as of your woocommerce Unit'),
39
- '_length' => array('title'=>'Dimensions: length','description'=>'Length'),
40
- '_width' => array('title'=>'Dimensions: width','description'=>'Width'),
41
- '_height' => array('title'=>'Dimensions: height','description'=>'Height'),
42
- '_tax_status' => array('title'=>'Tax: Tax Status','description'=>'Taxable product or not'),
43
- '_tax_class' => array('title'=>'Tax: Tax Class','description'=>'Tax class ( eg:- reduced rate)'),
44
- '_upsell_ids' => array('title'=>'Related Products: Upsell IDs','description'=>'Upsell Product ids'),
45
- '_crosssell_ids' => array('title'=>'Related Products: Crosssell IDs','description'=>'Crosssell Product ids'),
46
- '_file_paths' => array('title'=>'Downloads: File Paths (WC 2.0.x)','description'=>'File Paths'),
47
- '_downloadable_files' => array('title'=>'Downloads: Downloadable Files (WC 2.1.x)','description'=>'Downloadable Files'),
48
- '_download_limit' => array('title'=>'Downloads: Download Limit','description'=>'Download Limit'),
49
- '_download_expiry' => array('title'=>'Downloads: Download Expiry','description'=>'Download Expiry'),
50
- '_product_url' => array('title'=>'External: Product URL','description'=>'Product URL if the Product is external'),
51
- '_button_text' => array('title'=>'External: Button Text','description'=>'Buy button text for Product , if the Product is external'),
52
  'images' => array('title'=>'Images/Gallery','description'=>'Image URLs seperated with &#124;'),
53
  'product_page_url' => array('title'=>'Product Page URL','description'=>'Product Page URL'),
54
  'meta:total_sales' => array('title'=>'meta:total_sales','description'=>'Total sales for the Product'),
@@ -99,316 +98,4 @@ if (apply_filters('wpml_setting', false, 'setup_complete')) {
99
  $post_columns['wpml:original_product_sku'] = array('title'=>'wpml:original_product_sku','description'=>'WPML Original Product SKU');
100
  }
101
 
102
- return apply_filters('woocommerce_csv_product_import_reserved_fields_pair', $post_columns);
103
-
104
-
105
-
106
-
107
- return array(
108
-
109
- 'id' => array('title'=>'Product ID','description'=>'Product ID'),
110
- 'type' => array('title'=>'Product Type','description'=>'( eg:- simple , variable)'),
111
- 'sku' => array('title'=>'Product SKU','description'=>'Product SKU - This will unique and Product identifier'),
112
- 'name' => array('title'=>'Product Title','description'=>'Product Title. ie Name of the product'),
113
- 'slug' => array('title'=>'Product Permalink','description'=>'Unique part of the product URL'),
114
- 'date_created' => array('title'=>'Date','description'=>'Product posted date'),
115
- 'published' => array('title'=>'Published','description'=>''),
116
- 'featured' => array('title'=>'Visibility: Featured','description'=>'Featured Product'),
117
- 'catalog_visibility' => array('title'=>'Visibility: Visibility','description'=>'Visibility status ( hidden or visible)'),
118
- 'short_description' => array('title'=>'Product Short Description','description'=>'Short description about the Product'),
119
- 'description' => array('title'=>'Product Description','description'=>'Description about the Product'),
120
- 'date_on_sale_from' => array('title'=>'Sale Price Dates: From','description'=>'Sale Price Dates effect from'),
121
- 'date_on_sale_to' => array('title'=>'Sale Price Dates: To','description'=>'Sale Price Dates effect to'),
122
- 'tax_status' => array('title'=>'Tax: Tax Status','description'=>'Taxable product or not'),
123
- 'tax_class' => array('title'=>'Tax: Tax Class','description'=>'Tax class ( eg:- reduced rate)'),
124
- 'stock_status' => array('title'=>'Inventory: Stock Status','description'=>'InStock or OutofStock'),
125
- 'stock' => array('title'=>'Inventory: Stock','description'=>'Stock quantity'),
126
- 'low_stock_amount' => array('title'=>'Low Stock Amount','description'=>''),
127
- 'backorders' => array('title'=>'Inventory: Backorders','description'=>'Backorders'),
128
- 'sold_individually' => array('title'=>'Sold Individually','description'=>''),
129
- 'weight' => array('title'=>'Dimensions: Weight','description'=>'Wight of product in LB , OZ , KG as of your woocommerce Unit'),
130
- 'length' => array('title'=>'Dimensions: length','description'=>'Length'),
131
- 'width' => array('title'=>'Dimensions: width','description'=>'Width'),
132
- 'height' => array('title'=>'Dimensions: height','description'=>'Height'),
133
- 'reviews_allowed' => array('title'=>'Comment Status','description'=>'Comment Status ( Open or Closed comments for this prodcut)'),
134
- 'purchase_note' => array('title'=>'Purchase note','description'=>''),
135
- 'sale_price' => array('title'=>'Price: Sale Price','description'=>'Sale Price'),
136
- 'regular_price' => array('title'=>'Price: Regular Price','description'=>'Regular Price'),
137
- 'category_ids' => array('title'=>'Categories','description'=>''),
138
- 'tag_ids' => array('title'=>'Tags','description'=>''),
139
- 'shipping_class_id' => array('title'=>'Shipping class','description'=>''),
140
- 'images' => array('title'=>'Images/Gallery','description'=>'Image URLs seperated with &#124;'),
141
- 'download_limit' => array('title'=>'Downloads: Download Limit','description'=>'Download Limit'),
142
- 'download_expiry' => array('title'=>'Downloads: Download Expiry','description'=>'Download Expiry'),
143
- 'parent_id' => array('title'=>'Parent ID','description'=>'Parent Product ID , if you are importing variation Product'),
144
- 'grouped_products' => array('title'=>'Grouped products','description'=>''),
145
- 'upsell_ids' => array('title'=>'Related Products: Upsell IDs','description'=>'Upsell Product ids'),
146
- 'cross_sell_ids' => array('title'=>'Related Products: Crosssell IDs','description'=>'Crosssell Product ids'),
147
- 'product_url' => array('title'=>'External: Product URL','description'=>'Product URL if the Product is external'),
148
- 'button_text' => array('title'=>'External: Button Text','description'=>'Buy button text for Product , if the Product is external'),
149
- 'menu_order' => array('title'=>'Menu Order','description'=>'If menu enabled , menu order'),
150
- );
151
-
152
- array(
153
- 'name' => '',
154
- 'slug' => '',
155
- 'date_created' => null,
156
- 'date_modified' => null,
157
- 'status' => false,
158
- 'featured' => false,
159
- 'catalog_visibility' => 'visible',
160
- 'description' => '',
161
- 'short_description' => '',
162
- 'sku' => '',
163
- 'price' => '',
164
- 'regular_price' => '',
165
- 'sale_price' => '',
166
- 'date_on_sale_from' => null,
167
- 'date_on_sale_to' => null,
168
- 'total_sales' => '0',
169
- 'tax_status' => 'taxable',
170
- 'tax_class' => '',
171
- 'manage_stock' => false,
172
- 'stock_quantity' => null,
173
- 'stock_status' => 'instock',
174
- 'backorders' => 'no',
175
- 'low_stock_amount' => '',
176
- 'sold_individually' => false,
177
- 'weight' => '',
178
- 'length' => '',
179
- 'width' => '',
180
- 'height' => '',
181
- 'upsell_ids' => array(),
182
- 'cross_sell_ids' => array(),
183
- 'parent_id' => 0,
184
- 'reviews_allowed' => true,
185
- 'purchase_note' => '',
186
- 'attributes' => array(),
187
- 'default_attributes' => array(),
188
- 'menu_order' => 0,
189
- 'post_password' => '',
190
- 'virtual' => false,
191
- 'downloadable' => false,
192
- 'category_ids' => array(),
193
- 'tag_ids' => array(),
194
- 'shipping_class_id' => 0,
195
- 'downloads' => array(),
196
- 'image_id' => '',
197
- 'gallery_image_ids' => array(),
198
- 'download_limit' => -1,
199
- 'download_expiry' => -1,
200
- 'rating_counts' => array(),
201
- 'average_rating' => 0,
202
- 'review_count' => 0,
203
- );
204
-
205
-
206
- $post_columns = array(
207
- 'post_title' => 'name',
208
- 'post_name' => 'slug',
209
- 'post_parent' => 'parent_id',
210
- 'ID' => 'ID',
211
- 'post_excerpt' => 'Short Description',
212
- 'post_content' => 'Description',
213
- 'post_status' => 'Status',
214
- 'post_password' => 'post_password',
215
- 'menu_order' => 'menu_order',
216
- 'post_date' => 'post_date',
217
- 'post_author' => 'post_author',
218
- 'comment_status' => 'comment_status',
219
- // Meta
220
-
221
- '_sku' => 'sku',
222
- 'parent_sku' => 'parent_sku',
223
- 'parent' => 'Parent Title',
224
- '_children' => 'children', //For Grouped products
225
- '_downloadable' => 'downloadable',
226
- '_virtual' => 'virtual',
227
- '_stock' => 'stock',
228
- '_regular_price' => 'Regular Price',
229
- '_sale_price' => 'Sale Price',
230
- '_weight' => 'weight',
231
- '_length' => 'length',
232
- '_width' => 'width',
233
- '_height' => 'height',
234
- '_tax_class' => 'tax_class',
235
- '_visibility' => 'visibility',
236
- '_stock_status' => 'stock_status',
237
- '_backorders' => 'backorders',
238
- '_manage_stock' => 'manage_stock',
239
- '_tax_status' => 'tax_status',
240
- '_upsell_ids' => 'upsell_ids',
241
- '_crosssell_ids' => 'crosssell_ids',
242
- '_featured' => 'featured',
243
- '_sale_price_dates_from' => 'sale_price_dates_from',
244
- '_sale_price_dates_to' => 'sale_price_dates_to',
245
- // Downloadable products
246
- '_download_limit' => 'download_limit',
247
- '_download_expiry' => 'download_expiry',
248
- // Virtual products
249
- '_product_url' => 'product_url',
250
- '_button_text' => 'button_text',
251
- // YOAST
252
- 'meta:_yoast_wpseo_focuskw' => 'meta:_yoast_wpseo_focuskw',
253
- 'meta:_yoast_wpseo_title' => 'meta:_yoast_wpseo_title',
254
- 'meta:_yoast_wpseo_metadesc' => 'meta:_yoast_wpseo_metadesc',
255
- 'meta:_yoast_wpseo_metakeywords' => 'meta:_yoast_wpseo_metakeywords',
256
-
257
- 'images' => 'Images (featured and gallery)',
258
- "$file_path_header" => 'Downloadable file paths',
259
- 'product_page_url' => 'Product Page URL',
260
- //'taxonomies' => 'Taxonomies (cat/tags/shipping-class)',
261
- //'meta' => 'Meta (custom fields)',
262
- //'attributes' => 'Attributes',
263
- );
264
-
265
- if (apply_filters('wpml_setting', false, 'setup_complete')) {
266
-
267
- $post_columns['wpml:language_code'] = 'wpml:language_code';
268
- $post_columns['wpml:original_product_id'] = 'wpml:original_product_id';
269
- $post_columns['wpml:original_product_sku'] = 'wpml:original_product_sku';
270
- }
271
-
272
-
273
-
274
-
275
-
276
-
277
- $default_export_columns = array(
278
- 'id' => __('ID', 'woocommerce'),
279
- 'type' => __('Type', 'woocommerce'),
280
- 'sku' => __('SKU', 'woocommerce'),
281
- 'name' => __('Name', 'woocommerce'),
282
- 'published' => __('Published', 'woocommerce'),
283
- 'featured' => __('Is featured?', 'woocommerce'),
284
- 'catalog_visibility' => __('Visibility in catalog', 'woocommerce'),
285
- 'short_description' => __('Short description', 'woocommerce'),
286
- 'description' => __('Description', 'woocommerce'),
287
- 'date_on_sale_from' => __('Date sale price starts', 'woocommerce'),
288
- 'date_on_sale_to' => __('Date sale price ends', 'woocommerce'),
289
- 'tax_status' => __('Tax status', 'woocommerce'),
290
- 'tax_class' => __('Tax class', 'woocommerce'),
291
- 'stock_status' => __('In stock?', 'woocommerce'),
292
- 'stock' => __('Stock', 'woocommerce'),
293
- 'low_stock_amount' => __('Low stock amount', 'woocommerce'),
294
- 'backorders' => __('Backorders allowed?', 'woocommerce'),
295
- 'sold_individually' => __('Sold individually?', 'woocommerce'),
296
- 'weight' => sprintf(__('Weight (%s)', 'woocommerce'), get_option('woocommerce_weight_unit')),
297
- 'length' => sprintf(__('Length (%s)', 'woocommerce'), get_option('woocommerce_dimension_unit')),
298
- 'width' => sprintf(__('Width (%s)', 'woocommerce'), get_option('woocommerce_dimension_unit')),
299
- 'height' => sprintf(__('Height (%s)', 'woocommerce'), get_option('woocommerce_dimension_unit')),
300
- 'reviews_allowed' => __('Allow customer reviews?', 'woocommerce'),
301
- 'purchase_note' => __('Purchase note', 'woocommerce'),
302
- 'sale_price' => __('Sale price', 'woocommerce'),
303
- 'regular_price' => __('Regular price', 'woocommerce'),
304
- 'category_ids' => __('Categories', 'woocommerce'),
305
- 'tag_ids' => __('Tags', 'woocommerce'),
306
- 'shipping_class_id' => __('Shipping class', 'woocommerce'),
307
- 'images' => __('Images', 'woocommerce'),
308
- 'download_limit' => __('Download limit', 'woocommerce'),
309
- 'download_expiry' => __('Download expiry days', 'woocommerce'),
310
- 'parent_id' => __('Parent', 'woocommerce'),
311
- 'grouped_products' => __('Grouped products', 'woocommerce'),
312
- 'upsell_ids' => __('Upsells', 'woocommerce'),
313
- 'cross_sell_ids' => __('Cross-sells', 'woocommerce'),
314
- 'product_url' => __('External URL', 'woocommerce'),
315
- 'button_text' => __('Button text', 'woocommerce'),
316
- 'menu_order' => __('Position', 'woocommerce'),
317
- );
318
- echo '<pre>$default_export_columns:-';
319
- print_r(count($default_export_columns));
320
- echo '</pre>';
321
-
322
-
323
- $default_import_columns = array(
324
- 'ID' => 'id',
325
- 'Type' => 'type',
326
- 'SKU' => 'sku',
327
- 'Name' => 'name',
328
- 'Published' => 'published',
329
- 'Is featured?' => 'featured',
330
- 'Visibility in catalog' => 'catalog_visibility',
331
- 'Short description' => 'short_description',
332
- 'Description' => 'description',
333
- 'Date sale price starts' => 'date_on_sale_from',
334
- 'Date sale price ends' => 'date_on_sale_to',
335
- 'Tax status' => 'tax_status',
336
- 'Tax class' => 'tax_class',
337
- 'In stock?' => 'stock_status',
338
- 'Stock' => 'stock_quantity',
339
- 'Backorders allowed?' => 'backorders',
340
- 'Low stock amount' => 'low_stock_amount',
341
- 'Sold individually?' => 'sold_individually',
342
- sprintf('Weight (%s)', get_option('woocommerce_weight_unit')) => 'weight',
343
- sprintf('Length (%s)', get_option('woocommerce_dimension_unit')) => 'length',
344
- sprintf('Width (%s)', get_option('woocommerce_dimension_unit')) => 'width',
345
- sprintf('Height (%s)', get_option('woocommerce_dimension_unit')) => 'height',
346
- 'Allow customer reviews?' => 'reviews_allowed',
347
- 'Purchase note' => 'purchase_note',
348
- 'Sale price' => 'sale_price',
349
- 'Regular price' => 'regular_price',
350
- 'Categories' => 'category_ids',
351
- 'Tags' => 'tag_ids',
352
- 'Shipping class' => 'shipping_class_id',
353
- 'Images' => 'images',
354
- 'Download limit' => 'download_limit',
355
- 'Download expiry days' => 'download_expiry',
356
- 'Parent' => 'parent_id',
357
- 'Upsells' => 'upsell_ids',
358
- 'Cross-sells' => 'cross_sell_ids',
359
- 'Grouped products' => 'grouped_products',
360
- 'External URL' => 'product_url',
361
- 'Button text' => 'button_text',
362
- 'Position' => 'menu_order',
363
- );
364
-
365
- echo '<pre>$default_import_columns:-';
366
- print_r(count($default_import_columns));
367
- echo '</pre>';
368
-
369
-
370
- $default_import_columns_1 = array(
371
- __('ID', 'woocommerce') => 'id',
372
- __('Type', 'woocommerce') => 'type',
373
- __('SKU', 'woocommerce') => 'sku',
374
- __('Name', 'woocommerce') => 'name',
375
- __('Published', 'woocommerce') => 'published',
376
- __('Is featured?', 'woocommerce') => 'featured',
377
- __('Visibility in catalog', 'woocommerce') => 'catalog_visibility',
378
- __('Short description', 'woocommerce') => 'short_description',
379
- __('Description', 'woocommerce') => 'description',
380
- __('Date sale price starts', 'woocommerce') => 'date_on_sale_from',
381
- __('Date sale price ends', 'woocommerce') => 'date_on_sale_to',
382
- __('Tax status', 'woocommerce') => 'tax_status',
383
- __('Tax class', 'woocommerce') => 'tax_class',
384
- __('In stock?', 'woocommerce') => 'stock_status',
385
- __('Stock', 'woocommerce') => 'stock_quantity',
386
- __('Backorders allowed?', 'woocommerce') => 'backorders',
387
- __('Low stock amount', 'woocommerce') => 'low_stock_amount',
388
- __('Sold individually?', 'woocommerce') => 'sold_individually',
389
- /* translators: %s: Weight unit */
390
- sprintf(__('Weight (%s)', 'woocommerce'), $weight_unit) => 'weight',
391
- /* translators: %s: Length unit */
392
- sprintf(__('Length (%s)', 'woocommerce'), $dimension_unit) => 'length',
393
- /* translators: %s: Width unit */
394
- sprintf(__('Width (%s)', 'woocommerce'), $dimension_unit) => 'width',
395
- /* translators: %s: Height unit */
396
- sprintf(__('Height (%s)', 'woocommerce'), $dimension_unit) => 'height',
397
- __('Allow customer reviews?', 'woocommerce') => 'reviews_allowed',
398
- __('Purchase note', 'woocommerce') => 'purchase_note',
399
- __('Sale price', 'woocommerce') => 'sale_price',
400
- __('Regular price', 'woocommerce') => 'regular_price',
401
- __('Categories', 'woocommerce') => 'category_ids',
402
- __('Tags', 'woocommerce') => 'tag_ids',
403
- __('Shipping class', 'woocommerce') => 'shipping_class_id',
404
- __('Images', 'woocommerce') => 'images',
405
- __('Download limit', 'woocommerce') => 'download_limit',
406
- __('Download expiry days', 'woocommerce') => 'download_expiry',
407
- __('Parent', 'woocommerce') => 'parent_id',
408
- __('Upsells', 'woocommerce') => 'upsell_ids',
409
- __('Cross-sells', 'woocommerce') => 'cross_sell_ids',
410
- __('Grouped products', 'woocommerce') => 'grouped_products',
411
- __('External URL', 'woocommerce') => 'product_url',
412
- __('Button text', 'woocommerce') => 'button_text',
413
- __('Position', 'woocommerce') => 'menu_order',
414
- );
18
 
19
  'parent' => array('title'=>'Parent Title','description'=>'Parent Product Title , if you are importing variation Product'),
20
  'parent_sku' => array('title'=>'Parent SKU','description'=>'Parent Product SKU , if you are importing variation Product'),
21
+ 'sku' => array('title'=>'Product SKU','description'=>'Product SKU - This will unique and Product identifier'),
22
+ 'children' => array('title'=>'Children Product ID','description'=>'Linked Products id if you are importing Grouped products'),
23
+ 'downloadable' => array('title'=>'Type: Downloadable','description'=>'Is Product is downloadable eg:- Book'),
24
+ 'virtual' => array('title'=>'Type: Virtual','description'=>'Is Product is virtual'),
25
+ 'visibility' => array('title'=>'Visibility: Visibility','description'=>'Visibility status ( hidden or visible)'),
26
+ 'purchase_note' => array('title'=>'Purchase note','description'=>'Purchase note'),
27
+ 'stock' => array('title'=>'Inventory: Stock','description'=>'Stock quantity'),
28
+ 'stock_status' => array('title'=>'Inventory: Stock Status','description'=>'InStock or OutofStock'),
29
+ 'backorders' => array('title'=>'Inventory: Backorders','description'=>'Backorders'),
30
+ 'sold_individually' => array('title'=>'Inventory: Sold individually','description'=>'Sold individually'),
31
+ 'low_stock_amount' => array('title'=>'Inventory: Low stock amount','description'=>'Low stock amount'),
32
+ 'manage_stock' => array('title'=>'Inventory: Manage Stock','description'=>'yes to enable no to disable'),
33
+ 'sale_price' => array('title'=>'Price: Sale Price','description'=>'Sale Price'),
34
+ 'regular_price' => array('title'=>'Price: Regular Price','description'=>'Regular Price'),
35
+ 'sale_price_dates_from' => array('title'=>'Sale Price Dates: From','description'=>'Sale Price Dates effect from', 'type' => 'date'),
36
+ 'sale_price_dates_to' => array('title'=>'Sale Price Dates: To','description'=>'Sale Price Dates effect to', 'type' => 'date'),
37
+ 'weight' => array('title'=>'Dimensions: Weight','description'=>'Wight of product in LB , OZ , KG as of your woocommerce Unit'),
38
+ 'length' => array('title'=>'Dimensions: length','description'=>'Length'),
39
+ 'width' => array('title'=>'Dimensions: width','description'=>'Width'),
40
+ 'height' => array('title'=>'Dimensions: height','description'=>'Height'),
41
+ 'tax_status' => array('title'=>'Tax: Tax Status','description'=>'Taxable product or not'),
42
+ 'tax_class' => array('title'=>'Tax: Tax Class','description'=>'Tax class ( eg:- reduced rate)'),
43
+ 'upsell_ids' => array('title'=>'Related Products: Upsell IDs','description'=>'Upsell Product ids'),
44
+ 'crosssell_ids' => array('title'=>'Related Products: Crosssell IDs','description'=>'Crosssell Product ids'),
45
+ 'file_paths' => array('title'=>'Downloads: File Paths (WC 2.0.x)','description'=>'File Paths'),
46
+ 'downloadable_files' => array('title'=>'Downloads: Downloadable Files (WC 2.1.x)','description'=>'Downloadable Files'),
47
+ 'download_limit' => array('title'=>'Downloads: Download Limit','description'=>'Download Limit'),
48
+ 'download_expiry' => array('title'=>'Downloads: Download Expiry','description'=>'Download Expiry'),
49
+ 'product_url' => array('title'=>'External: Product URL','description'=>'Product URL if the Product is external'),
50
+ 'button_text' => array('title'=>'External: Button Text','description'=>'Buy button text for Product , if the Product is external'),
 
51
  'images' => array('title'=>'Images/Gallery','description'=>'Image URLs seperated with &#124;'),
52
  'product_page_url' => array('title'=>'Product Page URL','description'=>'Product Page URL'),
53
  'meta:total_sales' => array('title'=>'meta:total_sales','description'=>'Total sales for the Product'),
98
  $post_columns['wpml:original_product_sku'] = array('title'=>'wpml:original_product_sku','description'=>'WPML Original Product SKU');
99
  }
100
 
101
+ return apply_filters('woocommerce_csv_product_import_reserved_fields_pair', $post_columns);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/modules/product/export/export.php CHANGED
@@ -149,6 +149,9 @@ class Wt_Import_Export_For_Woo_Basic_Product_Export {
149
  protected function generate_row_data_wc_lower($product_object) {
150
 
151
  $export_columns = $this->parent_module->get_selected_column_names();
 
 
 
152
 
153
  $product = get_post($product_object->get_id());
154
 
@@ -192,6 +195,10 @@ class Wt_Import_Export_For_Woo_Basic_Product_Export {
192
  $product->meta->$meta = self::format_export_meta($meta_value, $meta);
193
  }
194
  } else {
 
 
 
 
195
  $product->meta->$meta = self::format_export_meta($meta_value, $meta);
196
  }
197
  }
@@ -582,10 +589,14 @@ class Wt_Import_Export_For_Woo_Basic_Product_Export {
582
  switch ($meta) {
583
  case '_sale_price_dates_from' :
584
  case '_sale_price_dates_to' :
 
 
585
  return $meta_value ? date('Y-m-d', $meta_value) : '';
586
  break;
587
  case '_upsell_ids' :
588
  case '_crosssell_ids' :
 
 
589
  return implode('|', array_filter((array) json_decode($meta_value)));
590
  break;
591
  default :
149
  protected function generate_row_data_wc_lower($product_object) {
150
 
151
  $export_columns = $this->parent_module->get_selected_column_names();
152
+
153
+ $post_columns = Wt_Import_Export_For_Woo_Basic_Product::get_product_post_columns();
154
+ $standard_meta_columns = array_keys(array_slice($post_columns, 12));
155
 
156
  $product = get_post($product_object->get_id());
157
 
195
  $product->meta->$meta = self::format_export_meta($meta_value, $meta);
196
  }
197
  } else {
198
+ $clean_meta_key = ltrim($meta, '_');
199
+ if(in_array($clean_meta_key, $standard_meta_columns)){
200
+ $meta = $clean_meta_key;
201
+ }
202
  $product->meta->$meta = self::format_export_meta($meta_value, $meta);
203
  }
204
  }
589
  switch ($meta) {
590
  case '_sale_price_dates_from' :
591
  case '_sale_price_dates_to' :
592
+ case 'sale_price_dates_from' :
593
+ case 'sale_price_dates_to' :
594
  return $meta_value ? date('Y-m-d', $meta_value) : '';
595
  break;
596
  case '_upsell_ids' :
597
  case '_crosssell_ids' :
598
+ case 'upsell_ids' :
599
+ case 'crosssell_ids' :
600
  return implode('|', array_filter((array) json_decode($meta_value)));
601
  break;
602
  default :
admin/modules/product/import/import.php CHANGED
@@ -172,8 +172,8 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
172
  $mapped_data = apply_filters('wt_woocommerce_product_importer_pre_parse_data', $mapped_data);
173
 
174
  $this->item_data = array(); // resetting WC default data before parsing new item to avoid merging last parsed item wp_parse_args
175
-
176
- if((isset($mapped_data['ID']) && !empty($mapped_data['ID']))||(isset($mapped_data['_sku']) && !empty($mapped_data['_sku']))){
177
  $this->item_data['id'] = $this->wt_product_existance_check($mapped_data); // to determine wether merge or import
178
  }
179
 
@@ -257,11 +257,11 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
257
  $this->item_data['sale_price'] = wc_format_decimal($value);
258
  continue;
259
  }
260
- if ('date_on_sale_from' == $column || '_sale_price_dates_from' == $column) {
261
  $this->item_data['date_on_sale_from'] = $value;
262
  continue;
263
  }
264
- if ('date_on_sale_to' == $column || '_sale_price_dates_to' == $column) {
265
  $this->item_data['date_on_sale_to'] = $value;
266
  continue;
267
  }
@@ -277,7 +277,7 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
277
  $this->item_data['tax_class'] = ($value);
278
  continue;
279
  }
280
- if ('stock_quantity' == $column || '_stock' == $column) {
281
  $this->item_data['stock_quantity'] = $this->wt_parse_stock_quantity_field($value);
282
  continue;
283
  }
@@ -542,14 +542,7 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
542
  if ( empty( $value ) ) {
543
  return 'no';
544
  }
545
-
546
- if ( 'notify' === $value ) {
547
- return 'notify';
548
- } elseif ( is_bool( $value ) ) {
549
- return $value ? 'yes' : 'no';
550
- }
551
-
552
- return 'no';
553
  }
554
 
555
 
@@ -566,16 +559,8 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
566
  }
567
 
568
  public function wt_parse_stock_status_field($value) {
569
- $stock_status = $value;
570
- // Stock is bool or 'backorder'.
571
- if ( isset( $value ) ) {
572
- if ( 'backorder' === $value ) {
573
- $stock_status = 'onbackorder';
574
- } else {
575
- $stock_status = $value ? 'instock' : 'outofstock';
576
- }
577
- }
578
- return $stock_status;
579
 
580
  }
581
 
@@ -847,6 +832,9 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
847
  }
848
 
849
  $sku = isset($data['_sku']) && '' != $data['_sku'] ? trim($data['_sku']) : '';
 
 
 
850
  $id_found_with_sku = '';
851
  if(!empty($sku) && 'sku' == $this->merge_with){
852
  $db_query = $wpdb->prepare("SELECT $wpdb->posts.ID,$wpdb->posts.post_type
@@ -915,6 +903,7 @@ class Wt_Import_Export_For_Woo_Basic_Product_Import {
915
  return $found_id;
916
  }
917
 
 
918
  $postdata = array( // if not specifiying id (id is empty) or if not found by given id or Product
919
  'post_title' => (($this->item_data['type'] == 'variation') ? 'product variation' : $this->item_data['name'] ),
920
  'post_status' => 'importing',
172
  $mapped_data = apply_filters('wt_woocommerce_product_importer_pre_parse_data', $mapped_data);
173
 
174
  $this->item_data = array(); // resetting WC default data before parsing new item to avoid merging last parsed item wp_parse_args
175
+
176
+ if((isset($mapped_data['ID']) && !empty($mapped_data['ID']))||(isset($mapped_data['_sku']) && !empty($mapped_data['_sku'])) ||(isset($mapped_data['sku']) && !empty($mapped_data['sku']))){
177
  $this->item_data['id'] = $this->wt_product_existance_check($mapped_data); // to determine wether merge or import
178
  }
179
 
257
  $this->item_data['sale_price'] = wc_format_decimal($value);
258
  continue;
259
  }
260
+ if ('date_on_sale_from' == $column || '_sale_price_dates_from' == $column || 'sale_price_dates_from' == $column) {
261
  $this->item_data['date_on_sale_from'] = $value;
262
  continue;
263
  }
264
+ if ('date_on_sale_to' == $column || '_sale_price_dates_to' == $column || 'sale_price_dates_to' == $column) {
265
  $this->item_data['date_on_sale_to'] = $value;
266
  continue;
267
  }
277
  $this->item_data['tax_class'] = ($value);
278
  continue;
279
  }
280
+ if ('stock_quantity' == $column || '_stock' == $column || 'stock' == $column) {
281
  $this->item_data['stock_quantity'] = $this->wt_parse_stock_quantity_field($value);
282
  continue;
283
  }
542
  if ( empty( $value ) ) {
543
  return 'no';
544
  }
545
+ return $value;
 
 
 
 
 
 
 
546
  }
547
 
548
 
559
  }
560
 
561
  public function wt_parse_stock_status_field($value) {
562
+
563
+ return $value;
 
 
 
 
 
 
 
 
564
 
565
  }
566
 
832
  }
833
 
834
  $sku = isset($data['_sku']) && '' != $data['_sku'] ? trim($data['_sku']) : '';
835
+ if($sku == ''){
836
+ $sku = isset($data['sku']) && '' != $data['sku'] ? trim($data['sku']) : '';
837
+ }
838
  $id_found_with_sku = '';
839
  if(!empty($sku) && 'sku' == $this->merge_with){
840
  $db_query = $wpdb->prepare("SELECT $wpdb->posts.ID,$wpdb->posts.post_type
903
  return $found_id;
904
  }
905
 
906
+ $this->item_data['type'] = isset($this->item_data['type']) ? $this->item_data['type'] : 'simple';
907
  $postdata = array( // if not specifiying id (id is empty) or if not found by given id or Product
908
  'post_title' => (($this->item_data['type'] == 'variation') ? 'product variation' : $this->item_data['name'] ),
909
  'post_status' => 'importing',
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.0.1';
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.0.2';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
product-import-export-for-woo.php CHANGED
@@ -5,8 +5,8 @@
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.0.1
9
- WC tested up to: 5.3.0
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
@@ -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.0.1' );
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.0.2
9
+ WC tested up to: 5.4
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
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.0.2' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce product import, woocommerce import products, woocommerce expor
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.1
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -25,7 +25,7 @@ Product import export plugin allows you to import or export WooCommerce simple p
25
  &#128312; Export WooCommerce products by category, tags, products, and product status
26
  &#128312; Bulk edit WooCommerce product data with evaluation fields (price, attribute, title, description, and more)
27
  &#128312; Option to choose delimiter for import
28
- &#128312; Tested OK with WooCommerce 5.3.0
29
 
30
  Additional features offered the plugin that makes the product import-export process smooth and easy,
31
 
@@ -198,6 +198,9 @@ LibreOffice.
198
 
199
  == Changelog ==
200
 
 
 
 
201
  = 2.0.1 =
202
  * Custom taxonomy support updated.
203
 
@@ -488,5 +491,5 @@ LibreOffice.
488
 
489
  == Upgrade Notice ==
490
 
491
- = 2.0.1 =
492
- * Custom taxonomy support updated.
5
  Requires at least: 3.0.1
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.2
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
25
  &#128312; Export WooCommerce products by category, tags, products, and product status
26
  &#128312; Bulk edit WooCommerce product data with evaluation fields (price, attribute, title, description, and more)
27
  &#128312; Option to choose delimiter for import
28
+ &#128312; Tested OK with WooCommerce 5.4
29
 
30
  Additional features offered the plugin that makes the product import-export process smooth and easy,
31
 
198
 
199
  == Changelog ==
200
 
201
+ = 2.0.2 =
202
+ * Tested OK with WC 5.4
203
+
204
  = 2.0.1 =
205
  * Custom taxonomy support updated.
206
 
491
 
492
  == Upgrade Notice ==
493
 
494
+ = 2.0.2 =
495
+ * Tested OK with WC 5.4