Product Import Export for WooCommerce - Version 1.5.7

Version Description

  • Updates: Tested OK with WC 3.5.7
  • Bug Fix:- Image import.
  • Support GlotPress(translate.wordpress.org).
Download this release

Release Info

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

Code changes from version 1.5.6 to 1.5.7

includes/class-wf-prodimpexpcsv-admin-screen.php CHANGED
@@ -23,7 +23,7 @@ class WF_ProdImpExpCsv_Admin_Screen {
23
*/
24
public function admin_notices() {
25
if (!function_exists('mb_detect_encoding')) {
26
- echo '<div class="error"><p>' . __('Product CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'wf_csv_import_export') . '</p></div>';
27
}
28
}
29
@@ -31,8 +31,8 @@ class WF_ProdImpExpCsv_Admin_Screen {
31
* Admin Menu
32
*/
33
public function admin_menu() {
34
- $page1 = add_submenu_page('edit.php?post_type=product', __('Product Im-Ex', 'wf_csv_import_export'), __('Product Im-Ex', 'wf_csv_import_export'), apply_filters('woocommerce_csv_product_role', 'manage_woocommerce'), 'wf_woocommerce_csv_im_ex', array($this, 'output'));
35
- $page = add_submenu_page('woocommerce', __('Product Import-Export', 'wf_csv_import_export'), __('Product Import-Export', 'wf_csv_import_export'), apply_filters('woocommerce_csv_product_role', 'manage_woocommerce'), 'wf_woocommerce_csv_im_ex', array($this, 'output'));
36
37
}
38
@@ -101,7 +101,7 @@ class WF_ProdImpExpCsv_Admin_Screen {
101
102
if (!get_option('xa_pipe_plugin_review_rated')) {
103
$header_text = sprintf(
104
- __('<div class="updated"><p>You have been using %1$s for a while. If you like the plugin please leave us a %2$s review!<p></div>', 'wf_csv_import_export'), sprintf('<strong>%s</strong>', esc_html__('Product Import Export for WooCommerce', 'wf_csv_import_export')), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_csv_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
105
);
106
wc_enqueue_js("
107
jQuery( 'a.xa-pipe-rating-link' ).click( function() {
23
*/
24
public function admin_notices() {
25
if (!function_exists('mb_detect_encoding')) {
26
+ echo '<div class="error"><p>' . __('Product CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'product-import-export-for-woo') . '</p></div>';
27
}
28
}
29
31
* Admin Menu
32
*/
33
public function admin_menu() {
34
+ $page1 = add_submenu_page('edit.php?post_type=product', __('Product Im-Ex', 'product-import-export-for-woo'), __('Product Im-Ex', 'product-import-export-for-woo'), apply_filters('woocommerce_csv_product_role', 'manage_woocommerce'), 'wf_woocommerce_csv_im_ex', array($this, 'output'));
35
+ $page = add_submenu_page('woocommerce', __('Product Import-Export', 'product-import-export-for-woo'), __('Product Import-Export', 'product-import-export-for-woo'), apply_filters('woocommerce_csv_product_role', 'manage_woocommerce'), 'wf_woocommerce_csv_im_ex', array($this, 'output'));
36
37
}
38
101
102
if (!get_option('xa_pipe_plugin_review_rated')) {
103
$header_text = sprintf(
104
+ __('<div class="updated"><p>You have been using %1$s for a while. If you like the plugin please leave us a %2$s review!<p></div>', 'product-import-export-for-woo'), sprintf('<strong>%s</strong>', esc_html__('Product Import Export for WooCommerce', 'product-import-export-for-woo')), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'product-import-export-for-woo') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
105
);
106
wc_enqueue_js("
107
jQuery( 'a.xa-pipe-rating-link' ).click( function() {
includes/class-wf-prodimpexpcsv-ajax-handler.php CHANGED
@@ -33,15 +33,15 @@ class WF_ProdImpExpCsv_AJAX_Handler {
33
$image = get_post( $id );
34
35
if ( ! $image || 'attachment' != $image->post_type || 'image/' != substr( $image->post_mime_type, 0, 6 ) )
36
- die( json_encode( array( 'error' => sprintf( __( 'Failed resize: %s is an invalid image ID.', 'wf_csv_import_export' ), esc_html( $_REQUEST['id'] ) ) ) ) );
37
38
if ( ! current_user_can( 'manage_woocommerce' ) )
39
- $this->die_json_error_msg( $image->ID, __( "Your user account doesn't have permission to resize images", 'wf_csv_import_export' ) );
40
41
$fullsizepath = get_attached_file( $image->ID );
42
43
if ( false === $fullsizepath || ! file_exists( $fullsizepath ) )
44
- $this->die_json_error_msg( $image->ID, sprintf( __( 'The originally uploaded image file cannot be found at %s', 'wf_csv_import_export' ), '<code>' . esc_html( $fullsizepath ) . '</code>' ) );
45
46
@set_time_limit( 900 ); // 5 minutes per image should be PLENTY
47
@@ -50,12 +50,12 @@ class WF_ProdImpExpCsv_AJAX_Handler {
50
if ( is_wp_error( $metadata ) )
51
$this->die_json_error_msg( $image->ID, $metadata->get_error_message() );
52
if ( empty( $metadata ) )
53
- $this->die_json_error_msg( $image->ID, __( 'Unknown failure reason.', 'wf_csv_import_export' ) );
54
55
// If this fails, then it just means that nothing was changed (old value == new value)
56
wp_update_attachment_metadata( $image->ID, $metadata );
57
58
- die( json_encode( array( 'success' => sprintf( __( '&quot;%1$s&quot; (ID %2$s) was successfully resized in %3$s seconds.', 'wf_csv_import_export' ), esc_html( get_the_title( $image->ID ) ), $image->ID, timer_stop() ) ) ) );
59
}
60
61
/**
33
$image = get_post( $id );
34
35
if ( ! $image || 'attachment' != $image->post_type || 'image/' != substr( $image->post_mime_type, 0, 6 ) )
36
+ die( json_encode( array( 'error' => sprintf( __( 'Failed resize: %s is an invalid image ID.', 'product-import-export-for-woo' ), esc_html( $_REQUEST['id'] ) ) ) ) );
37
38
if ( ! current_user_can( 'manage_woocommerce' ) )
39
+ $this->die_json_error_msg( $image->ID, __( "Your user account doesn't have permission to resize images", 'product-import-export-for-woo' ) );
40
41
$fullsizepath = get_attached_file( $image->ID );
42
43
if ( false === $fullsizepath || ! file_exists( $fullsizepath ) )
44
+ $this->die_json_error_msg( $image->ID, sprintf( __( 'The originally uploaded image file cannot be found at %s', 'product-import-export-for-woo' ), '<code>' . esc_html( $fullsizepath ) . '</code>' ) );
45
46
@set_time_limit( 900 ); // 5 minutes per image should be PLENTY
47
50
if ( is_wp_error( $metadata ) )
51
$this->die_json_error_msg( $image->ID, $metadata->get_error_message() );
52
if ( empty( $metadata ) )
53
+ $this->die_json_error_msg( $image->ID, __( 'Unknown failure reason.', 'product-import-export-for-woo' ) );
54
55
// If this fails, then it just means that nothing was changed (old value == new value)
56
wp_update_attachment_metadata( $image->ID, $metadata );
57
58
+ die( json_encode( array( 'success' => sprintf( __( '&quot;%1$s&quot; (ID %2$s) was successfully resized in %3$s seconds.', 'product-import-export-for-woo' ), esc_html( get_the_title( $image->ID ) ), $image->ID, timer_stop() ) ) ) );
59
}
60
61
/**
includes/class-wf-prodimpexpcsv-system-status-tools.php CHANGED
@@ -19,21 +19,21 @@ class WF_ProdImpExpCsv_System_Status_Tools {
19
*/
20
public function tools( $tools ) {
21
$tools['delete_products'] = array(
22
- 'name' => __( 'Delete Products','wf_csv_import_export'),
23
- 'button' => __( 'Delete ALL products','wf_csv_import_export' ),
24
- 'desc' => __( 'This tool will delete all products allowing you to start fresh.', 'wf_csv_import_export' ),
25
'callback' => array( $this, 'delete_products' )
26
);
27
$tools['delete_variations'] = array(
28
- 'name' => __( 'Delete Variations','wf_csv_import_export'),
29
- 'button' => __( 'Delete ALL variations','wf_csv_import_export' ),
30
- 'desc' => __( 'This tool will delete all variations allowing you to start fresh.', 'wf_csv_import_export' ),
31
'callback' => array( $this, 'delete_variations' )
32
);
33
$tools['delete_orphaned_variations'] = array(
34
- 'name' => __( 'Delete Orphans','wf_csv_import_export'),
35
- 'button' => __( 'Delete orphaned variations','wf_csv_import_export' ),
36
- 'desc' => __( 'This tool will delete variations which have no parent.', 'wf_csv_import_export' ),
37
'callback' => array( $this, 'delete_orphaned_variations' )
38
);
39
return $tools;
@@ -59,7 +59,7 @@ class WF_ProdImpExpCsv_System_Status_Tools {
59
LEFT JOIN {$wpdb->posts} wp ON wp.ID = tr.object_id
60
WHERE wp.ID IS NULL" );
61
62
- echo '<div class="updated"><p>' . sprintf( __( '%d Products Deleted', 'wf_csv_import_export' ), ( $result + $result2 ) ) . '</p></div>';
63
}
64
65
/**
@@ -81,7 +81,7 @@ class WF_ProdImpExpCsv_System_Status_Tools {
81
LEFT JOIN {$wpdb->posts} wp ON wp.ID = tr.object_id
82
WHERE wp.ID IS NULL" );
83
84
- echo '<div class="updated"><p>' . sprintf( __( '%d Variations Deleted', 'wf_csv_import_export' ), $result ) . '</p></div>';
85
}
86
87
/**
@@ -96,7 +96,7 @@ class WF_ProdImpExpCsv_System_Status_Tools {
96
LEFT JOIN {$wpdb->posts} wp ON wp.ID = products.post_parent
97
WHERE wp.ID IS NULL AND products.post_type = 'product_variation';" ) );
98
99
- echo '<div class="updated"><p>' . sprintf( __( '%d Variations Deleted', 'wf_csv_import_export' ), $result ) . '</p></div>';
100
}
101
}
102
19
*/
20
public function tools( $tools ) {
21
$tools['delete_products'] = array(
22
+ 'name' => __( 'Delete Products','product-import-export-for-woo'),
23
+ 'button' => __( 'Delete ALL products','product-import-export-for-woo' ),
24
+ 'desc' => __( 'This tool will delete all products allowing you to start fresh.', 'product-import-export-for-woo' ),
25
'callback' => array( $this, 'delete_products' )
26
);
27
$tools['delete_variations'] = array(
28
+ 'name' => __( 'Delete Variations','product-import-export-for-woo'),
29
+ 'button' => __( 'Delete ALL variations','product-import-export-for-woo' ),
30
+ 'desc' => __( 'This tool will delete all variations allowing you to start fresh.', 'product-import-export-for-woo' ),
31
'callback' => array( $this, 'delete_variations' )
32
);
33
$tools['delete_orphaned_variations'] = array(
34
+ 'name' => __( 'Delete Orphans','product-import-export-for-woo'),
35
+ 'button' => __( 'Delete orphaned variations','product-import-export-for-woo' ),
36
+ 'desc' => __( 'This tool will delete variations which have no parent.', 'product-import-export-for-woo' ),
37
'callback' => array( $this, 'delete_orphaned_variations' )
38
);
39
return $tools;
59
LEFT JOIN {$wpdb->posts} wp ON wp.ID = tr.object_id
60
WHERE wp.ID IS NULL" );
61
62
+ echo '<div class="updated"><p>' . sprintf( __( '%d Products Deleted', 'product-import-export-for-woo' ), ( $result + $result2 ) ) . '</p></div>';
63
}
64
65
/**
81
LEFT JOIN {$wpdb->posts} wp ON wp.ID = tr.object_id
82
WHERE wp.ID IS NULL" );
83
84
+ echo '<div class="updated"><p>' . sprintf( __( '%d Variations Deleted', 'product-import-export-for-woo' ), $result ) . '</p></div>';
85
}
86
87
/**
96
LEFT JOIN {$wpdb->posts} wp ON wp.ID = products.post_parent
97
WHERE wp.ID IS NULL AND products.post_type = 'product_variation';" ) );
98
99
+ echo '<div class="updated"><p>' . sprintf( __( '%d Variations Deleted', 'product-import-export-for-woo' ), $result ) . '</p></div>';
100
}
101
}
102
includes/importer/class-wf-csv-parser.php CHANGED
@@ -190,12 +190,12 @@ class WF_CSV_Parser {
190
$product['merging'] = true;
191
192
193
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> Row %s - preparing for merge.', 'wf_csv_import_export'), $this->row));
194
195
// Required fields
196
if (!$post_id && empty($item['sku'])) {
197
198
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Cannot merge without id or sku. Importing instead.', 'wf_csv_import_export'));
199
200
$merging = false;
201
} else {
@@ -213,13 +213,13 @@ class WF_CSV_Parser {
213
", $item['sku']);
214
$found_product_id = $wpdb->get_var($db_query);
215
if (!$found_product_id) {
216
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Skipped. Cannot find product with sku %s. Importing instead.', 'wf_csv_import_export'), $item['sku']));
217
$merging = false;
218
} else {
219
220
$post_id = $found_product_id;
221
222
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Found product with ID %s.', 'wf_csv_import_export'), $post_id));
223
}
224
}
225
}
@@ -228,17 +228,17 @@ class WF_CSV_Parser {
228
if (!$merging) {
229
230
$product['merging'] = false;
231
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> Row %s - preparing for import.', 'wf_csv_import_export'), $this->row));
232
233
// Required fields
234
if (isset($item['post_parent']) && $item['post_parent'] === '' && $item['post_title'] === '') {
235
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Skipped. No post_title set for new product.', 'wf_csv_import_export'));
236
- return new WP_Error('parse-error', __('No post_title set for new product.', 'wf_csv_import_export'));
237
}
238
if (!empty($item['post_parent']) && $item['post_parent'] !== '' && $item['post_parent'] !== null && $item['parent_sku'] === '') {
239
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Skipped. No parent set for new variation product.', 'wf_csv_import_export'));
240
- //return new WP_Error( 'parse-error', __( 'No post_title set for new product.', 'wf_csv_import_export' ) );
241
- return new WP_Error('parse-error', __('No parent set for new variation product.', 'wf_csv_import_export'));
242
}
243
}
244
@@ -473,7 +473,7 @@ class WF_CSV_Parser {
473
474
// Exists?
475
if (!taxonomy_exists($taxonomy)) {
476
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Skipping taxonomy "%s" - it does not exist.', 'wf_csv_import_export'), $taxonomy));
477
continue;
478
}
479
@@ -482,7 +482,7 @@ class WF_CSV_Parser {
482
$term = strtolower(trim($value));
483
484
if (!array_key_exists($term, $this->allowed_product_types)) {
485
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > > Product type "%s" not allowed - using simple.', 'wf_csv_import_export'), $term));
486
$term_id = $this->allowed_product_types['simple'];
487
} else {
488
$term_id = $this->allowed_product_types[$term];
@@ -534,7 +534,7 @@ class WF_CSV_Parser {
534
*/
535
$term_may_exist = term_exists($term, $taxonomy, absint($parent));
536
537
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > (' . __LINE__ . ') Term %s (%s) exists? %s', 'wf_csv_import_export'), sanitize_text_field($term), esc_html($taxonomy), $term_may_exist ? print_r($term_may_exist, true) : '-' ));
538
539
if (is_array($term_may_exist)) {
540
$possible_term = get_term($term_may_exist['term_id'], 'product_cat');
@@ -554,7 +554,7 @@ class WF_CSV_Parser {
554
if (!is_wp_error($t)) {
555
$term_id = $t['term_id'];
556
} else {
557
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > (' . __LINE__ . ') Failed to import term %s, parent %s - %s', 'wf_csv_import_export'), sanitize_text_field($term), sanitize_text_field($parent), sanitize_text_field($taxonomy)));
558
break;
559
}
560
}
@@ -591,7 +591,7 @@ class WF_CSV_Parser {
591
if (!is_wp_error($t)) {
592
$term_id = $t['term_id'];
593
} else {
594
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Failed to import term %s %s', 'wf_csv_import_export'), esc_html($raw_term), esc_html($taxonomy)));
595
break;
596
}
597
}
@@ -640,7 +640,7 @@ class WF_CSV_Parser {
640
641
$attribute_label = ucwords(str_replace('-', ' ', $nicename)); // for importing attribute name as human readable string
642
643
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Attribute taxonomy "%s" does not exist. Adding it. Nicename: %s', 'wf_csv_import_export'), $taxonomy, $nicename));
644
645
$exists_in_db = $wpdb->get_var("SELECT attribute_id FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_name = '" . $nicename . "';");
646
@@ -648,7 +648,7 @@ class WF_CSV_Parser {
648
// Create the taxonomy
649
$wpdb->insert($wpdb->prefix . "woocommerce_attribute_taxonomies", array('attribute_name' => $nicename, 'attribute_label' => $attribute_label, 'attribute_type' => 'select', 'attribute_orderby' => 'menu_order'));
650
} else {
651
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Attribute taxonomy %s already exists in DB.', 'wf_csv_import_export'), $taxonomy));
652
}
653
654
// Register the taxonomy now so that the import works!
@@ -691,13 +691,13 @@ class WF_CSV_Parser {
691
if (!is_wp_error($t)) {
692
$term_id = $t['term_id'];
693
694
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Inserted Raw Term %s ID = %s', 'wf_csv_import_export'), esc_html($raw_term), $term_id));
695
} else {
696
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Failed to import term %s %s', 'wf_csv_import_export'), esc_html($raw_term), esc_html($taxonomy)));
697
break;
698
}
699
} else {
700
- $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Raw Term %s ID = %s', 'wf_csv_import_export'), esc_html($raw_term), $term_id));
701
}
702
703
if ($term_id) {
190
$product['merging'] = true;
191
192
193
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> Row %s - preparing for merge.', 'product-import-export-for-woo'), $this->row));
194
195
// Required fields
196
if (!$post_id && empty($item['sku'])) {
197
198
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Cannot merge without id or sku. Importing instead.', 'product-import-export-for-woo'));
199
200
$merging = false;
201
} else {
213
", $item['sku']);
214
$found_product_id = $wpdb->get_var($db_query);
215
if (!$found_product_id) {
216
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Skipped. Cannot find product with sku %s. Importing instead.', 'product-import-export-for-woo'), $item['sku']));
217
$merging = false;
218
} else {
219
220
$post_id = $found_product_id;
221
222
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Found product with ID %s.', 'product-import-export-for-woo'), $post_id));
223
}
224
}
225
}
228
if (!$merging) {
229
230
$product['merging'] = false;
231
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> Row %s - preparing for import.', 'product-import-export-for-woo'), $this->row));
232
233
// Required fields
234
if (isset($item['post_parent']) && $item['post_parent'] === '' && $item['post_title'] === '') {
235
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Skipped. No post_title set for new product.', 'product-import-export-for-woo'));
236
+ return new WP_Error('parse-error', __('No post_title set for new product.', 'product-import-export-for-woo'));
237
}
238
if (!empty($item['post_parent']) && $item['post_parent'] !== '' && $item['post_parent'] !== null && $item['parent_sku'] === '') {
239
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', __('> > Skipped. No parent set for new variation product.', 'product-import-export-for-woo'));
240
+ //return new WP_Error( 'parse-error', __( 'No post_title set for new product.', 'product-import-export-for-woo' ) );
241
+ return new WP_Error('parse-error', __('No parent set for new variation product.', 'product-import-export-for-woo'));
242
}
243
}
244
473
474
// Exists?
475
if (!taxonomy_exists($taxonomy)) {
476
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Skipping taxonomy "%s" - it does not exist.', 'product-import-export-for-woo'), $taxonomy));
477
continue;
478
}
479
482
$term = strtolower(trim($value));
483
484
if (!array_key_exists($term, $this->allowed_product_types)) {
485
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > > Product type "%s" not allowed - using simple.', 'product-import-export-for-woo'), $term));
486
$term_id = $this->allowed_product_types['simple'];
487
} else {
488
$term_id = $this->allowed_product_types[$term];
534
*/
535
$term_may_exist = term_exists($term, $taxonomy, absint($parent));
536
537
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > (' . __LINE__ . ') Term %s (%s) exists? %s', 'product-import-export-for-woo'), sanitize_text_field($term), esc_html($taxonomy), $term_may_exist ? print_r($term_may_exist, true) : '-' ));
538
539
if (is_array($term_may_exist)) {
540
$possible_term = get_term($term_may_exist['term_id'], 'product_cat');
554
if (!is_wp_error($t)) {
555
$term_id = $t['term_id'];
556
} else {
557
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > (' . __LINE__ . ') Failed to import term %s, parent %s - %s', 'product-import-export-for-woo'), sanitize_text_field($term), sanitize_text_field($parent), sanitize_text_field($taxonomy)));
558
break;
559
}
560
}
591
if (!is_wp_error($t)) {
592
$term_id = $t['term_id'];
593
} else {
594
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Failed to import term %s %s', 'product-import-export-for-woo'), esc_html($raw_term), esc_html($taxonomy)));
595
break;
596
}
597
}
640
641
$attribute_label = ucwords(str_replace('-', ' ', $nicename)); // for importing attribute name as human readable string
642
643
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Attribute taxonomy "%s" does not exist. Adding it. Nicename: %s', 'product-import-export-for-woo'), $taxonomy, $nicename));
644
645
$exists_in_db = $wpdb->get_var("SELECT attribute_id FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_name = '" . $nicename . "';");
646
648
// Create the taxonomy
649
$wpdb->insert($wpdb->prefix . "woocommerce_attribute_taxonomies", array('attribute_name' => $nicename, 'attribute_label' => $attribute_label, 'attribute_type' => 'select', 'attribute_orderby' => 'menu_order'));
650
} else {
651
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Attribute taxonomy %s already exists in DB.', 'product-import-export-for-woo'), $taxonomy));
652
}
653
654
// Register the taxonomy now so that the import works!
691
if (!is_wp_error($t)) {
692
$term_id = $t['term_id'];
693
694
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Inserted Raw Term %s ID = %s', 'product-import-export-for-woo'), esc_html($raw_term), $term_id));
695
} else {
696
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Failed to import term %s %s', 'product-import-export-for-woo'), esc_html($raw_term), esc_html($taxonomy)));
697
break;
698
}
699
} else {
700
+ $WF_CSV_Product_Import->hf_log_data_change('csv-import', sprintf(__('> > Raw Term %s ID = %s', 'product-import-export-for-woo'), esc_html($raw_term), $term_id));
701
}
702
703
if ($term_id) {
includes/importer/class-wf-prodimpexpcsv-product-import.php CHANGED
@@ -97,7 +97,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
97
if ( !empty($_GET['clearmapping']) || $this->handle_upload() )
98
$this->import_options();
99
else
100
- _e( 'Error with handle_upload!', 'wf_csv_import_export' );
101
break;
102
case 2 :
103
$this->header();
@@ -122,10 +122,10 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
122
<thead>
123
<tr>
124
<th class="status">&nbsp;</th>
125
- <th class="row"><?php _e( 'Row', 'wf_csv_import_export' ); ?></th>
126
- <th><?php _e( 'SKU', 'wf_csv_import_export' ); ?></th>
127
- <th><?php _e( 'Product', 'wf_csv_import_export' ); ?></th>
128
- <th class="reason"><?php _e( 'Status Msg', 'wf_csv_import_export' ); ?></th>
129
</tr>
130
</thead>
131
<tfoot>
@@ -168,7 +168,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
168
data: data,
169
type: 'POST',
170
success: function( response ) {
171
- //console.log( response );
172
if ( response ) {
173
174
try {
@@ -219,7 +219,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
219
} catch(err) {}
220
221
} else {
222
- $('#import-progress tbody').append( '<tr class="error"><td class="status" colspan="5">' + '<?php _e( 'AJAX Error', 'wf_csv_import_export' ); ?>' + '</td></tr>' );
223
}
224
225
var w = $(window);
@@ -324,7 +324,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
324
if ( response !== Object( response ) || ( typeof response.success === "undefined" && typeof response.error === "undefined" ) ) {
325
response = new Object;
326
response.success = false;
327
- response.error = "<?php printf( esc_js( __( 'The resize request was abnormally terminated (ID %s). This is likely due to the image exceeding available memory or some other type of fatal error.', 'wf_csv_import_export' ) ), '" + id + "' ); ?>";
328
}
329
330
//regen_count ++;
@@ -337,8 +337,8 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
337
338
339
all_regen_count = failed_regen_count + regen_count;
340
- $('#import-progress tbody .regenerating .progress').css( 'width', ( ( all_regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js(__('thumbnails regenerated.', 'wf_csv_import_export')); ?>' );
341
- //$('#import-progress tbody .regenerating .progress').css( 'width', ( ( regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php //echo esc_js( __( 'thumbnails regenerated', 'wf_csv_import_export' ) ); ?>' );
342
343
// if ( ! response.success ) {
344
// $('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
@@ -348,7 +348,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
348
//console.log('On Error:-'+JSON.stringify(response, null, 4));
349
failed_regen_count++;
350
all_regen_count = failed_regen_count + regen_count;
351
- $('#import-progress tbody .regenerating .progress').css( 'width', ( ( all_regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js(__('thumbnails regenerated.', 'wf_csv_import_export')); ?>' );
352
//$('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
353
}
354
});
@@ -380,7 +380,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
380
</script>
381
<?php
382
} else {
383
- echo '<p class="error">' . __( 'Error finding uploaded file!', 'wf_csv_import_export' ) . '</p>';
384
}
385
break;
386
case 3 :
@@ -445,12 +445,12 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
445
$this->crosssell_skus = isset( $_POST['crosssell_skus']) ? array_filter( (array) $_POST['crosssell_skus'] ) : array();
446
$this->upsell_skus = isset( $_POST['upsell_skus']) ? array_filter( (array) $_POST['upsell_skus'] ) : array();
447
448
- _e( 'Step 1...', 'wf_csv_import_export' ) . ' ';
449
450
wp_defer_term_counting( true );
451
wp_defer_comment_counting( true );
452
453
- _e( 'Step 2...', 'wf_csv_import_export' ) . ' ';
454
455
echo 'Step 3...' . ' '; // Easter egg
456
@@ -465,13 +465,13 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
465
466
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_product_type_%')");
467
468
- _e( 'Finalizing...', 'wf_csv_import_export' ) . ' ';
469
470
$this->backfill_parents();
471
472
if ( ! empty( $this->upsell_skus ) ) {
473
474
- _e( 'Linking upsells...', 'wf_csv_import_export' ) . ' ';
475
476
foreach ( $this->upsell_skus as $post_id => $skus ) {
477
$this->link_product_skus( 'upsell', $post_id, $skus );
@@ -480,14 +480,14 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
480
481
if ( ! empty( $this->crosssell_skus ) ) {
482
483
- _e( 'Linking crosssells...', 'wf_csv_import_export' ) . ' ';
484
485
foreach ( $this->crosssell_skus as $post_id => $skus ) {
486
$this->link_product_skus( 'crosssell', $post_id, $skus );
487
}
488
}
489
// SUCCESS
490
- _e( 'Finished. Import complete.', 'wf_csv_import_export' );
491
492
$this->import_end();
493
exit;
@@ -546,7 +546,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
546
//if(count(array_intersect_key ( $mapping_from_db[0] , $row)) == count($mapping_from_db[0])){
547
$reset_action = 'admin.php?clearmapping=1&amp;import=' . $this->import_page . '&amp;step=1&amp;merge=' . $this->merge . '&amp;file_url=' . $this->file_url . '&amp;delimiter=' . $this->delimiter . '&amp;merge_empty_cells=' . $this->merge_empty_cells . '&amp;file_id=' . $this->id . '';
548
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
549
- echo '<h3>' . __( 'Map to fields are pre-selected based on your last import. <a href="'.$reset_action.'">Click here</a> to clear saved mapping.', 'wf_csv_import_export' ) . '</h3>';
550
$saved_mapping = $mapping_from_db[0];
551
$saved_evaluation = $mapping_from_db[1];
552
//}
@@ -583,7 +583,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
583
wp_suspend_cache_invalidation( true );
584
585
$this->hf_log_data_change( 'csv-import', '---' );
586
- $this->hf_log_data_change( 'csv-import', __( 'Processing products.', 'wf_csv_import_export' ) );
587
foreach ( $this->parsed_data as $key => &$item ) {
588
589
$product = $this->parser->parse_product( $item, $this->merge_empty_cells );
@@ -594,7 +594,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
594
}
595
unset( $item, $product );
596
}
597
- $this->hf_log_data_change( 'csv-import', __( 'Finished processing products.', 'wf_csv_import_export' ) );
598
wp_suspend_cache_invalidation( false );
599
}
600
@@ -627,13 +627,13 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
627
628
}
629
$this->hf_log_data_change( 'csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory );
630
- $this->hf_log_data_change( 'csv-import', __( 'Parsing products CSV.', 'wf_csv_import_export' ) );
631
632
$this->parser = new WF_CSV_Parser( 'product' );
633
634
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data( $file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field );
635
636
- $this->hf_log_data_change( 'csv-import', __( 'Finished parsing products CSV.', 'wf_csv_import_export' ) );
637
638
unset( $import_data );
639
@@ -675,7 +675,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
675
$file = wp_import_handle_upload();
676
677
if ( isset( $file['error'] ) ) {
678
- echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wf_csv_import_export' ) . '</strong><br />';
679
echo esc_html( $file['error'] ) . '</p>';
680
return false;
681
}
@@ -692,7 +692,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
692
693
} else {
694
695
- echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wf_csv_import_export' ) . '</strong></p>';
696
return false;
697
698
}
@@ -805,37 +805,58 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
805
}
806
807
if ( ! empty( $processing_product_id ) && isset( $this->processed_posts[ $processing_product_id ] ) ) {
808
- $this->add_import_result( 'skipped', __( 'Product already processed', 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
809
- $this->hf_log_data_change( 'csv-import', __('> Post ID already processed. Skipping.', 'wf_csv_import_export'), true );
810
unset( $post );
811
return;
812
}
813
814
if ( ! empty ( $post['post_status'] ) && $post['post_status'] == 'auto-draft' ) {
815
- $this->add_import_result( 'skipped', __( 'Skipping auto-draft', 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
816
- $this->hf_log_data_change( 'csv-import', __('> Skipping auto-draft.', 'wf_csv_import_export'), true );
817
unset( $post );
818
return;
819
}
820
// Check if post exists when importing
821
822
if ( ! $merging ) {
823
- if ( $this->product_exists( $processing_product_title, $processing_product_sku, $post['post_name'] ) ) {
824
if(!$processing_product_id && empty($processing_product_sku)) {
825
// if no sku , no id and no merge + is product in db with same title -> just give message
826
$usr_msg = 'Product with same title already exist.';
827
}else{
828
$usr_msg = 'Product already exists.';
829
}
830
- $this->add_import_result( 'skipped', __( $usr_msg, 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
831
- $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221;'.$usr_msg, 'wf_csv_import_export'), esc_html($processing_product_title) ), true );
832
unset( $post );
833
return;
834
}
835
-
836
if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
837
- $this->add_import_result( 'skipped', __( 'Importing post ID conflicts with an existing post ID', 'wf_csv_import_export' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
838
- $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; ID already exists.', 'wf_csv_import_export'), esc_html( $processing_product_id ) ), true );
839
unset( $post );
840
return;
841
}
@@ -845,9 +866,9 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
845
// if ( ! $merging ) {
846
// error_log('<pre>$this->wf_get_product_id_by_sku( $processing_product_sku ):-' . print_r($this->wf_get_product_id_by_sku( $processing_product_sku ), 1) . '</per>', 3, ABSPATH . "/wp-content/uploads/wc-logs/test-log.txt");
847
// if ( $this->wf_get_product_id_by_sku( $processing_product_sku ) ) {
848
- //// $usr_msg = __( 'Product already exists.', 'wf_csv_import_export' );
849
//// $this->add_import_result( 'skipped',$usr_msg, $processing_product_id, $processing_product_title, $processing_product_sku );
850
- //// $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; Product already exists.', 'wf_csv_import_export'), esc_html($processing_product_title) ), true );
851
//// unset( $post );
852
//// return;
853
//
@@ -857,15 +878,15 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
857
// }else{
858
// $usr_msg = 'Product already exists.';
859
// }
860
- // $this->add_import_result( 'skipped', __( $usr_msg, 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
861
- // $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221;'.$usr_msg, 'wf_csv_import_export'), esc_html($processing_product_title) ), true );
862
// unset( $post );
863
// return;
864
// }
865
//
866
// if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
867
- // $this->add_import_result( 'skipped', __( 'Importing post ID conflicts with an existing post ID', 'wf_csv_import_export' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
868
- // $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; ID already exists.', 'wf_csv_import_export'), esc_html( $processing_product_id ) ), true );
869
// unset( $post );
870
// return;
871
// }
@@ -873,8 +894,8 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
873
// Check post type to avoid conflicts with IDs
874
$is_post_exist_in_db = get_post_type( $processing_product_id );
875
if ( $merging && $processing_product_id && !empty($is_post_exist_in_db) && ($is_post_exist_in_db !== $post['post_type'] )) {
876
- $this->add_import_result( 'skipped', __( 'Post is not a product', 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
877
- $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; is not a product.', 'wf_csv_import_export'), esc_html($processing_product_id) ), true );
878
unset( $post );
879
return;
880
}
@@ -884,7 +905,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
884
// Only merge fields which are set
885
$post_id = $processing_product_id;
886
887
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Merging post ID %s.', 'wf_csv_import_export'), $post_id ), true );
888
889
$postdata = array(
890
'ID' => $post_id
@@ -947,12 +968,12 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
947
$result = wp_update_post( $postdata );
948
949
if ( ! $result ) {
950
- $this->add_import_result( 'failed', __( 'Failed to update product', 'wf_csv_import_export' ), $post_id, $processing_product_title, $processing_product_sku );
951
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Failed to update product %s', 'wf_csv_import_export'), $post_id ), true );
952
unset( $post );
953
return;
954
} else {
955
- $this->hf_log_data_change( 'csv-import', __( '> Merged post data: ', 'wf_csv_import_export' ) . print_r( $postdata, true ) );
956
}
957
}
958
@@ -981,7 +1002,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
981
}
982
983
// Insert product
984
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Inserting %s', 'wf_csv_import_export'), esc_html( $processing_product_title ) ), true );
985
$postdata = array(
986
'import_id' => $processing_product_id,
987
'post_author' => !empty($post['post_author']) ? absint($post['post_author']) : get_current_user_id(),
@@ -1003,14 +1024,14 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1003
1004
if ( is_wp_error( $post_id ) ) {
1005
1006
- $this->add_import_result( 'failed', __( 'Failed to import product', 'wf_csv_import_export' ), $processing_product_id, $processing_product_title, $processing_product_sku );
1007
- $this->hf_log_data_change( 'csv-import', sprintf( __( 'Failed to import product &#8220;%s&#8221;', 'wf_csv_import_export' ), esc_html($processing_product_title) ) );
1008
unset( $post );
1009
return;
1010
1011
} else {
1012
1013
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Inserted - post ID is %s.', 'wf_csv_import_export'), $post_id ) );
1014
1015
}
1016
}
@@ -1115,7 +1136,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1115
if ( $image == $attachment_url || basename( $image ) == $attachment_basename ) {
1116
unset( $post['images'][ $key ] );
1117
1118
- $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Image exists - skipping %s', 'wf_csv_import_export' ), basename( $image ) ) );
1119
1120
if ( $key == 0 ) {
1121
update_post_meta( $post_id, '_thumbnail_id', $attachment );
@@ -1145,7 +1166,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1145
1146
if ( $post['images'] ) foreach ( $post['images'] as $image_key => $image ) {
1147
1148
- $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Importing image "%s"', 'wf_csv_import_export' ), $image ) );
1149
1150
$filename = basename( $image );
1151
@@ -1160,7 +1181,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1160
1161
if ( ! is_wp_error( $attachment_id ) && $attachment_id ) {
1162
1163
- $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Imported image "%s"', 'wf_csv_import_export' ), $image ) );
1164
1165
// Set alt
1166
update_post_meta( $attachment_id, '_wp_attachment_image_alt', $processing_product_title );
@@ -1175,14 +1196,14 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1175
1176
$featured = false;
1177
} else {
1178
- $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Error importing image "%s"', 'wf_csv_import_export' ), $image ) );
1179
$this->hf_log_data_change( 'csv-import', '> > ' . $attachment_id->get_error_message() );
1180
}
1181
1182
unset( $attachment, $attachment_id );
1183
}
1184
1185
- $this->hf_log_data_change( 'csv-import', __( '> > Images set', 'wf_csv_import_export' ) );
1186
1187
ksort( $gallery_ids );
1188
@@ -1235,10 +1256,10 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1235
1236
if ( $merging ) {
1237
$this->add_import_result( 'merged', 'Merge successful', $post_id, $processing_product_title, $processing_product_sku );
1238
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished merging post ID %s.', 'wf_csv_import_export'), $post_id ) );
1239
} else {
1240
$this->add_import_result( 'imported', 'Import successful', $post_id, $processing_product_title, $processing_product_sku );
1241
- $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished importing post ID %s.', 'wf_csv_import_export'), $post_id ) );
1242
}
1243
1244
do_action('wf_refresh_after_product_import',$processing_product_object); // hook for forcefully refresh product
@@ -1284,7 +1305,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1284
if($image_id){
1285
$attachment_id = $image_id;
1286
1287
- $this->hf_log_data_change('csv-import', sprintf(__('> > (Image already in the site)Inserted image attachment "%s"', 'wf_csv_import_export'), $url));
1288
1289
$this->attachments[] = $attachment_id;
1290
@@ -1316,13 +1337,13 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1316
if ( $info = wp_check_filetype( $attachment_file ) )
1317
$post['post_mime_type'] = $info['type'];
1318
else
1319
- return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') );
1320
1321
1322
$image_id = $this->wt_get_image_id_by_url($attachment_url);
1323
if($image_id){
1324
$attachment_id = $image_id;
1325
- $this->hf_log_data_change('csv-import', sprintf(__('> > (Image already in the site)Inserted image attachment "%s"', 'wf_csv_import_export'), $url));
1326
$this->attachments[] = $attachment_id;
1327
return $attachment_id;
1328
}
@@ -1332,7 +1353,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1332
$attachment_id = wp_insert_attachment( $post, $attachment_file, $post_id );
1333
1334
} else {
1335
- return new WP_Error( 'attachment_processing_error', __('Local image did not exist!', 'wordpress-importer') );
1336
}
1337
1338
} else {
@@ -1349,7 +1370,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1349
if ( $info = wp_check_filetype( $upload['file'] ) )
1350
$post['post_mime_type'] = $info['type'];
1351
else
1352
- return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') );
1353
1354
$post['guid'] = $upload['url'];
1355
$attachment_file = $upload['file'];
@@ -1362,7 +1383,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1362
}
1363
1364
if ( ! is_wp_error( $attachment_id ) && $attachment_id > 0 ) {
1365
- $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Inserted image attachment "%s"', 'wf_csv_import_export' ), $url ) );
1366
1367
$this->attachments[] = $attachment_id;
1368
}
@@ -1395,11 +1416,13 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1395
1396
// Get the file
1397
$response = wp_remote_get( $url, array(
1398
- 'timeout' => 10
1399
) );
1400
1401
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 )
1402
- return new WP_Error( 'import_file_error', 'Error getting remote image' );
1403
1404
// Ensure we have a file name and type
1405
if ( ! $wp_filetype['type'] ) {
@@ -1433,7 +1456,7 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
1433
if ( 0 == $filesize ) {
1434
@unlink( $upload['file'] );
1435
unset( $upload );
1436
- return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'wf_csv_import_export') );
1437
}
1438
1439
unset( $response );
97
if ( !empty($_GET['clearmapping']) || $this->handle_upload() )
98
$this->import_options();
99
else
100
+ _e( 'Error with handle_upload!', 'product-import-export-for-woo' );
101
break;
102
case 2 :
103
$this->header();
122
<thead>
123
<tr>
124
<th class="status">&nbsp;</th>
125
+ <th class="row"><?php _e( 'Row', 'product-import-export-for-woo' ); ?></th>
126
+ <th><?php _e( 'SKU', 'product-import-export-for-woo' ); ?></th>
127
+ <th><?php _e( 'Product', 'product-import-export-for-woo' ); ?></th>
128
+ <th class="reason"><?php _e( 'Status Msg', 'product-import-export-for-woo' ); ?></th>
129
</tr>
130
</thead>
131
<tfoot>
168
data: data,
169
type: 'POST',
170
success: function( response ) {
171
+ console.log( response );
172
if ( response ) {
173
174
try {
219
} catch(err) {}
220
221
} else {
222
+ $('#import-progress tbody').append( '<tr class="error"><td class="status" colspan="5">' + '<?php _e( 'AJAX Error', 'product-import-export-for-woo' ); ?>' + '</td></tr>' );
223
}
224
225
var w = $(window);
324
if ( response !== Object( response ) || ( typeof response.success === "undefined" && typeof response.error === "undefined" ) ) {
325
response = new Object;
326
response.success = false;
327
+ response.error = "<?php printf( esc_js( __( 'The resize request was abnormally terminated (ID %s). This is likely due to the image exceeding available memory or some other type of fatal error.', 'product-import-export-for-woo' ) ), '" + id + "' ); ?>";
328
}
329
330
//regen_count ++;
337
338
339
all_regen_count = failed_regen_count + regen_count;
340
+ $('#import-progress tbody .regenerating .progress').css( 'width', ( ( all_regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js(__('thumbnails regenerated.', 'product-import-export-for-woo')); ?>' );
341
+ //$('#import-progress tbody .regenerating .progress').css( 'width', ( ( regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php //echo esc_js( __( 'thumbnails regenerated', 'product-import-export-for-woo' ) ); ?>' );
342
343
// if ( ! response.success ) {
344
// $('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
348
//console.log('On Error:-'+JSON.stringify(response, null, 4));
349
failed_regen_count++;
350
all_regen_count = failed_regen_count + regen_count;
351
+ $('#import-progress tbody .regenerating .progress').css( 'width', ( ( all_regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js(__('thumbnails regenerated.', 'product-import-export-for-woo')); ?>' );
352
//$('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
353
}
354
});
380
</script>
381
<?php
382
} else {
383
+ echo '<p class="error">' . __( 'Error finding uploaded file!', 'product-import-export-for-woo' ) . '</p>';
384
}
385
break;
386
case 3 :
445
$this->crosssell_skus = isset( $_POST['crosssell_skus']) ? array_filter( (array) $_POST['crosssell_skus'] ) : array();
446
$this->upsell_skus = isset( $_POST['upsell_skus']) ? array_filter( (array) $_POST['upsell_skus'] ) : array();
447
448
+ _e( 'Step 1...', 'product-import-export-for-woo' ) . ' ';
449
450
wp_defer_term_counting( true );
451
wp_defer_comment_counting( true );
452
453
+ _e( 'Step 2...', 'product-import-export-for-woo' ) . ' ';
454
455
echo 'Step 3...' . ' '; // Easter egg
456
465
466
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_product_type_%')");
467
468
+ _e( 'Finalizing...', 'product-import-export-for-woo' ) . ' ';
469
470
$this->backfill_parents();
471
472
if ( ! empty( $this->upsell_skus ) ) {
473
474
+ _e( 'Linking upsells...', 'product-import-export-for-woo' ) . ' ';
475
476
foreach ( $this->upsell_skus as $post_id => $skus ) {
477
$this->link_product_skus( 'upsell', $post_id, $skus );
480
481
if ( ! empty( $this->crosssell_skus ) ) {
482
483
+ _e( 'Linking crosssells...', 'product-import-export-for-woo' ) . ' ';
484
485
foreach ( $this->crosssell_skus as $post_id => $skus ) {
486
$this->link_product_skus( 'crosssell', $post_id, $skus );
487
}
488
}
489
// SUCCESS
490
+ _e( 'Finished. Import complete.', 'product-import-export-for-woo' );
491
492
$this->import_end();
493
exit;
546
//if(count(array_intersect_key ( $mapping_from_db[0] , $row)) == count($mapping_from_db[0])){
547
$reset_action = 'admin.php?clearmapping=1&amp;import=' . $this->import_page . '&amp;step=1&amp;merge=' . $this->merge . '&amp;file_url=' . $this->file_url . '&amp;delimiter=' . $this->delimiter . '&amp;merge_empty_cells=' . $this->merge_empty_cells . '&amp;file_id=' . $this->id . '';
548
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
549
+ echo '<h3>' . __( 'Map to fields are pre-selected based on your last import. <a href="'.$reset_action.'">Click here</a> to clear saved mapping.', 'product-import-export-for-woo' ) . '</h3>';
550
$saved_mapping = $mapping_from_db[0];
551
$saved_evaluation = $mapping_from_db[1];
552
//}
583
wp_suspend_cache_invalidation( true );
584
585
$this->hf_log_data_change( 'csv-import', '---' );
586
+ $this->hf_log_data_change( 'csv-import', __( 'Processing products.', 'product-import-export-for-woo' ) );
587
foreach ( $this->parsed_data as $key => &$item ) {
588
589
$product = $this->parser->parse_product( $item, $this->merge_empty_cells );
594
}
595
unset( $item, $product );
596
}
597
+ $this->hf_log_data_change( 'csv-import', __( 'Finished processing products.', 'product-import-export-for-woo' ) );
598
wp_suspend_cache_invalidation( false );
599
}
600
627
628
}
629
$this->hf_log_data_change( 'csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory );
630
+ $this->hf_log_data_change( 'csv-import', __( 'Parsing products CSV.', 'product-import-export-for-woo' ) );
631
632
$this->parser = new WF_CSV_Parser( 'product' );
633
634
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data( $file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field );
635
636
+ $this->hf_log_data_change( 'csv-import', __( 'Finished parsing products CSV.', 'product-import-export-for-woo' ) );
637
638
unset( $import_data );
639
675
$file = wp_import_handle_upload();
676
677
if ( isset( $file['error'] ) ) {
678
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'product-import-export-for-woo' ) . '</strong><br />';
679
echo esc_html( $file['error'] ) . '</p>';
680
return false;
681
}
692
693
} else {
694
695
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'product-import-export-for-woo' ) . '</strong></p>';
696
return false;
697
698
}
805
}
806
807
if ( ! empty( $processing_product_id ) && isset( $this->processed_posts[ $processing_product_id ] ) ) {
808
+ $this->add_import_result( 'skipped', __( 'Product already processed', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
809
+ $this->hf_log_data_change( 'csv-import', __('> Post ID already processed. Skipping.', 'product-import-export-for-woo'), true );
810
unset( $post );
811
return;
812
}
813
814
if ( ! empty ( $post['post_status'] ) && $post['post_status'] == 'auto-draft' ) {
815
+ $this->add_import_result( 'skipped', __( 'Skipping auto-draft', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
816
+ $this->hf_log_data_change( 'csv-import', __('> Skipping auto-draft.', 'product-import-export-for-woo'), true );
817
unset( $post );
818
return;
819
}
820
// Check if post exists when importing
821
822
if ( ! $merging ) {
823
+ /* if ( $this->product_exists( $processing_product_title, $processing_product_sku, $post['post_name'] ) ) {
824
if(!$processing_product_id && empty($processing_product_sku)) {
825
// if no sku , no id and no merge + is product in db with same title -> just give message
826
$usr_msg = 'Product with same title already exist.';
827
}else{
828
$usr_msg = 'Product already exists.';
829
}
830
+ $this->add_import_result( 'skipped', __( $usr_msg, 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
831
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221;'.$usr_msg, 'product-import-export-for-woo'), esc_html($processing_product_title) ), true );
832
unset( $post );
833
return;
834
}
835
+ */
836
+
837
+ $existing_product = '';
838
+ if (isset($processing_product_sku) && !empty($processing_product_sku)) {
839
+ $existing_product = wc_get_product_id_by_sku($processing_product_sku);
840
+ }
841
+ if ($existing_product) {
842
+ if ($this->delete_products == 1) {
843
+ $product_to_be_deleted[] =$existing_product;
844
+ }
845
+ if (!$processing_product_id && empty($processing_product_sku)) {
846
+ // if no sku , no id and no merge and has same title in DB -> just give message
847
+ $usr_msg = 'Product with same title already exists.';
848
+ } else {
849
+ $usr_msg = 'Product already exists.';
850
+ }
851
+ $this->add_import_result('skipped', __($usr_msg, 'product-import-export-for-woo'), $existing_product, $processing_product_title, $processing_product_sku);
852
+ $this->hf_log_data_change('csv-import', sprintf(__('> &#8220;%s&#8221;' . $usr_msg, 'product-import-export-for-woo'), esc_html($processing_product_title)).' with post ID:'.$existing_product, true);
853
+ unset($post);
854
+ return;
855
+ }
856
+
857
if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
858
+ $this->add_import_result( 'skipped', __( 'Importing post ID conflicts with an existing post ID', 'product-import-export-for-woo' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
859
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; ID already exists.', 'product-import-export-for-woo'), esc_html( $processing_product_id ) ), true );
860
unset( $post );
861
return;
862
}
866
// if ( ! $merging ) {
867
// error_log('<pre>$this->wf_get_product_id_by_sku( $processing_product_sku ):-' . print_r($this->wf_get_product_id_by_sku( $processing_product_sku ), 1) . '</per>', 3, ABSPATH . "/wp-content/uploads/wc-logs/test-log.txt");
868
// if ( $this->wf_get_product_id_by_sku( $processing_product_sku ) ) {
869
+ //// $usr_msg = __( 'Product already exists.', 'product-import-export-for-woo' );
870
//// $this->add_import_result( 'skipped',$usr_msg, $processing_product_id, $processing_product_title, $processing_product_sku );
871
+ //// $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; Product already exists.', 'product-import-export-for-woo'), esc_html($processing_product_title) ), true );
872
//// unset( $post );
873
//// return;
874
//
878
// }else{
879
// $usr_msg = 'Product already exists.';
880
// }
881
+ // $this->add_import_result( 'skipped', __( $usr_msg, 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
882
+ // $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221;'.$usr_msg, 'product-import-export-for-woo'), esc_html($processing_product_title) ), true );
883
// unset( $post );
884
// return;
885
// }
886
//
887
// if ( $processing_product_id && is_string( get_post_status( $processing_product_id ) ) ) {
888
+ // $this->add_import_result( 'skipped', __( 'Importing post ID conflicts with an existing post ID', 'product-import-export-for-woo' ), $processing_product_id, get_the_title( $processing_product_id ), '' );
889
+ // $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; ID already exists.', 'product-import-export-for-woo'), esc_html( $processing_product_id ) ), true );
890
// unset( $post );
891
// return;
892
// }
894
// Check post type to avoid conflicts with IDs
895
$is_post_exist_in_db = get_post_type( $processing_product_id );
896
if ( $merging && $processing_product_id && !empty($is_post_exist_in_db) && ($is_post_exist_in_db !== $post['post_type'] )) {
897
+ $this->add_import_result( 'skipped', __( 'Post is not a product', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
898
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> &#8220;%s&#8221; is not a product.', 'product-import-export-for-woo'), esc_html($processing_product_id) ), true );
899
unset( $post );
900
return;
901
}
905
// Only merge fields which are set
906
$post_id = $processing_product_id;
907
908
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Merging post ID %s.', 'product-import-export-for-woo'), $post_id ), true );
909
910
$postdata = array(
911
'ID' => $post_id
968
$result = wp_update_post( $postdata );
969
970
if ( ! $result ) {
971
+ $this->add_import_result( 'failed', __( 'Failed to update product', 'product-import-export-for-woo' ), $post_id, $processing_product_title, $processing_product_sku );
972
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Failed to update product %s', 'product-import-export-for-woo'), $post_id ), true );
973
unset( $post );
974
return;
975
} else {
976
+ $this->hf_log_data_change( 'csv-import', __( '> Merged post data: ', 'product-import-export-for-woo' ) . print_r( $postdata, true ) );
977
}
978
}
979
1002
}
1003
1004
// Insert product
1005
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Inserting %s', 'product-import-export-for-woo'), esc_html( $processing_product_title ) ), true );
1006
$postdata = array(
1007
'import_id' => $processing_product_id,
1008
'post_author' => !empty($post['post_author']) ? absint($post['post_author']) : get_current_user_id(),
1024
1025
if ( is_wp_error( $post_id ) ) {
1026
1027
+ $this->add_import_result( 'failed', __( 'Failed to import product', 'product-import-export-for-woo' ), $processing_product_id, $processing_product_title, $processing_product_sku );
1028
+ $this->hf_log_data_change( 'csv-import', sprintf( __( 'Failed to import product &#8220;%s&#8221;', 'product-import-export-for-woo' ), esc_html($processing_product_title) ) );
1029
unset( $post );
1030
return;
1031
1032
} else {
1033
1034
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Inserted - post ID is %s.', 'product-import-export-for-woo'), $post_id ) );
1035
1036
}
1037
}
1136
if ( $image == $attachment_url || basename( $image ) == $attachment_basename ) {
1137
unset( $post['images'][ $key ] );
1138
1139
+ $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Image exists - skipping %s', 'product-import-export-for-woo' ), basename( $image ) ) );
1140
1141
if ( $key == 0 ) {
1142
update_post_meta( $post_id, '_thumbnail_id', $attachment );
1166
1167
if ( $post['images'] ) foreach ( $post['images'] as $image_key => $image ) {
1168
1169
+ $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Importing image "%s"', 'product-import-export-for-woo' ), $image ) );
1170
1171
$filename = basename( $image );
1172
1181
1182
if ( ! is_wp_error( $attachment_id ) && $attachment_id ) {
1183
1184
+ $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Imported image "%s"', 'product-import-export-for-woo' ), $image ) );
1185
1186
// Set alt
1187
update_post_meta( $attachment_id, '_wp_attachment_image_alt', $processing_product_title );
1196
1197
$featured = false;
1198
} else {
1199
+ $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Error importing image "%s"', 'product-import-export-for-woo' ), $image ) );
1200
$this->hf_log_data_change( 'csv-import', '> > ' . $attachment_id->get_error_message() );
1201
}
1202
1203
unset( $attachment, $attachment_id );
1204
}
1205
1206
+ $this->hf_log_data_change( 'csv-import', __( '> > Images set', 'product-import-export-for-woo' ) );
1207
1208
ksort( $gallery_ids );
1209
1256
1257
if ( $merging ) {
1258
$this->add_import_result( 'merged', 'Merge successful', $post_id, $processing_product_title, $processing_product_sku );
1259
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished merging post ID %s.', 'product-import-export-for-woo'), $post_id ) );
1260
} else {
1261
$this->add_import_result( 'imported', 'Import successful', $post_id, $processing_product_title, $processing_product_sku );
1262
+ $this->hf_log_data_change( 'csv-import', sprintf( __('> Finished importing post ID %s.', 'product-import-export-for-woo'), $post_id ) );
1263
}
1264
1265
do_action('wf_refresh_after_product_import',$processing_product_object); // hook for forcefully refresh product
1305
if($image_id){
1306
$attachment_id = $image_id;
1307
1308
+ $this->hf_log_data_change('csv-import', sprintf(__('> > (Image already in the site)Inserted image attachment "%s"', 'product-import-export-for-woo'), $url));
1309
1310
$this->attachments[] = $attachment_id;
1311
1337
if ( $info = wp_check_filetype( $attachment_file ) )
1338
$post['post_mime_type'] = $info['type'];
1339
else
1340
+ return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'product-import-export-for-woo') );
1341
1342
1343
$image_id = $this->wt_get_image_id_by_url($attachment_url);
1344
if($image_id){
1345
$attachment_id = $image_id;
1346
+ $this->hf_log_data_change('csv-import', sprintf(__('> > (Image already in the site)Inserted image attachment "%s"', 'product-import-export-for-woo'), $url));
1347
$this->attachments[] = $attachment_id;
1348
return $attachment_id;
1349
}
1353
$attachment_id = wp_insert_attachment( $post, $attachment_file, $post_id );
1354
1355
} else {
1356
+ return new WP_Error( 'attachment_processing_error', __('Local image did not exist!', 'product-import-export-for-woo') );
1357
}
1358
1359
} else {
1370
if ( $info = wp_check_filetype( $upload['file'] ) )
1371
$post['post_mime_type'] = $info['type'];
1372
else
1373
+ return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'product-import-export-for-woo') );
1374
1375
$post['guid'] = $upload['url'];
1376
$attachment_file = $upload['file'];
1383
}
1384
1385
if ( ! is_wp_error( $attachment_id ) && $attachment_id > 0 ) {
1386
+ $this->hf_log_data_change( 'csv-import', sprintf( __( '> > Inserted image attachment "%s"', 'product-import-export-for-woo' ), $url ) );
1387
1388
$this->attachments[] = $attachment_id;
1389
}
1416
1417
// Get the file
1418
$response = wp_remote_get( $url, array(
1419
+ 'timeout' => 50,
1420
+ "user-agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0",
1421
+ 'sslverify' => FALSE
1422
) );
1423
1424
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 )
1425
+ return new WP_Error( 'import_file_error', $response->get_error_message());
1426
1427
// Ensure we have a file name and type
1428
if ( ! $wp_filetype['type'] ) {
1456
if ( 0 == $filesize ) {
1457
@unlink( $upload['file'] );
1458
unset( $upload );
1459
+ return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'product-import-export-for-woo') );
1460
}
1461
1462
unset( $response );
includes/importer/views/html-wf-import-greeting.php CHANGED
@@ -21,58 +21,58 @@ if (!empty($ftp_settings)) {
21
<div class="woocommerce">
22
23
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
24
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab"><?php _e('Product Export', 'wf_csv_import_export'); ?></a>
25
- <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab nav-tab-active"><?php _e('Product Import', 'wf_csv_import_export'); ?></a>
26
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'wf_csv_import_export'); ?></a>
27
- <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
28
</h2>
29
30
<div class="pipe-main-box">
31
<div class="pipe-view bg-white p-20p">
32
- <h3 class="title"><?php _e('Step 1: Import settings', 'wf_csv_import_export'); ?></h3>
33
<?php if (!empty($upload_dir['error'])) : ?>
34
- <div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'wf_csv_import_export'); ?></p>
35
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
36
<?php else : ?>
37
<div class="tool-box">
38
- <p><?php _e('You can import products (in CSV format) in to the shop using by uploading a CSV file.', 'wf_csv_import_export'); ?></p>
39
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
40
<table class="form-table">
41
<tbody>
42
<tr>
43
<th>
44
- <label for="upload"><?php _e('Select a file from your computer', 'wf_csv_import_export'); ?></label>
45
</th>
46
<td>
47
<input type="file" id="upload" name="import" size="25" />
48
<input type="hidden" name="action" value="save" />
49
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /><br/>
50
- <small><?php _e('Please upload UTF-8 encoded CSV', 'wf_csv_import_export'); ?> &nbsp; -- &nbsp; <?php printf(__('Maximum size: %s', 'wf_csv_import_export'), $size); ?></small>
51
</td>
52
</tr>
53
<tr>
54
- <th><label><?php _e('Update products if exists', 'wf_csv_import_export'); ?></label><br/></th>
55
<td>
56
<input type="checkbox" name="merge" id="merge">
57
- <p><small><?php _e('Existing products are identified by their SKUs/IDs. If this option is not selected and if a product with same ID/SKU is found in the CSV, that product will not be imported.', 'wf_csv_import_export'); ?></small></p>
58
</td>
59
60
</tr>
61
<tr>
62
- <th><label><?php _e('Delimiter', 'wf_csv_import_export'); ?></label><br/></th>
63
<td><input type="text" name="delimiter" placeholder="," size="2" /></td>
64
</tr>
65
<tr>
66
- <th><label><?php _e('Merge empty cells', 'wf_csv_import_export'); ?></label><br/></th>
67
<td><input type="checkbox" name="merge_empty_cells" placeholder="," size="2" />
68
- <p><small><?php _e('If this option is checked, empty attributes will be added to products with no value. You can leave this unchecked if you are not sure about this option.', 'wf_csv_import_export'); ?></small></p>
69
</td>
70
</tr>
71
</tbody>
72
</table>
73
<p class="submit">
74
- <input type="submit" class="button button-primary" value="<?php esc_attr_e('Proceed to Import Mapping', 'wf_csv_import_export'); ?>" />
75
- <p><span><i><?php _e('If you want to import from an FTP location or from a URL or to configure a scheduled import you may need to upgrade to premium version.', 'wf_csv_import_export'); ?></i></span></p>
76
</p>
77
</form>
78
<?php endif; ?>
21
<div class="woocommerce">
22
23
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
24
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab"><?php _e('Product Export', 'product-import-export-for-woo'); ?></a>
25
+ <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab nav-tab-active"><?php _e('Product Import', 'product-import-export-for-woo'); ?></a>
26
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'product-import-export-for-woo'); ?></a>
27
+ <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'product-import-export-for-woo'); ?></a>
28
</h2>
29
30
<div class="pipe-main-box">
31
<div class="pipe-view bg-white p-20p">
32
+ <h3 class="title"><?php _e('Step 1: Import settings', 'product-import-export-for-woo'); ?></h3>
33
<?php if (!empty($upload_dir['error'])) : ?>
34
+ <div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'product-import-export-for-woo'); ?></p>
35
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
36
<?php else : ?>
37
<div class="tool-box">
38
+ <p><?php _e('You can import products (in CSV format) in to the shop using by uploading a CSV file.', 'product-import-export-for-woo'); ?></p>
39
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
40
<table class="form-table">
41
<tbody>
42
<tr>
43
<th>
44
+ <label for="upload"><?php _e('Select a file from your computer', 'product-import-export-for-woo'); ?></label>
45
</th>
46
<td>
47
<input type="file" id="upload" name="import" size="25" />
48
<input type="hidden" name="action" value="save" />
49
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /><br/>
50
+ <small><?php _e('Please upload UTF-8 encoded CSV', 'product-import-export-for-woo'); ?> &nbsp; -- &nbsp; <?php printf(__('Maximum size: %s', 'product-import-export-for-woo'), $size); ?></small>
51
</td>
52
</tr>
53
<tr>
54
+ <th><label><?php _e('Update products if exists', 'product-import-export-for-woo'); ?></label><br/></th>
55
<td>
56
<input type="checkbox" name="merge" id="merge">
57
+ <p><small><?php _e('Existing products are identified by their SKUs/IDs. If this option is not selected and if a product with same ID/SKU is found in the CSV, that product will not be imported.', 'product-import-export-for-woo'); ?></small></p>
58
</td>
59
60
</tr>
61
<tr>
62
+ <th><label><?php _e('Delimiter', 'product-import-export-for-woo'); ?></label><br/></th>
63
<td><input type="text" name="delimiter" placeholder="," size="2" /></td>
64
</tr>
65
<tr>
66
+ <th><label><?php _e('Merge empty cells', 'product-import-export-for-woo'); ?></label><br/></th>
67
<td><input type="checkbox" name="merge_empty_cells" placeholder="," size="2" />
68
+ <p><small><?php _e('If this option is checked, empty attributes will be added to products with no value. You can leave this unchecked if you are not sure about this option.', 'product-import-export-for-woo'); ?></small></p>
69
</td>
70
</tr>
71
</tbody>
72
</table>
73
<p class="submit">
74
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e('Proceed to Import Mapping', 'product-import-export-for-woo'); ?>" />
75
+ <p><span><i><?php _e('If you want to import from an FTP location or from a URL or to configure a scheduled import you may need to upgrade to premium version.', 'product-import-export-for-woo'); ?></i></span></p>
76
</p>
77
</form>
78
<?php endif; ?>
includes/importer/views/html-wf-import-options.php CHANGED
@@ -4,10 +4,10 @@ if ( ! defined( 'ABSPATH' ) ) {
4
}
5
?>
6
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
7
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab"><?php _e('Product Export', 'wf_csv_import_export'); ?></a>
8
- <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab nav-tab-active"><?php _e('Product Import', 'wf_csv_import_export'); ?></a>
9
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'wf_csv_import_export'); ?></a>
10
- <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
11
</h2>
12
<div class="bg-white p-20p">
13
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $this->merge); ?>" method="post">
@@ -16,16 +16,16 @@ if ( ! defined( 'ABSPATH' ) ) {
16
<?php if ($this->file_url_import_enabled) : ?>
17
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
18
<?php endif; ?>
19
- <h3><?php _e('Step 2: Import mapping', 'wf_csv_import_export'); ?></h3>
20
- <p><?php _e('Here you can map your imported columns to product data fields.', 'wf_csv_import_export'); ?></p>
21
<table class="widefat widefat_importer">
22
<thead>
23
<tr>
24
- <th><?php _e('Woocommerce product fields', 'wf_csv_import_export'); ?></th>
25
- <th><?php _e('CSV column header(from imported file)', 'wf_csv_import_export'); ?></th>
26
- <th><?php _e('Evaluation Field', 'wf_csv_import_export'); ?>
27
<?php $plugin_url = WC()->plugin_url(); ?>
28
- <img class="help_tip" style="float:none;" data-tip="<?php _e('Assign constant value WebToffe to post_author:</br>=WebToffe</br>Add $5 to Price:sale_price:</br>+5</br>Reduce $5 to Price:sale_price:</br>-5</br>Multiple 1.05 to Price:sale_price:</br>*1.05</br>Divide Price:sale_price by 2:</br>/2</br>Append a value By WebToffe to post_title:</br>&By WebToffe</br>Prepend a value WebToffe to post_title:</br>&WebToffe [VAL].', 'wf_csv_import_export'); ?>" src="<?php echo $plugin_url; ?>/assets/images/help.png" height="20" width="20" />
29
</th>
30
</tr>
31
</thead>
@@ -104,7 +104,7 @@ if ( ! defined( 'ABSPATH' ) ) {
104
</td>
105
<td width="25%">
106
<select name="map_from[<?php echo $key; ?>]">
107
- <option value=""><?php _e('Do not import', 'wf_csv_import_export'); ?></option>
108
<?php
109
foreach ($row as $hkey => $hdr):
110
$hdr = strlen($hdr) > 50 ? substr(strip_tags($hdr), 0, 50) . "..." : $hdr;
@@ -120,9 +120,9 @@ if ( ! defined( 'ABSPATH' ) ) {
120
</tbody>
121
</table>
122
<p class="submit"><br/>
123
- <span style="color:gray;"><i><?php _e('Time taken to Import the products depends on the time taken to fetch the images and the internet speed. If you have more than 1000 products we recommend doing the import in batches by splitting the CSV file. Please do not navigate away or close the window while the import is in progress.', 'wf_csv_import_export' ); ?></i></span>
124
<br/><br/>
125
- <input type="submit" class="button button-primary" value="<?php esc_attr_e('Start Import', 'wf_csv_import_export'); ?>" />
126
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
127
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
128
<input type="hidden" name="merge" value="<?php echo $this->merge?>" />
4
}
5
?>
6
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
7
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab"><?php _e('Product Export', 'product-import-export-for-woo'); ?></a>
8
+ <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab nav-tab-active"><?php _e('Product Import', 'product-import-export-for-woo'); ?></a>
9
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'product-import-export-for-woo'); ?></a>
10
+ <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'product-import-export-for-woo'); ?></a>
11
</h2>
12
<div class="bg-white p-20p">
13
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $this->merge); ?>" method="post">
16
<?php if ($this->file_url_import_enabled) : ?>
17
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
18
<?php endif; ?>
19
+ <h3><?php _e('Step 2: Import mapping', 'product-import-export-for-woo'); ?></h3>
20
+ <p><?php _e('Here you can map your imported columns to product data fields.', 'product-import-export-for-woo'); ?></p>
21
<table class="widefat widefat_importer">
22
<thead>
23
<tr>
24
+ <th><?php _e('Woocommerce product fields', 'product-import-export-for-woo'); ?></th>
25
+ <th><?php _e('CSV column header(from imported file)', 'product-import-export-for-woo'); ?></th>
26
+ <th><?php _e('Evaluation Field', 'product-import-export-for-woo'); ?>
27
<?php $plugin_url = WC()->plugin_url(); ?>
28
+ <img class="help_tip" style="float:none;" data-tip="<?php _e('Assign constant value WebToffe to post_author:</br>=WebToffe</br>Add $5 to Price:sale_price:</br>+5</br>Reduce $5 to Price:sale_price:</br>-5</br>Multiple 1.05 to Price:sale_price:</br>*1.05</br>Divide Price:sale_price by 2:</br>/2</br>Append a value By WebToffe to post_title:</br>&By WebToffe</br>Prepend a value WebToffe to post_title:</br>&WebToffe [VAL].', 'product-import-export-for-woo'); ?>" src="<?php echo $plugin_url; ?>/assets/images/help.png" height="20" width="20" />
29
</th>
30
</tr>
31
</thead>
104
</td>
105
<td width="25%">
106
<select name="map_from[<?php echo $key; ?>]">
107
+ <option value=""><?php _e('Do not import', 'product-import-export-for-woo'); ?></option>
108
<?php
109
foreach ($row as $hkey => $hdr):
110
$hdr = strlen($hdr) > 50 ? substr(strip_tags($hdr), 0, 50) . "..." : $hdr;
120
</tbody>
121
</table>
122
<p class="submit"><br/>
123
+ <span style="color:gray;"><i><?php _e('Time taken to Import the products depends on the time taken to fetch the images and the internet speed. If you have more than 1000 products we recommend doing the import in batches by splitting the CSV file. Please do not navigate away or close the window while the import is in progress.', 'product-import-export-for-woo' ); ?></i></span>
124
<br/><br/>
125
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e('Start Import', 'product-import-export-for-woo'); ?>" />
126
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
127
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
128
<input type="hidden" name="merge" value="<?php echo $this->merge?>" />
includes/views/export/html-wf-export-products.php CHANGED
@@ -23,45 +23,45 @@ if ( ! defined( 'ABSPATH' ) ) {
23
</script>
24
<div class="pipe-main-box">
25
<div class="tool-box bg-white p-20p pipe-view">
26
- <h3 class="title" style="font-size: 1.3em !important;font-weight: 600;"><?php _e('Export Settings', 'wf_csv_import_export'); ?></h3>
27
- <p><?php _e('Export and download your products in CSV file format. This file can be used to import products back into your WooCommerce store.', 'wf_csv_import_export'); ?></p>
28
<form action="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&action=export'); ?>" method="post">
29
<table class="form-table">
30
<tr>
31
<th>
32
- <label for="v_offset"><?php _e('Offset', 'wf_csv_import_export'); ?></label>
33
</th>
34
<td>
35
<input type="text" name="offset" id="v_offset" placeholder="0" class="input-text" />
36
- <p style="font-size: 12px"><?php _e('Number of products to skip before exporting. If the value is 0 no products are skipped. If value is 100, products from product id 101 will be exported.', 'wf_csv_import_export'); ?></p>
37
</td>
38
</tr>
39
<tr>
40
<th>
41
- <label for="v_limit"><?php _e('Limit', 'wf_csv_import_export'); ?></label>
42
</th>
43
<td>
44
- <input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'wf_csv_import_export'); ?>" class="input-text" />
45
- <p style="font-size: 12px"><?php _e('Number of products to export. If no value is given all products will be exported. This is useful if you have large number of products and want to export partial list of products.', 'wf_csv_import_export'); ?></p>
46
</td>
47
</tr>
48
<tr>
49
<th colspan="2">
50
- <label for="v_columns"><?php _e('Columns', 'wf_csv_import_export'); ?></label>
51
- <p style="font-size: 12px;font-weight:300;"><?php _e('Configure the Column Names of CSV file.', 'wf_csv_import_export'); ?></p>
52
</th>
53
<table id="datagrid">
54
<th style="text-align: left; padding:6px 25px !important; font-weight: normal !important;color:#000;">
55
- <label for="v_columns"><?php _e('WooCommerce product field name', 'wf_csv_import_export'); ?></label>
56
</th>
57
<th style="text-align: left; padding:6px 25px !important; font-weight: normal !important;color:#000;">
58
- <label for="v_columns_name"><?php _e('Column header name in the CSV file', 'wf_csv_import_export'); ?></label>
59
</th>
60
<!-- select all boxes -->
61
<tr>
62
<td style="padding: 10px;">
63
- <a href="#" id="pselectall" onclick="return false;" ><?php _e('Select all', 'wf_csv_import_export'); ?></a> &nbsp;/&nbsp;
64
- <a href="#" id="punselectall" onclick="return false;"><?php _e('Unselect all', 'wf_csv_import_export'); ?></a>
65
</td>
66
</tr>
67
<?php
@@ -75,7 +75,7 @@ if ( ! defined( 'ABSPATH' ) ) {
75
<tr>
76
<td>
77
<input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
78
- <label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'wf_csv_import_export'); ?></label>
79
</td>
80
<td>
81
<?php
@@ -92,8 +92,8 @@ if ( ! defined( 'ABSPATH' ) ) {
92
</table><br/>
93
</tr>
94
</table>
95
- <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Products', 'wf_csv_import_export'); ?>" /></p>
96
- <p><span><i><?php _e('With this version of the plugin you can export products (except variable products) in to a file. If you want to export to an FTP location (scheduled / manual ) you may need to upgrade to premium version.', 'wf_csv_import_export'); ?></i></span></p>
97
</form>
98
</div>
99
<?php include(WF_ProdImpExpCsv_BASE . 'includes/views/market.php'); ?>
23
</script>
24
<div class="pipe-main-box">
25
<div class="tool-box bg-white p-20p pipe-view">
26
+ <h3 class="title" style="font-size: 1.3em !important;font-weight: 600;"><?php _e('Export Settings', 'product-import-export-for-woo'); ?></h3>
27
+ <p><?php _e('Export and download your products in CSV file format. This file can be used to import products back into your WooCommerce store.', 'product-import-export-for-woo'); ?></p>
28
<form action="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&action=export'); ?>" method="post">
29
<table class="form-table">
30
<tr>
31
<th>
32
+ <label for="v_offset"><?php _e('Offset', 'product-import-export-for-woo'); ?></label>
33
</th>
34
<td>
35
<input type="text" name="offset" id="v_offset" placeholder="0" class="input-text" />
36
+ <p style="font-size: 12px"><?php _e('Number of products to skip before exporting. If the value is 0 no products are skipped. If value is 100, products from product id 101 will be exported.', 'product-import-export-for-woo'); ?></p>
37
</td>
38
</tr>
39
<tr>
40
<th>
41
+ <label for="v_limit"><?php _e('Limit', 'product-import-export-for-woo'); ?></label>
42
</th>
43
<td>
44
+ <input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'product-import-export-for-woo'); ?>" class="input-text" />
45
+ <p style="font-size: 12px"><?php _e('Number of products to export. If no value is given all products will be exported. This is useful if you have large number of products and want to export partial list of products.', 'product-import-export-for-woo'); ?></p>
46
</td>
47
</tr>
48
<tr>
49
<th colspan="2">
50
+ <label for="v_columns"><?php _e('Columns', 'product-import-export-for-woo'); ?></label>
51
+ <p style="font-size: 12px;font-weight:300;"><?php _e('Configure the Column Names of CSV file.', 'product-import-export-for-woo'); ?></p>
52
</th>
53
<table id="datagrid">
54
<th style="text-align: left; padding:6px 25px !important; font-weight: normal !important;color:#000;">
55
+ <label for="v_columns"><?php _e('WooCommerce product field name', 'product-import-export-for-woo'); ?></label>
56
</th>
57
<th style="text-align: left; padding:6px 25px !important; font-weight: normal !important;color:#000;">
58
+ <label for="v_columns_name"><?php _e('Column header name in the CSV file', 'product-import-export-for-woo'); ?></label>
59
</th>
60
<!-- select all boxes -->
61
<tr>
62
<td style="padding: 10px;">
63
+ <a href="#" id="pselectall" onclick="return false;" ><?php _e('Select all', 'product-import-export-for-woo'); ?></a> &nbsp;/&nbsp;
64
+ <a href="#" id="punselectall" onclick="return false;"><?php _e('Unselect all', 'product-import-export-for-woo'); ?></a>
65
</td>
66
</tr>
67
<?php
75
<tr>
76
<td>
77
<input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
78
+ <label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'product-import-export-for-woo'); ?></label>
79
</td>
80
<td>
81
<?php
92
</table><br/>
93
</tr>
94
</table>
95
+ <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Products', 'product-import-export-for-woo'); ?>" /></p>
96
+ <p><span><i><?php _e('With this version of the plugin you can export products (except variable products) in to a file. If you want to export to an FTP location (scheduled / manual ) you may need to upgrade to premium version.', 'product-import-export-for-woo'); ?></i></span></p>
97
</form>
98
</div>
99
<?php include(WF_ProdImpExpCsv_BASE . 'includes/views/market.php'); ?>
includes/views/html-wf-admin-screen.php CHANGED
@@ -6,10 +6,10 @@ if ( ! defined( 'ABSPATH' ) ) {
6
<div class="woocommerce">
7
<div class="icon32" id="icon-woocommerce-importer"><br></div>
8
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
9
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab <?php echo ('help' != $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Product Export', 'wf_csv_import_export'); ?></a>
10
- <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab"><?php _e('Product Import', 'wf_csv_import_export'); ?></a>
11
- <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'wf_csv_import_export'); ?></a>
12
- <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
13
14
</h2>
15
<?php
6
<div class="woocommerce">
7
<div class="icon32" id="icon-woocommerce-importer"><br></div>
8
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
9
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex'); ?>" class="nav-tab <?php echo ('help' != $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Product Export', 'product-import-export-for-woo'); ?></a>
10
+ <a href="<?php echo admin_url('admin.php?import=xa_woocommerce_csv'); ?>" class="nav-tab"><?php _e('Product Import', 'product-import-export-for-woo'); ?></a>
11
+ <a href="<?php echo admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'product-import-export-for-woo'); ?></a>
12
+ <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'product-import-export-for-woo'); ?></a>
13
14
</h2>
15
<?php
includes/views/html-wf-help-guide.php CHANGED
@@ -28,25 +28,25 @@ if ( ! defined( 'ABSPATH' ) ) {
28
<div class="cols">
29
<div class="inner-panel" style="">
30
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/setup.png'; ?>"/>
31
- <h3><?php _e('How-to-setup', 'wf_csv_import_export'); ?></h3>
32
- <p style=""><?php _e('Get to know about our product in 3 minutes with this video', 'wf_csv_import_export'); ?></p>
33
<a href="https://www.webtoffee.com/setting-up-product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-primary">
34
- <?php _e('Setup Guide', 'wf_csv_import_export'); ?></a>
35
</div>
36
37
<div class="inner-panel" style="">
38
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/documentation.png'; ?>"/>
39
- <h3><?php _e('Documentation', 'wf_csv_import_export'); ?></h3>
40
- <p style=""><?php _e('Refer to our documentation to set and get started', 'wf_csv_import_export'); ?></p>
41
- <a target="_blank" href="https://www.webtoffee.com/category/documentation/product-import-export-plugin-for-woocommerce/" class="button-primary"><?php _e('Documentation', 'wf_csv_import_export'); ?></a>
42
</div>
43
44
<div class="inner-panel" style="">
45
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/support.png'; ?>"/>
46
- <h3><?php _e('Support', 'wf_csv_import_export'); ?></h3>
47
- <p style=""><?php _e('We would love to help you on any queries or issues.', 'wf_csv_import_export'); ?></p>
48
<a href="https://www.webtoffee.com/support/" target="_blank" class="button button-primary">
49
- <?php _e('Contact Us', 'wf_csv_import_export'); ?></a>
50
</div>
51
</div>
52
</div>
28
<div class="cols">
29
<div class="inner-panel" style="">
30
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/setup.png'; ?>"/>
31
+ <h3><?php _e('How-to-setup', 'product-import-export-for-woo'); ?></h3>
32
+ <p style=""><?php _e('Get to know about our product in 3 minutes with this video', 'product-import-export-for-woo'); ?></p>
33
<a href="https://www.webtoffee.com/setting-up-product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-primary">
34
+ <?php _e('Setup Guide', 'product-import-export-for-woo'); ?></a>
35
</div>
36
37
<div class="inner-panel" style="">
38
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/documentation.png'; ?>"/>
39
+ <h3><?php _e('Documentation', 'product-import-export-for-woo'); ?></h3>
40
+ <p style=""><?php _e('Refer to our documentation to set and get started', 'product-import-export-for-woo'); ?></p>
41
+ <a target="_blank" href="https://www.webtoffee.com/category/documentation/product-import-export-plugin-for-woocommerce/" class="button-primary"><?php _e('Documentation', 'product-import-export-for-woo'); ?></a>
42
</div>
43
44
<div class="inner-panel" style="">
45
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/support.png'; ?>"/>
46
+ <h3><?php _e('Support', 'product-import-export-for-woo'); ?></h3>
47
+ <p style=""><?php _e('We would love to help you on any queries or issues.', 'product-import-export-for-woo'); ?></p>
48
<a href="https://www.webtoffee.com/support/" target="_blank" class="button button-primary">
49
+ <?php _e('Contact Us', 'product-import-export-for-woo'); ?></a>
50
</div>
51
</div>
52
</div>
includes/views/import/html-wf-import-products.php CHANGED
@@ -1,15 +1,15 @@
1
2
<div class="tool-box">
3
- <h3 class="title"><?php _e('Import Products in CSV Format:', 'wf_csv_import_export'); ?></h3>
4
- <p><?php _e('Import products in CSV format ( works for simple products) from different sources', 'wf_csv_import_export'); ?></p>
5
<p class="submit">
6
<?php
7
$merge_url = admin_url('admin.php?import=woocommerce_csv&merge=1');
8
$import_url = admin_url('admin.php?import=woocommerce_csv');
9
?>
10
- <a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=woocommerce_csv'); ?>"><?php _e('Import Products', 'wf_csv_import_export'); ?></a>
11
&nbsp;
12
- <input type="checkbox" id="merge" value="0"><?php _e('Merge products if exists', 'wf_csv_import_export'); ?> <br>
13
</p>
14
</div>
15
<script type="text/javascript">
1
2
<div class="tool-box">
3
+ <h3 class="title"><?php _e('Import Products in CSV Format:', 'product-import-export-for-woo'); ?></h3>
4
+ <p><?php _e('Import products in CSV format ( works for simple products) from different sources', 'product-import-export-for-woo'); ?></p>
5
<p class="submit">
6
<?php
7
$merge_url = admin_url('admin.php?import=woocommerce_csv&merge=1');
8
$import_url = admin_url('admin.php?import=woocommerce_csv');
9
?>
10
+ <a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=woocommerce_csv'); ?>"><?php _e('Import Products', 'product-import-export-for-woo'); ?></a>
11
&nbsp;
12
+ <input type="checkbox" id="merge" value="0"><?php _e('Merge products if exists', 'product-import-export-for-woo'); ?> <br>
13
</p>
14
</div>
15
<script type="text/javascript">
includes/views/market.php CHANGED
@@ -5,41 +5,41 @@ if ( ! defined( 'ABSPATH' ) ) {
5
?>
6
<div class="market-box table-box-main">
7
<?php /*<div class="getting-started-video">
8
- <h2><?php _e('Watch getting started video', 'wf_csv_import_export');?></h2>
9
<iframe src="https://www.youtube.com/embed/L-01qI1EZWE?rel=0&showinfo=0" frameborder="0" allowfullscreen="allowfullscreen" align="center"></iframe>
10
</div> */ ?>
11
<div class="pipe-review-widget">
12
<?php
13
- echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_csv_import_export'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_csv_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
14
?>
15
</div>
16
<div class="pipe-premium-features">
17
<ul style="font-weight: bold; color:#666; list-style: none; background:#f8f8f8; padding:20px; margin:20px 15px; font-size: 15px; line-height: 26px;">
18
- <li style=""><?php echo __('30 Day Money Back Guarantee','cookie-law-info'); ?></li>
19
- <li style=""><?php echo __('Fast and Superior Support','cookie-law-info'); ?></li>
20
<li style="">
21
- <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'wf_csv_import_export'); ?></a>
22
</li>
23
</ul>
24
<span>
25
<ul class="ticked-list">
26
- <li><?php _e('Export/Import simple, group, external and variation products.', 'wf_csv_import_export');?></li>
27
- <li><?php _e('Export products by category.', 'wf_csv_import_export');?></li>
28
- <li><?php _e('Import/Export product reviews.', 'wf_csv_import_export');?></li>
29
- <li><?php _e('Various filter options for exporting products.', 'wf_csv_import_export');?> </li>
30
- <li><?php _e('Map and transform fields during import.', 'wf_csv_import_export');?></li>
31
- <li><?php _e('Manipulate/evaluate data during import.', 'wf_csv_import_export');?></li>
32
- <li><?php _e('Choice to update or skip existing imported products.', 'wf_csv_import_export');?></li>
33
- <li><?php _e('WPML support for simple products.', 'wf_csv_import_export');?></li>
34
- <li><?php _e('Import/Export file via FTP.', 'wf_csv_import_export');?></li>
35
- <li><?php _e('Import from URL.', 'wf_csv_import_export');?></li>
36
- <li><?php _e('Automatic scheduled import and export.', 'wf_csv_import_export');?></li>
37
- <li><?php _e('Supports product reviews export and import.', 'wf_csv_import_export');?></li>
38
- <li><?php _e('Third party plugin customization support.', 'wf_csv_import_export');?></li>
39
</ul>
40
</span>
41
<center>
42
- <a href="https://www.webtoffee.com/category/documentation/product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'wf_csv_import_export'); ?></a></center>
43
</div>
44
45
</div>
5
?>
6
<div class="market-box table-box-main">
7
<?php /*<div class="getting-started-video">
8
+ <h2><?php _e('Watch getting started video', 'product-import-export-for-woo');?></h2>
9
<iframe src="https://www.youtube.com/embed/L-01qI1EZWE?rel=0&showinfo=0" frameborder="0" allowfullscreen="allowfullscreen" align="center"></iframe>
10
</div> */ ?>
11
<div class="pipe-review-widget">
12
<?php
13
+ echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'product-import-export-for-woo'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'product-import-export-for-woo') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
14
?>
15
</div>
16
<div class="pipe-premium-features">
17
<ul style="font-weight: bold; color:#666; list-style: none; background:#f8f8f8; padding:20px; margin:20px 15px; font-size: 15px; line-height: 26px;">
18
+ <li style=""><?php echo __('30 Day Money Back Guarantee','product-import-export-for-woo'); ?></li>
19
+ <li style=""><?php echo __('Fast and Superior Support','product-import-export-for-woo'); ?></li>
20
<li style="">
21
+ <a href="https://www.webtoffee.com/product/product-import-export-woocommerce/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'product-import-export-for-woo'); ?></a>
22
</li>
23
</ul>
24
<span>
25
<ul class="ticked-list">
26
+ <li><?php _e('Export/Import simple, group, external and variation products.', 'product-import-export-for-woo');?></li>
27
+ <li><?php _e('Export products by category.', 'product-import-export-for-woo');?></li>
28
+ <li><?php _e('Import/Export product reviews.', 'product-import-export-for-woo');?></li>
29
+ <li><?php _e('Various filter options for exporting products.', 'product-import-export-for-woo');?> </li>
30
+ <li><?php _e('Map and transform fields during import.', 'product-import-export-for-woo');?></li>
31
+ <li><?php _e('Manipulate/evaluate data during import.', 'product-import-export-for-woo');?></li>
32
+ <li><?php _e('Choice to update or skip existing imported products.', 'product-import-export-for-woo');?></li>
33
+ <li><?php _e('WPML support for simple products.', 'product-import-export-for-woo');?></li>
34
+ <li><?php _e('Import/Export file via FTP.', 'product-import-export-for-woo');?></li>
35
+ <li><?php _e('Import from URL.', 'product-import-export-for-woo');?></li>
36
+ <li><?php _e('Automatic scheduled import and export.', 'product-import-export-for-woo');?></li>
37
+ <li><?php _e('Supports product reviews export and import.', 'product-import-export-for-woo');?></li>
38
+ <li><?php _e('Third party plugin customization support.', 'product-import-export-for-woo');?></li>
39
</ul>
40
</span>
41
<center>
42
+ <a href="https://www.webtoffee.com/category/documentation/product-import-export-plugin-for-woocommerce/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'product-import-export-for-woo'); ?></a></center>
43
</div>
44
45
</div>
lang/{wf_csv_import_export-de_DE.mo → product-import-export-for-woo-de_DE.mo} RENAMED
File without changes
lang/{wf_csv_import_export-de_DE.po → product-import-export-for-woo-de_DE.po} RENAMED
File without changes
lang/{wf_csv_import_export-fr_FR.mo → product-import-export-for-woo-fr_FR.mo} RENAMED
File without changes
lang/{wf_csv_import_export-fr_FR.po → product-import-export-for-woo-fr_FR.po} RENAMED
File without changes
lang/{wf_csv_import_export-hu_HU.mo → product-import-export-for-woo-hu_HU.mo} RENAMED
File without changes
lang/{wf_csv_import_export-hu_HU.po → product-import-export-for-woo-hu_HU.po} RENAMED
File without changes
lang/{wf_csv_import_export-it_IT.mo → product-import-export-for-woo-it_IT.mo} RENAMED
File without changes
lang/{wf_csv_import_export-it_IT.po → product-import-export-for-woo-it_IT.po} RENAMED
File without changes
product-csv-import-export.php → product-import-export-for-woo.php RENAMED
@@ -5,11 +5,11 @@
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: 1.5.6
9
- WC tested up to: 3.5.6
10
License: GPLv3
11
License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
- Text Domain: wf_csv_import_export
13
*/
14
15
if (!defined('ABSPATH') || !is_admin()) {
@@ -18,7 +18,7 @@ if (!defined('ABSPATH') || !is_admin()) {
18
19
20
if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
- define("WF_PIPE_CURRENT_VERSION", "1.5.6");
22
}
23
if (!defined('WF_PROD_IMP_EXP_ID')) {
24
define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
@@ -80,10 +80,10 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
80
81
public function wf_plugin_action_links($links) {
82
$plugin_links = array(
83
- '<a href="' . admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=export') . '">' . __('Import Export', 'wf_csv_import_export') . '</a>',
84
- '<a target="_blank" href="https://www.webtoffee.com/product/product-import-export-woocommerce/" style="color:#3db634;"> ' . __('Premium Upgrade', 'wf_csv_import_export') . '</a>',
85
- '<a target="_blank" href="https://www.webtoffee.com/support/">' . __('Support', 'wf_csv_import_export') . '</a>',
86
- '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews/">' . __('Review', 'wf_csv_import_export') . '</a>',
87
);
88
if (array_key_exists('deactivate', $links)) {
89
$links['deactivate'] = str_replace('<a', '<a class="pipe-deactivate-link"', $links['deactivate']);
@@ -103,7 +103,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
103
* Handle localization
104
*/
105
public function load_plugin_textdomain() {
106
- load_plugin_textdomain('wf_csv_import_export', false, dirname(plugin_basename(__FILE__)) . '/lang/');
107
}
108
109
/**
@@ -130,7 +130,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
130
* Register importers for use
131
*/
132
public function register_importers() {
133
- register_importer('xa_woocommerce_csv', 'XAdapter WooCommerce Product Import (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'wf_csv_import_export'), 'WF_ProdImpExpCsv_Importer::product_importer');
134
}
135
136
private function hf_user_permission() {
@@ -152,51 +152,51 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
152
$reasons = array(
153
array(
154
'id' => 'used-it',
155
- 'text' => __('Used it successfully. Don\'t need anymore.', 'wf_csv_import_export'),
156
'type' => 'reviewhtml',
157
- 'placeholder' => __('Have used it successfully and aint in need of it anymore', 'wf_csv_import_export')
158
),
159
array(
160
'id' => 'could-not-understand',
161
- 'text' => __('I couldn\'t understand how to make it work', 'wf_csv_import_export'),
162
'type' => 'textarea',
163
- 'placeholder' => __('Would you like us to assist you?', 'wf_csv_import_export')
164
),
165
array(
166
'id' => 'found-better-plugin',
167
- 'text' => __('I found a better plugin', 'wf_csv_import_export'),
168
'type' => 'text',
169
- 'placeholder' => __('Which plugin?', 'wf_csv_import_export')
170
),
171
array(
172
'id' => 'not-have-that-feature',
173
- 'text' => __('The plugin is great, but I need specific feature that you don\'t support', 'wf_csv_import_export'),
174
'type' => 'textarea',
175
- 'placeholder' => __('Could you tell us more about that feature?', 'wf_csv_import_export')
176
),
177
array(
178
'id' => 'is-not-working',
179
- 'text' => __('The plugin is not working', 'wf_csv_import_export'),
180
'type' => 'textarea',
181
- 'placeholder' => __('Could you tell us a bit more whats not working?', 'wf_csv_import_export')
182
),
183
array(
184
'id' => 'looking-for-other',
185
- 'text' => __('It\'s not what I was looking for', 'wf_csv_import_export'),
186
'type' => 'textarea',
187
- 'placeholder' => __('Could you tell us a bit more?', 'wf_csv_import_export')
188
),
189
array(
190
'id' => 'did-not-work-as-expected',
191
- 'text' => __('The plugin didn\'t work as expected', 'wf_csv_import_export'),
192
'type' => 'textarea',
193
- 'placeholder' => __('What did you expect?', 'wf_csv_import_export')
194
),
195
array(
196
'id' => 'other',
197
- 'text' => __('Other', 'wf_csv_import_export'),
198
'type' => 'textarea',
199
- 'placeholder' => __('Could you tell us a bit more?', 'wf_csv_import_export')
200
),
201
);
202
@@ -214,7 +214,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
214
<div class="pipe-modal" id="pipe-pipe-modal">
215
<div class="pipe-modal-wrap">
216
<div class="pipe-modal-header">
217
- <h3><?php _e('If you have a moment, please let us know why you are deactivating:', 'wf_csv_import_export'); ?></h3>
218
</div>
219
<div class="pipe-modal-body">
220
<ul class="reasons">
@@ -226,9 +226,9 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
226
</ul>
227
</div>
228
<div class="pipe-modal-footer">
229
- <a href="#" class="dont-bother-me"><?php _e('I rather wouldn\'t say', 'wf_csv_import_export'); ?></a>
230
- <button class="button-primary pipe-model-submit"><?php _e('Submit & Deactivate', 'wf_csv_import_export'); ?></button>
231
- <button class="button-secondary pipe-model-cancel"><?php _e('Cancel', 'wf_csv_import_export'); ?></button>
232
</div>
233
</div>
234
</div>
@@ -307,7 +307,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
307
var inputType = parent.data('type'),
308
inputPlaceholder = parent.data('placeholder');
309
if ('reviewhtml' === inputType) {
310
- var reasonInputHtml = '<div class="reviewlink"><a href="#" target="_blank" class="review-and-deactivate"><?php _e('Deactivate and leave a review', 'wf_csv_import_export'); ?> <span class="xa-pipe-rating-link"> &#9733;&#9733;&#9733;&#9733;&#9733; </span></a></div>';
311
} else {
312
var reasonInputHtml = '<div class="reason-input">' + (('text' === inputType) ? '<input type="text" class="input-text" size="40" />' : '<textarea rows="5" cols="45"></textarea>') + '</div>';
313
}
@@ -401,8 +401,8 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
401
402
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
403
404
- $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_csv_import_export');
405
- $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_csv_import_export');
406
407
$content = '<style>.webtoffee-storefrog-nav-tab.updated {display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
408
$content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div></div>';
@@ -437,7 +437,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
437
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
438
if (!get_option('pipe_wt_plugin_reviewed')) {
439
$footer_text = sprintf(
440
- __('If you like the plugin please leave us a %1$s review.', 'wf_csv_import_export'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__('Thanks :)', 'wf_csv_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
441
);
442
wc_enqueue_js(
443
"jQuery( 'a.wt-review-link' ).click( function() {
@@ -446,7 +446,7 @@ if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
446
});"
447
);
448
} else {
449
- $footer_text = __('Thank you for your review.', 'xa_woocommerce_csv');
450
}
451
}
452
@@ -480,11 +480,11 @@ register_activation_hook(__FILE__, 'hf_welcome_screen_activate_basic');
480
function hf_welcome_screen_activate_basic() {
481
if(!class_exists( 'WooCommerce' )){
482
deactivate_plugins(basename(__FILE__));
483
- wp_die(__("WooCommerce is not installed/actived. it is required for this plugin to work properly. Please activate WooCommerce.", "wf_csv_import_export"), "", array('back_link' => 1));
484
}
485
- if (is_plugin_active('product-csv-import-export-for-woocommerce/product-csv-import-export.php')) {
486
deactivate_plugins(basename(__FILE__));
487
- wp_die(__("Is everything fine? You already have the Premium version installed in your website. For any issues, kindly raise a ticket via <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>", "wf_csv_import_export"), "", array('back_link' => 1));
488
}
489
update_option('xa_pipe_plugin_installed_date', date('Y-m-d H:i:s'));
490
set_transient('_welcome_screen_activation_redirect', true, 30);
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: 1.5.7
9
+ WC tested up to: 3.5.7
10
License: GPLv3
11
License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
+ Text Domain: product-import-export-for-woo
13
*/
14
15
if (!defined('ABSPATH') || !is_admin()) {
18
19
20
if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
+ define("WF_PIPE_CURRENT_VERSION", "1.5.7");
22
}
23
if (!defined('WF_PROD_IMP_EXP_ID')) {
24
define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
80
81
public function wf_plugin_action_links($links) {
82
$plugin_links = array(
83
+ '<a href="' . admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=export') . '">' . __('Import Export', 'product-import-export-for-woo') . '</a>',
84
+ '<a target="_blank" href="https://www.webtoffee.com/product/product-import-export-woocommerce/" style="color:#3db634;"> ' . __('Premium Upgrade', 'product-import-export-for-woo') . '</a>',
85
+ '<a target="_blank" href="https://www.webtoffee.com/support/">' . __('Support', 'product-import-export-for-woo') . '</a>',
86
+ '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews/">' . __('Review', 'product-import-export-for-woo') . '</a>',
87
);
88
if (array_key_exists('deactivate', $links)) {
89
$links['deactivate'] = str_replace('<a', '<a class="pipe-deactivate-link"', $links['deactivate']);
103
* Handle localization
104
*/
105
public function load_plugin_textdomain() {
106
+ load_plugin_textdomain('product-import-export-for-woo', false, dirname(plugin_basename(__FILE__)) . '/lang/');
107
}
108
109
/**
130
* Register importers for use
131
*/
132
public function register_importers() {
133
+ register_importer('xa_woocommerce_csv', 'WebToffee WooCommerce Product Import (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'product-import-export-for-woo'), 'WF_ProdImpExpCsv_Importer::product_importer');
134
}
135
136
private function hf_user_permission() {
152
$reasons = array(
153
array(
154
'id' => 'used-it',
155
+ 'text' => __('Used it successfully. Don\'t need anymore.', 'product-import-export-for-woo'),
156
'type' => 'reviewhtml',
157
+ 'placeholder' => __('Have used it successfully and aint in need of it anymore', 'product-import-export-for-woo')
158
),
159
array(
160
'id' => 'could-not-understand',
161
+ 'text' => __('I couldn\'t understand how to make it work', 'product-import-export-for-woo'),
162
'type' => 'textarea',
163
+ 'placeholder' => __('Would you like us to assist you?', 'product-import-export-for-woo')
164
),
165
array(
166
'id' => 'found-better-plugin',
167
+ 'text' => __('I found a better plugin', 'product-import-export-for-woo'),
168
'type' => 'text',
169
+ 'placeholder' => __('Which plugin?', 'product-import-export-for-woo')
170
),
171
array(
172
'id' => 'not-have-that-feature',
173
+ 'text' => __('The plugin is great, but I need specific feature that you don\'t support', 'product-import-export-for-woo'),
174
'type' => 'textarea',
175
+ 'placeholder' => __('Could you tell us more about that feature?', 'product-import-export-for-woo')
176
),
177
array(
178
'id' => 'is-not-working',
179
+ 'text' => __('The plugin is not working', 'product-import-export-for-woo'),
180
'type' => 'textarea',
181
+ 'placeholder' => __('Could you tell us a bit more whats not working?', 'product-import-export-for-woo')
182
),
183
array(
184
'id' => 'looking-for-other',
185
+ 'text' => __('It\'s not what I was looking for', 'product-import-export-for-woo'),
186
'type' => 'textarea',
187
+ 'placeholder' => __('Could you tell us a bit more?', 'product-import-export-for-woo')
188
),
189
array(
190
'id' => 'did-not-work-as-expected',
191
+ 'text' => __('The plugin didn\'t work as expected', 'product-import-export-for-woo'),
192
'type' => 'textarea',
193
+ 'placeholder' => __('What did you expect?', 'product-import-export-for-woo')
194
),
195
array(
196
'id' => 'other',
197
+ 'text' => __('Other', 'product-import-export-for-woo'),
198
'type' => 'textarea',
199
+ 'placeholder' => __('Could you tell us a bit more?', 'product-import-export-for-woo')
200
),
201
);
202
214
<div class="pipe-modal" id="pipe-pipe-modal">
215
<div class="pipe-modal-wrap">
216
<div class="pipe-modal-header">
217
+ <h3><?php _e('If you have a moment, please let us know why you are deactivating:', 'product-import-export-for-woo'); ?></h3>
218
</div>
219
<div class="pipe-modal-body">
220
<ul class="reasons">
226
</ul>
227
</div>
228
<div class="pipe-modal-footer">
229
+ <a href="#" class="dont-bother-me"><?php _e('I rather wouldn\'t say', 'product-import-export-for-woo'); ?></a>
230
+ <button class="button-primary pipe-model-submit"><?php _e('Submit & Deactivate', 'product-import-export-for-woo'); ?></button>
231
+ <button class="button-secondary pipe-model-cancel"><?php _e('Cancel', 'product-import-export-for-woo'); ?></button>
232
</div>
233
</div>
234
</div>
307
var inputType = parent.data('type'),
308
inputPlaceholder = parent.data('placeholder');
309
if ('reviewhtml' === inputType) {
310
+ var reasonInputHtml = '<div class="reviewlink"><a href="#" target="_blank" class="review-and-deactivate"><?php _e('Deactivate and leave a review', 'product-import-export-for-woo'); ?> <span class="xa-pipe-rating-link"> &#9733;&#9733;&#9733;&#9733;&#9733; </span></a></div>';
311
} else {
312
var reasonInputHtml = '<div class="reason-input">' + (('text' === inputType) ? '<input type="text" class="input-text" size="40" />' : '<textarea rows="5" cols="45"></textarea>') + '</div>';
313
}
401
402
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
403
404
+ $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'product-import-export-for-woo');
405
+ $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'product-import-export-for-woo');
406
407
$content = '<style>.webtoffee-storefrog-nav-tab.updated {display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
408
$content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_ProdImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div></div>';
437
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
438
if (!get_option('pipe_wt_plugin_reviewed')) {
439
$footer_text = sprintf(
440
+ __('If you like the plugin please leave us a %1$s review.', 'product-import-export-for-woo'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__('Thanks :)', 'product-import-export-for-woo') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
441
);
442
wc_enqueue_js(
443
"jQuery( 'a.wt-review-link' ).click( function() {
446
});"
447
);
448
} else {
449
+ $footer_text = __('Thank you for your review.', 'product-import-export-for-woo');
450
}
451
}
452
480
function hf_welcome_screen_activate_basic() {
481
if(!class_exists( 'WooCommerce' )){
482
deactivate_plugins(basename(__FILE__));
483
+ wp_die(__("WooCommerce is not installed/actived. it is required for this plugin to work properly. Please activate WooCommerce.", 'product-import-export-for-woo'), "", array('back_link' => 1));
484
}
485
+ if (is_plugin_active('product-csv-import-export-for-woocommerce/product-import-export-for-woo.php')) {
486
deactivate_plugins(basename(__FILE__));
487
+ wp_die(__("Is everything fine? You already have the Premium version installed in your website. For any issues, kindly raise a ticket via <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>", 'product-import-export-for-woo'), "", array('back_link' => 1));
488
}
489
update_option('xa_pipe_plugin_installed_date', date('Y-m-d H:i:s'));
490
set_transient('_welcome_screen_activation_redirect', true, 30);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
4
Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce
5
Requires at least: 3.0.1
6
Tested up to: 5.1.1
7
- Stable tag: 1.5.6
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
@@ -20,7 +20,7 @@ Are you trying to import products into WooCommerce store or export WooCommerce p
20
21
&#128312; Export Simple Products in to a CSV file.
22
&#128312; Import Simple Products in CSV format in to WooCommerce Store.
23
- &#128312; Tested OK with WooCommerce 3.5.6.
24
25
26
Highlights: WooCommerce Product Export, WooCommerce Product CSV Import Suite, WooCommerce bulk product upload, WooCommerce import products with images, import amazon products to WooCommerce, Export Products to xls. Pro Version supports both Simple and Variable products.
@@ -148,6 +148,11 @@ LibreOffice.
148
3. Premium Export Settings Screen
149
150
== Changelog ==
151
= 1.5.6 =
152
* Updates: Tested OK with WC 3.5.6 and WP 5.1.1
153
* Bug Fix:- Updating Stock status based on stock quantity.
@@ -291,6 +296,7 @@ LibreOffice.
291
292
== Upgrade Notice ==
293
294
- = 1.5.6 =
295
- * Updates: Tested OK with WC 3.5.6 and WP 5.1.1
296
- * Bug Fix:- Updating Stock status based on stock quantity.
4
Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce
5
Requires at least: 3.0.1
6
Tested up to: 5.1.1
7
+ Stable tag: 1.5.7
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
20
21
&#128312; Export Simple Products in to a CSV file.
22
&#128312; Import Simple Products in CSV format in to WooCommerce Store.
23
+ &#128312; Tested OK with WooCommerce 3.5.7.
24
25
26
Highlights: WooCommerce Product Export, WooCommerce Product CSV Import Suite, WooCommerce bulk product upload, WooCommerce import products with images, import amazon products to WooCommerce, Export Products to xls. Pro Version supports both Simple and Variable products.
148
3. Premium Export Settings Screen
149
150
== Changelog ==
151
+ = 1.5.7 =
152
+ * Updates: Tested OK with WC 3.5.7
153
+ * Bug Fix:- Image import.
154
+ * Support GlotPress(translate.wordpress.org).
155
+
156
= 1.5.6 =
157
* Updates: Tested OK with WC 3.5.6 and WP 5.1.1
158
* Bug Fix:- Updating Stock status based on stock quantity.
296
297
== Upgrade Notice ==
298
299
+ = 1.5.7 =
300
+ * Updates: Tested OK with WC 3.5.7
301
+ * Bug Fix:- Image import.
302
+ * Support GlotPress(translate.wordpress.org).
welcome/welcome.php CHANGED
@@ -33,17 +33,17 @@
33
</style>
34
<div class="wrap postbox main_content">
35
<center>
36
- <h2><?php echo __( 'Welcome to Product Import Export', 'wf_csv_import_export');?></h2>
37
<p>
38
- <?php echo __( 'WooCommerce Product Import Export can be much easier than you expect', 'wf_csv_import_export');?>
39
<br>
40
- <?php echo __( 'Go through our Tutorial video to get an overall idea on how it works.', 'wf_csv_import_export');?>
41
</p>
42
</center>
43
</div>
44
<div class="wrap postbox postbox-custom">
45
<center>
46
- <h2><?php echo __( 'Product Import Export', 'wf_csv_import_export');?></h2>
47
<hr>
48
<div style="margin-bottom:20px !important;">
49
<div class="video_content">
@@ -54,7 +54,7 @@
54
<div>
55
<center>
56
<div style="margin: 5px;;margin-top: 15px !important">
57
- <a class="button button-primary" href="<?php echo admin_url("admin.php?page=wf_woocommerce_csv_im_ex"); ?>" target="_blank"><?php echo __( 'Product Import Export', 'wf_csv_import_export');?></a>
58
</div>
59
</center>
60
</div>
33
</style>
34
<div class="wrap postbox main_content">
35
<center>
36
+ <h2><?php echo __( 'Welcome to Product Import Export', 'product-import-export-for-woo');?></h2>
37
<p>
38
+ <?php echo __( 'WooCommerce Product Import Export can be much easier than you expect', 'product-import-export-for-woo');?>
39
<br>
40
+ <?php echo __( 'Go through our Tutorial video to get an overall idea on how it works.', 'product-import-export-for-woo');?>
41
</p>
42
</center>
43
</div>
44
<div class="wrap postbox postbox-custom">
45
<center>
46
+ <h2><?php echo __( 'Product Import Export', 'product-import-export-for-woo');?></h2>
47
<hr>
48
<div style="margin-bottom:20px !important;">
49
<div class="video_content">
54
<div>
55
<center>
56
<div style="margin: 5px;;margin-top: 15px !important">
57
+ <a class="button button-primary" href="<?php echo admin_url("admin.php?page=wf_woocommerce_csv_im_ex"); ?>" target="_blank"><?php echo __( 'Product Import Export', 'product-import-export-for-woo');?></a>
58
</div>
59
</center>
60
</div>