Version Description
- Tools Updated.
- Help tab added.
- Bug fix: Import of 'download permissions'.
- Bug fix: 2 blank meta columns on coupon export.
- All sample CSVs updated.
- Order date supports formats, 'd-m-y H:i' & 'Y-m-d H:i:s'.
- WC 3.5.4 compatibility.
- Language translation supported.
Download this release
Release Info
Developer | webtoffee |
Plugin | Order Export & Order Import for WooCommerce |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.1
- Sample_Coupon.csv +2 -2
- Sample_Order.csv +4 -4
- Sample_Subscription.csv +3 -3
- includes/class-wf-cpnimpexpcsv-admin-screen.php +6 -2
- includes/class-wf-cpnimpexpcsv-system-status-tools.php +4 -4
- includes/class-wf-orderimpexp-plugin-uninstall-feedback.php +18 -18
- includes/class-wf-orderimpexpcsv-admin-screen.php +16 -8
- includes/class-wf-orderimpexpcsv-system-status-tools.php +40 -10
- includes/exporter/class-wf-cpnimpexpcsv-exporter.php +0 -0
- includes/exporter/class-wf-orderimpexpcsv-exporter.php +0 -26
- includes/exporter/data/data-wf-post-columns-coupon.php +2 -1
- includes/importer/class-wf-cpnimpexpcsv-coupon-import.php +42 -42
- includes/importer/class-wf-csv-parser-coupon.php +9 -9
- includes/importer/class-wf-csv-parser.php +15 -15
- includes/importer/class-wf-orderimpexpcsv-order-import.php +31 -31
- includes/importer/views-coupon/html-wf-import-greeting.php +6 -5
- includes/importer/views-coupon/html-wf-import-options.php +1 -1
- includes/importer/views/html-wf-import-greeting.php +6 -5
- includes/importer/views/html-wf-import-options.php +6 -5
- includes/views/export/html-wf-export-coupons.php +3 -3
- includes/views/export/html-wf-export-orders.php +3 -3
- includes/views/html-wf-admin-screen.php +8 -4
- includes/views/html-wf-getting-started-subscription.php +4 -4
- includes/views/html-wf-help-guide.php +20 -0
- includes/views/import/html-wf-import-coupons.php +4 -4
- includes/views/import/html-wf-import-orders.php +4 -4
- includes/views/market.php +12 -12
- order-import-export.php → order-import-export-for-woocommerce.php +21 -20
- readme.txt +20 -5
- styles/wf-style.css +14 -0
Sample_Coupon.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
post_title,ID,post_excerpt,post_status,post_date,post_author,discount_type,coupon_amount,individual_use,product_ids,exclude_product_ids,usage_limit,usage_limit_per_user,limit_usage_to_x_items,expiry_date,free_shipping,exclude_sale_items,product_categories,exclude_product_categories,minimum_amount,maximum_amount,customer_email
|
2 |
-
coupon1003,502,Not so dummy,publish,
|
1 |
+
post_title,ID,post_excerpt,post_status,post_date,post_author,discount_type,coupon_amount,individual_use,product_ids,exclude_product_ids,usage_limit,usage_limit_per_user,limit_usage_to_x_items,expiry_date,free_shipping,exclude_sale_items,product_categories,exclude_product_categories,minimum_amount,maximum_amount,customer_email,date_expires,usage_count
|
2 |
+
coupon1003,502,Not so dummy,publish,2019-01-28 10:01:21,1,percent_product,57,yes,,,10,10,3,2019-03-28,no,yes,"8,9,6","2,10,7",70,80,"patra@gmail.com, patra@hotmail.com, patra@yahoo.co.in",1553731200,0
|
Sample_Order.csv
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
order_id,order_number,order_date,status,shipping_total,shipping_tax_total,fee_total,fee_tax_total,tax_total,cart_discount,order_discount,discount_total,order_total,refunded_total,order_currency,payment_method,shipping_method,customer_id,customer_user,customer_email,billing_first_name,billing_last_name,billing_company,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,shipping_first_name,shipping_last_name,shipping_company,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,customer_note,shipping_items,fee_items,tax_items,coupon_items,order_notes,download_permissions,line_item_1,line_item_2,line_item_3
|
2 |
-
1001,1001,16-05-2018 07:32,completed,10,1.8,1,0.18,3.42,0,0,0,22.42,0,USD,cod,Express Delivery,3,3,lilly@example.com,Lilly,Gordon,,lilly@example.com,9898989898,20 Maple Avenue,,90731,San Pedro,CA,US,Lilly,Gordon,,20 Maple Avenue,"Door No,16",90731,San Pedro,CA,US,Deliver with a smile!,"item:Items|value:Formal shoe X 1
|
3 |
-
",name:Gift Wrap|total:1.00|tax:0.18,code:GST-1|total:3.42,,Order status changed from Processing to Completed.|Formal shoe (A12) stock reduced from 20 to 19.|Payment to be made upon delivery. Order status changed from Pending payment to Processing.,1,name:Formal shoe
|
4 |
-
1002,1002,16-05-2018 07:25,on-hold,10,1.8,0,0,5.04,0,0,0,33.04,0,USD,paypal,Express Delivery,0,0,,John,Edward,,john@example.com,9999999,300 BOYLSTON AVE E,,98102,Seattle,WA,US,John,Edward,,300 BOYLSTON AVE E,,98102,Seattle,WA,US,,"item:Items|value:Washing machine X 1
|
5 |
",,code:GST-1|total:5.04,,Order status changed from Pending payment to Processing.|Washing machine (A15) stock reduced from 30 to 29.|IPN payment completed,1,name:Washing machine|product_id:616773451|sku:A15|quantity:1|total:18.00|tax:3.24,,
|
6 |
-
1003,1003,16-05-2018 07:21,processing,10,1.8,0,0,8.99,10,10,10,58.98,0,USD,eh_stripe_pay,Express Delivery,2,2,mark@example.com,Mark,Xa,Xadapter,mark@example.com,9898989898,20 Maple Avenue,,90731,San Pedro,CA,US,Mark,Xa,Xadapter,20 Maple Avenue,,90731,San Pedro,CA,US,,"item:Items|value:LED TV X 1, Samsung Galaxy Ace Duos X 1, Men's Cotton T-Shirt - Red X 1
|
7 |
",,code:GST-1|total:8.99,code:flat20|description:Get flat 20% discount on all purchases|amount:10.00,"Order status changed from Pending payment to Processing.|LED TV (A13) stock reduced from 19 to 18.|Samsung Galaxy Ace Duos (A11) stock reduced from 10 to 9.|Men's Cotton T-Shirt - Red (B11V2)<span class=""description""></span> stock reduced from 9 to 8.|Payment Status : Succeeded [ 2018-05-16 12:51:06 ] . Source : Visa( credit ). Charge Status :Captured. Transaction ID : txn_1CSJwcJ91uK4qPibEmTjip6P:is_customer_note",1,name:LED TV|product_id:616773447|sku:A13|quantity:1|total:23.19|tax:4.17,name:Samsung Galaxy Ace Duos|product_id:616773443|sku:A11|quantity:1|total:8.80|tax:1.58,name:Men's Cotton T-Shirt|product_id:616773455|sku:B11V2|quantity:1|total:8.00|color:Red|_variation_id:616773455|tax:1.44
|
1 |
order_id,order_number,order_date,status,shipping_total,shipping_tax_total,fee_total,fee_tax_total,tax_total,cart_discount,order_discount,discount_total,order_total,refunded_total,order_currency,payment_method,shipping_method,customer_id,customer_user,customer_email,billing_first_name,billing_last_name,billing_company,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,shipping_first_name,shipping_last_name,shipping_company,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,customer_note,shipping_items,fee_items,tax_items,coupon_items,order_notes,download_permissions,line_item_1,line_item_2,line_item_3
|
2 |
+
1001,1001,16-05-2018 07:32:06,completed,10,1.8,1,0.18,3.42,0,0,0,22.42,0,USD,cod,Express Delivery,3,3,lilly@example.com,Lilly,Gordon,,lilly@example.com,9898989898,20 Maple Avenue,,90731,San Pedro,CA,US,Lilly,Gordon,,20 Maple Avenue,"Door No,16",90731,San Pedro,CA,US,Deliver with a smile!,"item:Items|value:Formal shoe X 1
|
3 |
+
",name:Gift Wrap|total:1.00|tax:0.18,code:GST-1|total:3.42,,Order status changed from Processing to Completed.|Formal shoe (A12) stock reduced from 20 to 19.|Payment to be made upon delivery. Order status changed from Pending payment to Processing.,1,name:Formal shoe|product_id:13|sku:A12|quantity:1|total:8.00|tax:1.44,,
|
4 |
+
1002,1002,16-05-2018 07:25:28,on-hold,10,1.8,0,0,5.04,0,0,0,33.04,0,USD,paypal,Express Delivery,0,0,,John,Edward,,john@example.com,9999999,300 BOYLSTON AVE E,,98102,Seattle,WA,US,John,Edward,,300 BOYLSTON AVE E,,98102,Seattle,WA,US,,"item:Items|value:Washing machine X 1
|
5 |
",,code:GST-1|total:5.04,,Order status changed from Pending payment to Processing.|Washing machine (A15) stock reduced from 30 to 29.|IPN payment completed,1,name:Washing machine|product_id:616773451|sku:A15|quantity:1|total:18.00|tax:3.24,,
|
6 |
+
1003,1003,16-05-2018 07:21:32,processing,10,1.8,0,0,8.99,10,10,10,58.98,0,USD,eh_stripe_pay,Express Delivery,2,2,mark@example.com,Mark,Xa,Xadapter,mark@example.com,9898989898,20 Maple Avenue,,90731,San Pedro,CA,US,Mark,Xa,Xadapter,20 Maple Avenue,,90731,San Pedro,CA,US,,"item:Items|value:LED TV X 1, Samsung Galaxy Ace Duos X 1, Men's Cotton T-Shirt - Red X 1
|
7 |
",,code:GST-1|total:8.99,code:flat20|description:Get flat 20% discount on all purchases|amount:10.00,"Order status changed from Pending payment to Processing.|LED TV (A13) stock reduced from 19 to 18.|Samsung Galaxy Ace Duos (A11) stock reduced from 10 to 9.|Men's Cotton T-Shirt - Red (B11V2)<span class=""description""></span> stock reduced from 9 to 8.|Payment Status : Succeeded [ 2018-05-16 12:51:06 ] . Source : Visa( credit ). Charge Status :Captured. Transaction ID : txn_1CSJwcJ91uK4qPibEmTjip6P:is_customer_note",1,name:LED TV|product_id:616773447|sku:A13|quantity:1|total:23.19|tax:4.17,name:Samsung Galaxy Ace Duos|product_id:616773443|sku:A11|quantity:1|total:8.80|tax:1.58,name:Men's Cotton T-Shirt|product_id:616773455|sku:B11V2|quantity:1|total:8.00|color:Red|_variation_id:616773455|tax:1.44
|
Sample_Subscription.csv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
subscription_id,subscription_status,customer_id,customer_username,customer_email,start_date,trial_end_date,next_payment_date,last_payment_date,end_date,post_parent,billing_period,billing_interval,order_shipping,order_shipping_tax,fee_total,fee_tax_total,order_tax,cart_discount,cart_discount_tax,order_total,order_currency,payment_method,payment_method_title,payment_method_post_meta,payment_method_user_meta,shipping_method,billing_first_name,billing_last_name,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,billing_company,shipping_first_name,shipping_last_name,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,shipping_company,customer_note,order_items,order_notes,coupon_items,fee_items,tax_items,download_permissions
|
2 |
-
87,wc-active,2,mark,mark@xadapter.com,2016-08-30 07:22:27,2016-09-04 07:22:27,2016-09-04 07:22:27,2016-08-30 07:22:32,2016-12-04 07:22:27,86,month,1,0,0,0,0,0,0,0,9,USD,stripe,Credit card (Stripe),,,,Mark,Wough,mark@xadapter.com,74747474,1st Ave,San Deigo,90001,Naples,AL,US,MarkCO LTD,Steve,Wough,1st Ave,San Deigo,90001,Naples,AL,US,MarkCO LTD,,product_id:10|name:Test Subscription Prdocut|quantity:1|total:9.00|meta:|tax:0.00,Payment received.,Status changed from Pending to Active
|
3 |
-
89,wc-on-hold,9,elvin,elvin@wooforce.com,2016-08-25 19:28:19,2016-08-30 19:28:19,2016-08-30 19:28:19,2016-08-31 06:18:25,2016-11-30 19:28:19,88,month,1,0,0,0,0,0,0,0,9,USD,stripe,Credit card (Stripe),,,,Elvin,j,elvin@xadapter.com,74747474,1st Ave,Naples,90001,Naples,AL,US,MarkCO LTD,Mark,Wough,1st Ave,Naples,90001,Naples,AL,US,ElvinCO LTD,Just checking Elvin Placed the Order,product_id:10|name:Test Subscription Prdocut|quantity:1|total:9.00|meta:|tax:0.00,"Payment failed.;Order <a href=""http://localhost/latestpress/wp-admin/post.php?post=233&action=edit"">#233</a> created to record renewal.;Subscription renewal payment due: Status changed from Active to On hold.;Payment received.;Status changed from Pending to Active.",code:|description:|amount:0.00,,,0
|
1 |
+
subscription_id,subscription_status,customer_id,customer_username,customer_email,start_date,trial_end_date,next_payment_date,last_payment_date,end_date,post_parent,billing_period,billing_interval,order_shipping,order_shipping_tax,fee_total,fee_tax_total,order_tax,cart_discount,cart_discount_tax,order_total,order_currency,payment_method,payment_method_title,payment_method_post_meta,payment_method_user_meta,shipping_method,billing_first_name,billing_last_name,billing_email,billing_phone,billing_address_1,billing_address_2,billing_postcode,billing_city,billing_state,billing_country,billing_company,shipping_first_name,shipping_last_name,shipping_address_1,shipping_address_2,shipping_postcode,shipping_city,shipping_state,shipping_country,shipping_company,customer_note,order_items,order_notes,coupon_items,fee_items,tax_items,download_permissions
|
2 |
+
87,wc-active,2,mark,mark@xadapter.com,2016-08-30 07:22:27,2016-09-04 07:22:27,2016-09-04 07:22:27,2016-08-30 07:22:32,2016-12-04 07:22:27,86,month,1,0,0,0,0,0,0,0,9,USD,stripe,Credit card (Stripe),,,,Mark,Wough,mark@xadapter.com,74747474,1st Ave,San Deigo,90001,Naples,AL,US,MarkCO LTD,Steve,Wough,1st Ave,San Deigo,90001,Naples,AL,US,MarkCO LTD,,product_id:10|name:Test Subscription Prdocut|quantity:1|total:9.00|meta:|tax:0.00,Payment received.,Status changed from Pending to Active.,,,1
|
3 |
+
89,wc-on-hold,9,elvin,elvin@wooforce.com,2016-08-25 19:28:19,2016-08-30 19:28:19,2016-08-30 19:28:19,2016-08-31 06:18:25,2016-11-30 19:28:19,88,month,1,0,0,0,0,0,0,0,9,USD,stripe,Credit card (Stripe),,,,Elvin,j,elvin@xadapter.com,74747474,1st Ave,Naples,90001,Naples,AL,US,MarkCO LTD,Mark,Wough,1st Ave,Naples,90001,Naples,AL,US,ElvinCO LTD,Just checking Elvin Placed the Order,product_id:10|name:Test Subscription Prdocut|quantity:1|total:9.00|meta:|tax:0.00,"Payment failed.;Order <a href=""http://localhost/latestpress/wp-admin/post.php?post=233&action=edit"">#233</a> created to record renewal.;Subscription renewal payment due: Status changed from Active to On hold.;Payment received.;Status changed from Pending to Active.",code:|description:|amount:0.00,,,0
|
includes/class-wf-cpnimpexpcsv-admin-screen.php
CHANGED
@@ -16,13 +16,13 @@ class WF_CpnImpExpCsv_Admin_Screen {
|
|
16 |
public function admin_notices()
|
17 |
{
|
18 |
if ( ! function_exists( 'mb_detect_encoding' ) ) {
|
19 |
-
echo '<div class="error"><p>' . __( 'Coupon 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.', '
|
20 |
}
|
21 |
}
|
22 |
|
23 |
public function admin_menu()
|
24 |
{
|
25 |
-
$page = add_submenu_page( 'woocommerce', __( 'Coupon Im-Ex', '
|
26 |
}
|
27 |
|
28 |
public static function hf_get_wc_path()
|
@@ -37,9 +37,13 @@ class WF_CpnImpExpCsv_Admin_Screen {
|
|
37 |
|
38 |
public function admin_scripts()
|
39 |
{
|
|
|
|
|
|
|
40 |
$wc_path = self::hf_get_wc_path();
|
41 |
wp_enqueue_style( 'woocommerce_admin_styles', $wc_path. '/assets/css/admin.css' );
|
42 |
wp_enqueue_style( 'woocommerce-coupon-csv-importer1', plugins_url( basename( plugin_dir_path( WF_CpnImpExpCsv_FILE ) ) . '/styles/wf-style.css', basename( __FILE__ ) ), '', '1.0.0', 'screen' );
|
|
|
43 |
|
44 |
}
|
45 |
|
16 |
public function admin_notices()
|
17 |
{
|
18 |
if ( ! function_exists( 'mb_detect_encoding' ) ) {
|
19 |
+
echo '<div class="error"><p>' . __( 'Coupon 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.', 'order-import-export-for-woocommerce' ) . '</p></div>';
|
20 |
}
|
21 |
}
|
22 |
|
23 |
public function admin_menu()
|
24 |
{
|
25 |
+
$page = add_submenu_page( 'woocommerce', __( 'Coupon Im-Ex', 'order-import-export-for-woocommerce' ), __( 'Coupon Im-Ex', 'order-import-export-for-woocommerce' ), apply_filters( 'coupon_csv_coupon_role', 'manage_woocommerce' ), 'wf_coupon_csv_im_ex', array( $this, 'output' ) );
|
26 |
}
|
27 |
|
28 |
public static function hf_get_wc_path()
|
37 |
|
38 |
public function admin_scripts()
|
39 |
{
|
40 |
+
$screen = get_current_screen();
|
41 |
+
$allowed_creen_id = array('admin','woocommerce_page_wf_coupon_csv_im_ex');
|
42 |
+
if (in_array($screen->id, $allowed_creen_id)) {
|
43 |
$wc_path = self::hf_get_wc_path();
|
44 |
wp_enqueue_style( 'woocommerce_admin_styles', $wc_path. '/assets/css/admin.css' );
|
45 |
wp_enqueue_style( 'woocommerce-coupon-csv-importer1', plugins_url( basename( plugin_dir_path( WF_CpnImpExpCsv_FILE ) ) . '/styles/wf-style.css', basename( __FILE__ ) ), '', '1.0.0', 'screen' );
|
46 |
+
}
|
47 |
|
48 |
}
|
49 |
|
includes/class-wf-cpnimpexpcsv-system-status-tools.php
CHANGED
@@ -19,9 +19,9 @@ class WF_CpnImpExpCsv_System_Status_Tools {
|
|
19 |
*/
|
20 |
public function tools( $tools ) {
|
21 |
$tools['delete_coupons'] = array(
|
22 |
-
'name' => __( 'Delete Coupons','
|
23 |
-
'button' => __( 'Delete ALL coupons','
|
24 |
-
'desc' => __( 'This tool will delete all coupons allowing you to start fresh.', '
|
25 |
'callback' => array( $this, 'delete_coupons' )
|
26 |
);
|
27 |
|
@@ -46,7 +46,7 @@ class WF_CpnImpExpCsv_System_Status_Tools {
|
|
46 |
WHERE wp.ID IS NULL" );
|
47 |
|
48 |
|
49 |
-
echo '<div class="updated"><p>' . sprintf( __( '%d Coupons Deleted', '
|
50 |
}
|
51 |
|
52 |
|
19 |
*/
|
20 |
public function tools( $tools ) {
|
21 |
$tools['delete_coupons'] = array(
|
22 |
+
'name' => __( 'Delete Coupons','order-import-export-for-woocommerce'),
|
23 |
+
'button' => __( 'Delete ALL coupons','order-import-export-for-woocommerce' ),
|
24 |
+
'desc' => __( 'This tool will delete all coupons allowing you to start fresh.', 'order-import-export-for-woocommerce' ),
|
25 |
'callback' => array( $this, 'delete_coupons' )
|
26 |
);
|
27 |
|
46 |
WHERE wp.ID IS NULL" );
|
47 |
|
48 |
|
49 |
+
echo '<div class="updated"><p>' . sprintf( __( '%d Coupons Deleted', 'order-import-export-for-woocommerce' ), ( $result) ) . '</p></div>';
|
50 |
}
|
51 |
|
52 |
|
includes/class-wf-orderimpexp-plugin-uninstall-feedback.php
CHANGED
@@ -22,45 +22,45 @@ if (!class_exists('WF_OrderImpExp_Uninstall_Feedback')) :
|
|
22 |
),
|
23 |
array(
|
24 |
'id' => 'could-not-understand',
|
25 |
-
'text' => __('I couldn\'t understand how to make it work', '
|
26 |
'type' => 'textarea',
|
27 |
-
'placeholder' => __('Would you like us to assist you?', '
|
28 |
),
|
29 |
array(
|
30 |
'id' => 'found-better-plugin',
|
31 |
-
'text' => __('I found a better plugin', '
|
32 |
'type' => 'text',
|
33 |
-
'placeholder' => __('Which plugin?', '
|
34 |
),
|
35 |
array(
|
36 |
'id' => 'not-have-that-feature',
|
37 |
-
'text' => __('The plugin is great, but I need specific feature that you don\'t support', '
|
38 |
'type' => 'textarea',
|
39 |
-
'placeholder' => __('Could you tell us more about that feature?', '
|
40 |
),
|
41 |
array(
|
42 |
'id' => 'is-not-working',
|
43 |
-
'text' => __('The plugin is not working', '
|
44 |
'type' => 'textarea',
|
45 |
-
'placeholder' => __('Could you tell us a bit more whats not working?', '
|
46 |
),
|
47 |
array(
|
48 |
'id' => 'looking-for-other',
|
49 |
-
'text' => __('It\'s not what I was looking for', '
|
50 |
'type' => 'textarea',
|
51 |
'placeholder' => 'Could you tell us a bit more?'
|
52 |
),
|
53 |
array(
|
54 |
'id' => 'did-not-work-as-expected',
|
55 |
-
'text' => __('The plugin didn\'t work as expected', '
|
56 |
'type' => 'textarea',
|
57 |
-
'placeholder' => __('What did you expect?', '
|
58 |
),
|
59 |
array(
|
60 |
'id' => 'other',
|
61 |
-
'text' => __('Other', '
|
62 |
'type' => 'textarea',
|
63 |
-
'placeholder' => __('Could you tell us a bit more?', '
|
64 |
),
|
65 |
);
|
66 |
|
@@ -78,7 +78,7 @@ if (!class_exists('WF_OrderImpExp_Uninstall_Feedback')) :
|
|
78 |
<div class="wforderimpexp-modal" id="wforderimpexp-wforderimpexp-modal">
|
79 |
<div class="wforderimpexp-modal-wrap">
|
80 |
<div class="wforderimpexp-modal-header">
|
81 |
-
<h3><?php _e('If you have a moment, please let us know why you are deactivating:', '
|
82 |
</div>
|
83 |
<div class="wforderimpexp-modal-body">
|
84 |
<ul class="reasons">
|
@@ -90,9 +90,9 @@ if (!class_exists('WF_OrderImpExp_Uninstall_Feedback')) :
|
|
90 |
</ul>
|
91 |
</div>
|
92 |
<div class="wforderimpexp-modal-footer">
|
93 |
-
<a href="#" class="dont-bother-me"><?php _e('I rather wouldn\'t say', '
|
94 |
-
<button class="button-primary wforderimpexp-model-submit"><?php _e('Submit & Deactivate', '
|
95 |
-
<button class="button-secondary wforderimpexp-model-cancel"><?php _e('Cancel', '
|
96 |
</div>
|
97 |
</div>
|
98 |
</div>
|
@@ -163,7 +163,7 @@ if (!class_exists('WF_OrderImpExp_Uninstall_Feedback')) :
|
|
163 |
var inputType = parent.data('type'),
|
164 |
inputPlaceholder = parent.data('placeholder');
|
165 |
if ('reviewhtml' === inputType) {
|
166 |
-
var reasonInputHtml = '<div class="reviewlink"><a href="#" target="_blank" class="review-and-deactivate"><?php _e('Deactivate and leave a review', '
|
167 |
} else {
|
168 |
var reasonInputHtml = '<div class="reason-input">' + (('text' === inputType) ? '<input type="text" class="input-text" size="40" />' : '<textarea rows="5" cols="45"></textarea>') + '</div>';
|
169 |
}
|
22 |
),
|
23 |
array(
|
24 |
'id' => 'could-not-understand',
|
25 |
+
'text' => __('I couldn\'t understand how to make it work', 'order-import-export-for-woocommerce'),
|
26 |
'type' => 'textarea',
|
27 |
+
'placeholder' => __('Would you like us to assist you?', 'order-import-export-for-woocommerce')
|
28 |
),
|
29 |
array(
|
30 |
'id' => 'found-better-plugin',
|
31 |
+
'text' => __('I found a better plugin', 'order-import-export-for-woocommerce'),
|
32 |
'type' => 'text',
|
33 |
+
'placeholder' => __('Which plugin?', 'order-import-export-for-woocommerce')
|
34 |
),
|
35 |
array(
|
36 |
'id' => 'not-have-that-feature',
|
37 |
+
'text' => __('The plugin is great, but I need specific feature that you don\'t support', 'order-import-export-for-woocommerce'),
|
38 |
'type' => 'textarea',
|
39 |
+
'placeholder' => __('Could you tell us more about that feature?', 'order-import-export-for-woocommerce')
|
40 |
),
|
41 |
array(
|
42 |
'id' => 'is-not-working',
|
43 |
+
'text' => __('The plugin is not working', 'order-import-export-for-woocommerce'),
|
44 |
'type' => 'textarea',
|
45 |
+
'placeholder' => __('Could you tell us a bit more whats not working?', 'order-import-export-for-woocommerce')
|
46 |
),
|
47 |
array(
|
48 |
'id' => 'looking-for-other',
|
49 |
+
'text' => __('It\'s not what I was looking for', 'order-import-export-for-woocommerce'),
|
50 |
'type' => 'textarea',
|
51 |
'placeholder' => 'Could you tell us a bit more?'
|
52 |
),
|
53 |
array(
|
54 |
'id' => 'did-not-work-as-expected',
|
55 |
+
'text' => __('The plugin didn\'t work as expected', 'order-import-export-for-woocommerce'),
|
56 |
'type' => 'textarea',
|
57 |
+
'placeholder' => __('What did you expect?', 'order-import-export-for-woocommerce')
|
58 |
),
|
59 |
array(
|
60 |
'id' => 'other',
|
61 |
+
'text' => __('Other', 'order-import-export-for-woocommerce'),
|
62 |
'type' => 'textarea',
|
63 |
+
'placeholder' => __('Could you tell us a bit more?', 'order-import-export-for-woocommerce')
|
64 |
),
|
65 |
);
|
66 |
|
78 |
<div class="wforderimpexp-modal" id="wforderimpexp-wforderimpexp-modal">
|
79 |
<div class="wforderimpexp-modal-wrap">
|
80 |
<div class="wforderimpexp-modal-header">
|
81 |
+
<h3><?php _e('If you have a moment, please let us know why you are deactivating:', 'order-import-export-for-woocommerce'); ?></h3>
|
82 |
</div>
|
83 |
<div class="wforderimpexp-modal-body">
|
84 |
<ul class="reasons">
|
90 |
</ul>
|
91 |
</div>
|
92 |
<div class="wforderimpexp-modal-footer">
|
93 |
+
<a href="#" class="dont-bother-me"><?php _e('I rather wouldn\'t say', 'order-import-export-for-woocommerce'); ?></a>
|
94 |
+
<button class="button-primary wforderimpexp-model-submit"><?php _e('Submit & Deactivate', 'order-import-export-for-woocommerce'); ?></button>
|
95 |
+
<button class="button-secondary wforderimpexp-model-cancel"><?php _e('Cancel', 'order-import-export-for-woocommerce'); ?></button>
|
96 |
</div>
|
97 |
</div>
|
98 |
</div>
|
163 |
var inputType = parent.data('type'),
|
164 |
inputPlaceholder = parent.data('placeholder');
|
165 |
if ('reviewhtml' === inputType) {
|
166 |
+
var reasonInputHtml = '<div class="reviewlink"><a href="#" target="_blank" class="review-and-deactivate"><?php _e('Deactivate and leave a review', 'order-import-export-for-woocommerce'); ?> <span class="xa-ocsie-rating-link"> ★★★★★ </span></a></div>';
|
167 |
} else {
|
168 |
var reasonInputHtml = '<div class="reason-input">' + (('text' === inputType) ? '<input type="text" class="input-text" size="40" />' : '<textarea rows="5" cols="45"></textarea>') + '</div>';
|
169 |
}
|
includes/class-wf-orderimpexpcsv-admin-screen.php
CHANGED
@@ -19,7 +19,7 @@ class WF_OrderImpExpCsv_Admin_Screen {
|
|
19 |
*/
|
20 |
public function admin_notices() {
|
21 |
if (!function_exists('mb_detect_encoding')) {
|
22 |
-
echo '<div class="error"><p>' . __('Order 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.', '
|
23 |
}
|
24 |
}
|
25 |
|
@@ -27,17 +27,19 @@ class WF_OrderImpExpCsv_Admin_Screen {
|
|
27 |
* Admin Menu
|
28 |
*/
|
29 |
public function admin_menu() {
|
30 |
-
$page = add_submenu_page('woocommerce', __('Order Im-Ex', '
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
* Admin Scripts
|
35 |
*/
|
36 |
public function admin_scripts() {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
@@ -50,6 +52,8 @@ class WF_OrderImpExpCsv_Admin_Screen {
|
|
50 |
$tab = 'export';
|
51 |
}elseif($_GET['tab'] == 'subscription' ) {
|
52 |
$tab = 'subscription';
|
|
|
|
|
53 |
}
|
54 |
}
|
55 |
include( 'views/html-wf-admin-screen.php' );
|
@@ -71,10 +75,14 @@ class WF_OrderImpExpCsv_Admin_Screen {
|
|
71 |
$post_columns = include( 'exporter/data/data-wf-post-columns.php' );
|
72 |
include( 'views/export/html-wf-export-orders.php' );
|
73 |
}
|
74 |
-
|
75 |
-
{
|
76 |
include( 'views/html-wf-getting-started-subscription.php' );
|
77 |
}
|
|
|
|
|
|
|
|
|
78 |
|
79 |
}
|
80 |
|
19 |
*/
|
20 |
public function admin_notices() {
|
21 |
if (!function_exists('mb_detect_encoding')) {
|
22 |
+
echo '<div class="error"><p>' . __('Order 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.', 'order-import-export-for-woocommerce') . '</p></div>';
|
23 |
}
|
24 |
}
|
25 |
|
27 |
* Admin Menu
|
28 |
*/
|
29 |
public function admin_menu() {
|
30 |
+
$page = add_submenu_page('woocommerce', __('Order Im-Ex', 'order-import-export-for-woocommerce'), __('Order Im-Ex', 'order-import-export-for-woocommerce'), apply_filters('woocommerce_csv_order_role', 'manage_woocommerce'), 'wf_woocommerce_order_im_ex', array($this, 'output'));
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
* Admin Scripts
|
35 |
*/
|
36 |
public function admin_scripts() {
|
37 |
+
$screen = get_current_screen();
|
38 |
+
$allowed_creen_id = array('admin','woocommerce_page_wf_woocommerce_order_im_ex');
|
39 |
+
if (in_array($screen->id, $allowed_creen_id)) {
|
40 |
+
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
|
41 |
+
wp_enqueue_style('woocommerce-order-csv-importer', plugins_url(basename(plugin_dir_path(WF_OrderImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
|
42 |
+
}
|
43 |
}
|
44 |
|
45 |
/**
|
52 |
$tab = 'export';
|
53 |
}elseif($_GET['tab'] == 'subscription' ) {
|
54 |
$tab = 'subscription';
|
55 |
+
}elseif ($_GET['tab'] == 'help') {
|
56 |
+
$tab = 'help';
|
57 |
}
|
58 |
}
|
59 |
include( 'views/html-wf-admin-screen.php' );
|
75 |
$post_columns = include( 'exporter/data/data-wf-post-columns.php' );
|
76 |
include( 'views/export/html-wf-export-orders.php' );
|
77 |
}
|
78 |
+
|
79 |
+
public function admin_subscription_page() {
|
80 |
include( 'views/html-wf-getting-started-subscription.php' );
|
81 |
}
|
82 |
+
|
83 |
+
public function admin_help_page(){
|
84 |
+
include('views/html-wf-help-guide.php');
|
85 |
+
}
|
86 |
|
87 |
}
|
88 |
|
includes/class-wf-orderimpexpcsv-system-status-tools.php
CHANGED
@@ -18,18 +18,22 @@ class WF_OrderImpExpCsv_System_Status_Tools {
|
|
18 |
* @return array
|
19 |
*/
|
20 |
public function tools( $tools ) {
|
|
|
21 |
$tools['delete_trashed_orders'] = array(
|
22 |
-
'name' => __( 'Delete Trashed Orders','
|
23 |
-
'button' => __( 'Delete Trashed Orders','
|
24 |
-
'desc' => __( 'This tool will delete all
|
25 |
'callback' => array( $this, 'delete_trashed_orders' )
|
26 |
);
|
|
|
|
|
27 |
$tools['delete_all_orders'] = array(
|
28 |
-
'name' => __( 'Delete Orders','
|
29 |
-
'button' => __( 'Delete ALL Orders','
|
30 |
-
'desc' => __( 'This tool will delete all orders allowing you to start fresh.', '
|
31 |
'callback' => array( $this, 'delete_all_orders' )
|
32 |
);
|
|
|
33 |
return $tools;
|
34 |
}
|
35 |
|
@@ -40,7 +44,23 @@ class WF_OrderImpExpCsv_System_Status_Tools {
|
|
40 |
global $wpdb;
|
41 |
// Delete Trashed Orders
|
42 |
$result = absint( $wpdb->delete( $wpdb->posts, array( 'post_type' => 'shop_order' , 'post_status' => 'trash') ) );
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -52,12 +72,22 @@ class WF_OrderImpExpCsv_System_Status_Tools {
|
|
52 |
// Delete Orders
|
53 |
$result = absint( $wpdb->delete( $wpdb->posts, array( 'post_type' => 'shop_order' ) ) );
|
54 |
|
55 |
-
|
56 |
$wpdb->query( "DELETE pm
|
57 |
FROM {$wpdb->postmeta} pm
|
58 |
LEFT JOIN {$wpdb->posts} wp ON wp.ID = pm.post_id
|
59 |
-
WHERE wp.ID IS NULL" );
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
|
18 |
* @return array
|
19 |
*/
|
20 |
public function tools( $tools ) {
|
21 |
+
if(!isset($tools['delete_trashed_orders'])){
|
22 |
$tools['delete_trashed_orders'] = array(
|
23 |
+
'name' => __( 'Delete Trashed Orders','order-import-export-for-woocommerce'),
|
24 |
+
'button' => __( 'Delete Trashed Orders','order-import-export-for-woocommerce' ),
|
25 |
+
'desc' => __( 'This tool will delete all Trashed Orders.', 'order-import-export-for-woocommerce' ),
|
26 |
'callback' => array( $this, 'delete_trashed_orders' )
|
27 |
);
|
28 |
+
}
|
29 |
+
if(!isset($tools['delete_all_orders'])){
|
30 |
$tools['delete_all_orders'] = array(
|
31 |
+
'name' => __( 'Delete Orders','order-import-export-for-woocommerce'),
|
32 |
+
'button' => __( 'Delete ALL Orders','order-import-export-for-woocommerce' ),
|
33 |
+
'desc' => __( 'This tool will delete all orders allowing you to start fresh.', 'order-import-export-for-woocommerce' ),
|
34 |
'callback' => array( $this, 'delete_all_orders' )
|
35 |
);
|
36 |
+
}
|
37 |
return $tools;
|
38 |
}
|
39 |
|
44 |
global $wpdb;
|
45 |
// Delete Trashed Orders
|
46 |
$result = absint( $wpdb->delete( $wpdb->posts, array( 'post_type' => 'shop_order' , 'post_status' => 'trash') ) );
|
47 |
+
|
48 |
+
// Delete meta and term relationships with no post
|
49 |
+
$wpdb->query( "DELETE pm
|
50 |
+
FROM {$wpdb->postmeta} pm
|
51 |
+
LEFT JOIN {$wpdb->posts} wp ON wp.ID = pm.post_id
|
52 |
+
WHERE wp.ID IS NULL" );
|
53 |
+
// Delete order items with no post
|
54 |
+
$wpdb->query( "DELETE oi
|
55 |
+
FROM {$wpdb->prefix}woocommerce_order_items oi
|
56 |
+
LEFT JOIN {$wpdb->posts} wp ON wp.ID = oi.order_id
|
57 |
+
WHERE wp.ID IS NULL" );
|
58 |
+
// Delete order item meta with no post
|
59 |
+
$wpdb->query( "DELETE om
|
60 |
+
FROM {$wpdb->prefix}woocommerce_order_itemmeta om
|
61 |
+
LEFT JOIN {$wpdb->prefix}woocommerce_order_items oi ON oi.order_item_id = om.order_item_id
|
62 |
+
WHERE oi.order_item_id IS NULL" );
|
63 |
+
echo '<div class="updated"><p>' . sprintf( __( '%d Orders Deleted', 'order-import-export-for-woocommerce' ), ( $result ) ) . '</p></div>';
|
64 |
}
|
65 |
|
66 |
/**
|
72 |
// Delete Orders
|
73 |
$result = absint( $wpdb->delete( $wpdb->posts, array( 'post_type' => 'shop_order' ) ) );
|
74 |
|
75 |
+
// Delete meta and term relationships with no post
|
76 |
$wpdb->query( "DELETE pm
|
77 |
FROM {$wpdb->postmeta} pm
|
78 |
LEFT JOIN {$wpdb->posts} wp ON wp.ID = pm.post_id
|
79 |
+
WHERE wp.ID IS NULL" );
|
80 |
+
// Delete order items with no post
|
81 |
+
$wpdb->query( "DELETE oi
|
82 |
+
FROM {$wpdb->prefix}woocommerce_order_items oi
|
83 |
+
LEFT JOIN {$wpdb->posts} wp ON wp.ID = oi.order_id
|
84 |
+
WHERE wp.ID IS NULL" );
|
85 |
+
// Delete order item meta with no post
|
86 |
+
$wpdb->query( "DELETE om
|
87 |
+
FROM {$wpdb->prefix}woocommerce_order_itemmeta om
|
88 |
+
LEFT JOIN {$wpdb->prefix}woocommerce_order_items oi ON oi.order_item_id = om.order_item_id
|
89 |
+
WHERE oi.order_item_id IS NULL" );
|
90 |
+
echo '<div class="updated"><p>' . sprintf( __( '%d Orders Deleted', 'order-import-export-for-woocommerce' ), $result ) . '</p></div>';
|
91 |
}
|
92 |
}
|
93 |
|
includes/exporter/class-wf-cpnimpexpcsv-exporter.php
CHANGED
File without changes
|
includes/exporter/class-wf-orderimpexpcsv-exporter.php
CHANGED
@@ -138,33 +138,7 @@ class WF_OrderImpExpCsv_Exporter {
|
|
138 |
if (!is_object($product)) {
|
139 |
$product = new WC_Product(0);
|
140 |
}
|
141 |
-
/*
|
142 |
-
if(WC()->version < '3.1.0'){
|
143 |
-
$item_meta = new WC_Order_Item_Meta((defined('WC_VERSION') >= 2.4) ? $item : $item['item_meta'] );
|
144 |
-
$meta = $item_meta->display(true, true);
|
145 |
-
}else{
|
146 |
-
$arg = array(
|
147 |
-
'before' => '',
|
148 |
-
'after' => '',
|
149 |
-
'separator' => ',',
|
150 |
-
'echo' => false,
|
151 |
-
);
|
152 |
-
|
153 |
-
$meta = wc_display_item_meta( $item,$arg );
|
154 |
-
}
|
155 |
|
156 |
-
if ($meta) {
|
157 |
-
|
158 |
-
|
159 |
-
// remove newlines
|
160 |
-
$meta = str_replace(array("\r", "\r\n", "\n"), '', $meta);
|
161 |
-
$meta = str_replace(array('<strong class="wc-item-meta-label">', '</strong> <p>', "</p>"), '', $meta);
|
162 |
-
|
163 |
-
// switch reserved chars (:;|) to =
|
164 |
-
$meta = str_replace(array(': ', ':', ';', '|'), '=', $meta);
|
165 |
-
$meta = str_replace( 'meta=', '', $meta);
|
166 |
-
}
|
167 |
-
*/
|
168 |
$line_item = array(
|
169 |
'name' => html_entity_decode($product->get_title() ? $product->get_title() : $item['name'], ENT_NOQUOTES, 'UTF-8'),
|
170 |
'product_id' => (WC()->version < '2.7.0')?$product->id:$product->get_id(),
|
138 |
if (!is_object($product)) {
|
139 |
$product = new WC_Product(0);
|
140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
$line_item = array(
|
143 |
'name' => html_entity_decode($product->get_title() ? $product->get_title() : $item['name'], ENT_NOQUOTES, 'UTF-8'),
|
144 |
'product_id' => (WC()->version < '2.7.0')?$product->id:$product->get_id(),
|
includes/exporter/data/data-wf-post-columns-coupon.php
CHANGED
@@ -28,5 +28,6 @@ return apply_filters('coupon_csv_coupon_post_columns', array(
|
|
28 |
'minimum_amount' => 'minimum_amount',
|
29 |
'maximum_amount' => 'maximum_amount',
|
30 |
'customer_email' => 'customer_email',
|
31 |
-
|
|
|
32 |
) );
|
28 |
'minimum_amount' => 'minimum_amount',
|
29 |
'maximum_amount' => 'maximum_amount',
|
30 |
'customer_email' => 'customer_email',
|
31 |
+
'date_expires' => 'date_expires',
|
32 |
+
'usage_count' => 'usage_count',
|
33 |
) );
|
includes/importer/class-wf-cpnimpexpcsv-coupon-import.php
CHANGED
@@ -92,7 +92,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
92 |
if ( !empty($_GET['clearmapping']) || $this->handle_upload() )
|
93 |
$this->import_options();
|
94 |
else
|
95 |
-
//_e( 'Error with handle_upload!', '
|
96 |
wp_redirect(wp_get_referer().'&wf_coupon_ie_msg=3');
|
97 |
exit;
|
98 |
break;
|
@@ -119,10 +119,10 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
119 |
<thead>
|
120 |
<tr>
|
121 |
<th class="status"> </th>
|
122 |
-
<th class="row"><?php _e( 'Row', '
|
123 |
-
<th><?php _e( 'Coupon Id', '
|
124 |
-
<th><?php _e( 'Coupon Name', '
|
125 |
-
<th class="reason"><?php _e( 'Status Msg', '
|
126 |
</tr>
|
127 |
</thead>
|
128 |
<tfoot>
|
@@ -215,7 +215,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
215 |
} catch(err) {}
|
216 |
|
217 |
} else {
|
218 |
-
$('#import-progress tbody').append( '<tr class="error"><td class="status" colspan="5">' + '<?php _e( 'AJAX Error', '
|
219 |
}
|
220 |
|
221 |
var w = $(window);
|
@@ -315,12 +315,12 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
315 |
if ( response !== Object( response ) || ( typeof response.success === "undefined" && typeof response.error === "undefined" ) ) {
|
316 |
response = new Object;
|
317 |
response.success = false;
|
318 |
-
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.', '
|
319 |
}
|
320 |
|
321 |
regen_count ++;
|
322 |
|
323 |
-
$('#import-progress tbody .regenerating .progress').css( 'width', ( ( regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js( __( 'thumbnails regenerated', '
|
324 |
|
325 |
if ( ! response.success ) {
|
326 |
$('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
|
@@ -358,7 +358,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
358 |
</script>
|
359 |
<?php
|
360 |
} else {
|
361 |
-
echo '<p class="error">' . __( 'Error finding uploaded file!', '
|
362 |
}
|
363 |
break;
|
364 |
case 3 :
|
@@ -429,19 +429,19 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
429 |
$this->crosssell_skus = isset( $_POST['crosssell_skus']) ? array_filter( (array) $_POST['crosssell_skus'] ) : array();
|
430 |
$this->upsell_skus = isset( $_POST['upsell_skus']) ? array_filter( (array) $_POST['upsell_skus'] ) : array();
|
431 |
|
432 |
-
_e( 'Step 1...', '
|
433 |
|
434 |
wp_defer_term_counting( true );
|
435 |
wp_defer_comment_counting( true );
|
436 |
|
437 |
-
_e( 'Step 2...', '
|
438 |
|
439 |
echo 'Step 3...' . ' '; // Easter egg
|
440 |
-
_e( 'Finalizing...', '
|
441 |
|
442 |
|
443 |
// SUCCESS
|
444 |
-
_e( 'Finished. Import complete.', '
|
445 |
|
446 |
$this->import_end();
|
447 |
exit;
|
@@ -515,7 +515,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
515 |
{
|
516 |
$reset_action = 'admin.php?clearmapping=1&profile='.$this->profile.'&import=' . $this->import_page . '&step=1&merge=' . ( ! empty( $_GET['merge'] ) ? 1 : 0 ) . '&file_url=' . $this->file_url . '&delimiter=' . $this->delimiter . '&merge_empty_cells=' . $this->merge_empty_cells . '&file_id=' . $this->id . '';
|
517 |
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
|
518 |
-
echo '<h3>' . __( 'Columns are pre-selected using the Mapping file: "<b style="color:gray">'.$this->profile.'</b>". <a href="'.$reset_action.'"> Delete</a> this mapping file.', '
|
519 |
$saved_mapping = $mapping_from_db[0];
|
520 |
$saved_evaluation = $mapping_from_db[1];
|
521 |
}
|
@@ -534,7 +534,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
534 |
wp_suspend_cache_invalidation( true );
|
535 |
|
536 |
$this->hf_coupon_log_data_change( 'coupon-csv-import', '---' );
|
537 |
-
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Processing coupons.', '
|
538 |
foreach ( $this->parsed_data as $key => &$item )
|
539 |
{
|
540 |
$coupon = $this->parser->parse_coupon( $item, $this->merge_empty_cells );
|
@@ -545,7 +545,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
545 |
|
546 |
unset( $item, $coupon );
|
547 |
}
|
548 |
-
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Finished processing coupons.', '
|
549 |
wp_suspend_cache_invalidation( false );
|
550 |
}
|
551 |
|
@@ -561,11 +561,11 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
561 |
$wp_memory = size_format( (WC()->version < '2.7.0')? woocommerce_let_to_num( WP_MEMORY_LIMIT ) : wc_let_to_num( WP_MEMORY_LIMIT ) );
|
562 |
|
563 |
$this->hf_coupon_log_data_change( 'coupon-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory );
|
564 |
-
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Parsing coupons CSV.', '
|
565 |
|
566 |
$this->parser = new WF_CSV_Parser_Coupon( 'shop_coupon' );
|
567 |
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data( $file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field );
|
568 |
-
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Finished parsing coupons CSV.', '
|
569 |
|
570 |
unset( $import_data );
|
571 |
|
@@ -598,7 +598,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
598 |
$file = wp_import_handle_upload();
|
599 |
|
600 |
if ( isset( $file['error'] ) ) {
|
601 |
-
echo '<p><strong>' . __( 'Sorry, there has been an error.', '
|
602 |
echo esc_html( $file['error'] ) . '</p>';
|
603 |
return false;
|
604 |
}
|
@@ -613,7 +613,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
613 |
$this->file_url = esc_attr( $_POST['file_url'] );
|
614 |
return true;
|
615 |
} else {
|
616 |
-
echo '<p><strong>' . __( 'Sorry, there has been an error.', '
|
617 |
return false;
|
618 |
}
|
619 |
|
@@ -672,15 +672,15 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
672 |
|
673 |
|
674 |
if (!empty($processing_coupon_id) && isset($this->processed_posts[$processing_coupon_id])) {
|
675 |
-
$this->add_import_result('skipped', __('Coupon already processed', '
|
676 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Coupon ID already processed. Skipping.', '
|
677 |
unset($post);
|
678 |
return;
|
679 |
}
|
680 |
|
681 |
if (!empty($post['post_status']) && $post['post_status'] == 'auto-draft') {
|
682 |
-
$this->add_import_result('skipped', __('Skipping auto-draft', '
|
683 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Skipping auto-draft.', '
|
684 |
unset($post);
|
685 |
return;
|
686 |
}
|
@@ -691,15 +691,15 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
691 |
} else {
|
692 |
$usr_msg = 'Coupon already exists.';
|
693 |
}
|
694 |
-
$this->add_import_result('skipped', __($usr_msg, '
|
695 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s”' . $usr_msg, '
|
696 |
unset($post);
|
697 |
return;
|
698 |
}
|
699 |
|
700 |
if ($processing_coupon_id && is_string(get_post_status($processing_coupon_id))) {
|
701 |
-
$this->add_import_result('skipped', __('Importing coupon ID conflicts with an existing coupon ID', '
|
702 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s” ID already exists.', '
|
703 |
unset($post);
|
704 |
return;
|
705 |
}
|
@@ -708,8 +708,8 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
708 |
$is_post_exist_in_db = get_post_type($processing_coupon_id);
|
709 |
|
710 |
if ($merging && $processing_coupon_id && !empty($is_post_exist_in_db) && (get_post_type($processing_coupon_id) !== $post['post_type'] )) {
|
711 |
-
$this->add_import_result('skipped', __('Post is not a coupon', '
|
712 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s” is not a coupon.', '
|
713 |
|
714 |
unset($post);
|
715 |
return;
|
@@ -718,7 +718,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
718 |
if ($merging && !empty($is_post_exist_in_db)) {
|
719 |
$post_id = $processing_coupon_id;
|
720 |
|
721 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Merging coupon ID %s.', '
|
722 |
|
723 |
$postdata = array(
|
724 |
'ID' => $post_id
|
@@ -764,18 +764,18 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
764 |
$result = wp_update_post($postdata);
|
765 |
|
766 |
if (!$result) {
|
767 |
-
$this->add_import_result('failed', __('Failed to update coupon', '
|
768 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Failed to update coupon %s', '
|
769 |
unset($post);
|
770 |
return;
|
771 |
} else {
|
772 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Merged post data: ', '
|
773 |
}
|
774 |
}
|
775 |
} else {
|
776 |
$merging = FALSE;
|
777 |
|
778 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Inserting %s', '
|
779 |
$postdata = array(
|
780 |
'post_author' => (isset($post['post_author']) && !empty($post['post_author'])) ? absint($post['post_author']) : get_current_user_id(),
|
781 |
'post_date' => (isset($post['post_date']) && !empty($post['post_date'])) ? date('Y-m-d H:i:s', strtotime($post['post_date'])) : '',
|
@@ -792,13 +792,13 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
792 |
|
793 |
if (is_wp_error($post_id)) {
|
794 |
|
795 |
-
$this->add_import_result('failed', __('Failed to import coupon', '
|
796 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('Failed to import coupon “%s”', '
|
797 |
unset($post);
|
798 |
return;
|
799 |
} else {
|
800 |
|
801 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Inserted - coupon ID is %s.', '
|
802 |
}
|
803 |
}
|
804 |
|
@@ -830,10 +830,10 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
830 |
}
|
831 |
if ($merging) {
|
832 |
$this->add_import_result('merged', 'Coupon Merge successful', $post_id, $processing_coupon_title);
|
833 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Finished merging post ID %s.', '
|
834 |
} else {
|
835 |
$this->add_import_result('imported', 'Coupon Import successful', $post_id, $processing_coupon_title);
|
836 |
-
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Finished importing post ID %s.', '
|
837 |
}
|
838 |
unset($post);
|
839 |
}
|
@@ -907,7 +907,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
907 |
if ( 0 == $filesize ) {
|
908 |
@unlink( $upload['file'] );
|
909 |
unset( $upload );
|
910 |
-
return new WP_Error( 'import_file_error', __('Zero size file downloaded', '
|
911 |
}
|
912 |
|
913 |
unset( $response );
|
@@ -980,7 +980,7 @@ class WF_CpnImpExpCsv_Coupon_Import extends WP_Importer {
|
|
980 |
// Display import page title
|
981 |
public function header() {
|
982 |
echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
983 |
-
echo '<h2>' . ( empty( $_GET['merge'] ) ? __( 'Import', '
|
984 |
}
|
985 |
|
986 |
// Close div.wrap
|
92 |
if ( !empty($_GET['clearmapping']) || $this->handle_upload() )
|
93 |
$this->import_options();
|
94 |
else
|
95 |
+
//_e( 'Error with handle_upload!', 'order-import-export-for-woocommerce' );
|
96 |
wp_redirect(wp_get_referer().'&wf_coupon_ie_msg=3');
|
97 |
exit;
|
98 |
break;
|
119 |
<thead>
|
120 |
<tr>
|
121 |
<th class="status"> </th>
|
122 |
+
<th class="row"><?php _e( 'Row', 'order-import-export-for-woocommerce' ); ?></th>
|
123 |
+
<th><?php _e( 'Coupon Id', 'order-import-export-for-woocommerce' ); ?></th>
|
124 |
+
<th><?php _e( 'Coupon Name', 'order-import-export-for-woocommerce' ); ?></th>
|
125 |
+
<th class="reason"><?php _e( 'Status Msg', 'order-import-export-for-woocommerce' ); ?></th>
|
126 |
</tr>
|
127 |
</thead>
|
128 |
<tfoot>
|
215 |
} catch(err) {}
|
216 |
|
217 |
} else {
|
218 |
+
$('#import-progress tbody').append( '<tr class="error"><td class="status" colspan="5">' + '<?php _e( 'AJAX Error', 'order-import-export-for-woocommerce' ); ?>' + '</td></tr>' );
|
219 |
}
|
220 |
|
221 |
var w = $(window);
|
315 |
if ( response !== Object( response ) || ( typeof response.success === "undefined" && typeof response.error === "undefined" ) ) {
|
316 |
response = new Object;
|
317 |
response.success = false;
|
318 |
+
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.', 'order-import-export-for-woocommerce' ) ), '" + id + "' ); ?>";
|
319 |
}
|
320 |
|
321 |
regen_count ++;
|
322 |
|
323 |
+
$('#import-progress tbody .regenerating .progress').css( 'width', ( ( regen_count / attachments.length ) * 100 ) + '%' ).html( regen_count + ' / ' + attachments.length + ' <?php echo esc_js( __( 'thumbnails regenerated', 'order-import-export-for-woocommerce' ) ); ?>' );
|
324 |
|
325 |
if ( ! response.success ) {
|
326 |
$('#import-progress tbody').append( '<tr><td colspan="5">' + response.error + '</td></tr>' );
|
358 |
</script>
|
359 |
<?php
|
360 |
} else {
|
361 |
+
echo '<p class="error">' . __( 'Error finding uploaded file!', 'order-import-export-for-woocommerce' ) . '</p>';
|
362 |
}
|
363 |
break;
|
364 |
case 3 :
|
429 |
$this->crosssell_skus = isset( $_POST['crosssell_skus']) ? array_filter( (array) $_POST['crosssell_skus'] ) : array();
|
430 |
$this->upsell_skus = isset( $_POST['upsell_skus']) ? array_filter( (array) $_POST['upsell_skus'] ) : array();
|
431 |
|
432 |
+
_e( 'Step 1...', 'order-import-export-for-woocommerce' ) . ' ';
|
433 |
|
434 |
wp_defer_term_counting( true );
|
435 |
wp_defer_comment_counting( true );
|
436 |
|
437 |
+
_e( 'Step 2...', 'order-import-export-for-woocommerce' ) . ' ';
|
438 |
|
439 |
echo 'Step 3...' . ' '; // Easter egg
|
440 |
+
_e( 'Finalizing...', 'order-import-export-for-woocommerce' ) . ' ';
|
441 |
|
442 |
|
443 |
// SUCCESS
|
444 |
+
_e( 'Finished. Import complete.', 'order-import-export-for-woocommerce' );
|
445 |
|
446 |
$this->import_end();
|
447 |
exit;
|
515 |
{
|
516 |
$reset_action = 'admin.php?clearmapping=1&profile='.$this->profile.'&import=' . $this->import_page . '&step=1&merge=' . ( ! empty( $_GET['merge'] ) ? 1 : 0 ) . '&file_url=' . $this->file_url . '&delimiter=' . $this->delimiter . '&merge_empty_cells=' . $this->merge_empty_cells . '&file_id=' . $this->id . '';
|
517 |
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
|
518 |
+
echo '<h3>' . __( 'Columns are pre-selected using the Mapping file: "<b style="color:gray">'.$this->profile.'</b>". <a href="'.$reset_action.'"> Delete</a> this mapping file.', 'order-import-export-for-woocommerce' ) . '</h3>';
|
519 |
$saved_mapping = $mapping_from_db[0];
|
520 |
$saved_evaluation = $mapping_from_db[1];
|
521 |
}
|
534 |
wp_suspend_cache_invalidation( true );
|
535 |
|
536 |
$this->hf_coupon_log_data_change( 'coupon-csv-import', '---' );
|
537 |
+
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Processing coupons.', 'order-import-export-for-woocommerce' ) );
|
538 |
foreach ( $this->parsed_data as $key => &$item )
|
539 |
{
|
540 |
$coupon = $this->parser->parse_coupon( $item, $this->merge_empty_cells );
|
545 |
|
546 |
unset( $item, $coupon );
|
547 |
}
|
548 |
+
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Finished processing coupons.', 'order-import-export-for-woocommerce' ) );
|
549 |
wp_suspend_cache_invalidation( false );
|
550 |
}
|
551 |
|
561 |
$wp_memory = size_format( (WC()->version < '2.7.0')? woocommerce_let_to_num( WP_MEMORY_LIMIT ) : wc_let_to_num( WP_MEMORY_LIMIT ) );
|
562 |
|
563 |
$this->hf_coupon_log_data_change( 'coupon-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory );
|
564 |
+
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Parsing coupons CSV.', 'order-import-export-for-woocommerce' ) );
|
565 |
|
566 |
$this->parser = new WF_CSV_Parser_Coupon( 'shop_coupon' );
|
567 |
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data( $file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field );
|
568 |
+
$this->hf_coupon_log_data_change( 'coupon-csv-import', __( 'Finished parsing coupons CSV.', 'order-import-export-for-woocommerce' ) );
|
569 |
|
570 |
unset( $import_data );
|
571 |
|
598 |
$file = wp_import_handle_upload();
|
599 |
|
600 |
if ( isset( $file['error'] ) ) {
|
601 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'order-import-export-for-woocommerce' ) . '</strong><br />';
|
602 |
echo esc_html( $file['error'] ) . '</p>';
|
603 |
return false;
|
604 |
}
|
613 |
$this->file_url = esc_attr( $_POST['file_url'] );
|
614 |
return true;
|
615 |
} else {
|
616 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'order-import-export-for-woocommerce' ) . '</strong></p>';
|
617 |
return false;
|
618 |
}
|
619 |
|
672 |
|
673 |
|
674 |
if (!empty($processing_coupon_id) && isset($this->processed_posts[$processing_coupon_id])) {
|
675 |
+
$this->add_import_result('skipped', __('Coupon already processed', 'order-import-export-for-woocommerce'), $processing_coupon_id, $processing_coupon_title);
|
676 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Coupon ID already processed. Skipping.', 'order-import-export-for-woocommerce'), true);
|
677 |
unset($post);
|
678 |
return;
|
679 |
}
|
680 |
|
681 |
if (!empty($post['post_status']) && $post['post_status'] == 'auto-draft') {
|
682 |
+
$this->add_import_result('skipped', __('Skipping auto-draft', 'order-import-export-for-woocommerce'), $processing_coupon_id, $processing_coupon_title);
|
683 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Skipping auto-draft.', 'order-import-export-for-woocommerce'), true);
|
684 |
unset($post);
|
685 |
return;
|
686 |
}
|
691 |
} else {
|
692 |
$usr_msg = 'Coupon already exists.';
|
693 |
}
|
694 |
+
$this->add_import_result('skipped', __($usr_msg, 'order-import-export-for-woocommerce'), $processing_coupon_id, $processing_coupon_title);
|
695 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s”' . $usr_msg, 'order-import-export-for-woocommerce'), esc_html($processing_coupon_title)), true);
|
696 |
unset($post);
|
697 |
return;
|
698 |
}
|
699 |
|
700 |
if ($processing_coupon_id && is_string(get_post_status($processing_coupon_id))) {
|
701 |
+
$this->add_import_result('skipped', __('Importing coupon ID conflicts with an existing coupon ID', 'order-import-export-for-woocommerce'), $processing_coupon_id, get_the_title($processing_coupon_id));
|
702 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s” ID already exists.', 'order-import-export-for-woocommerce'), esc_html($processing_coupon_id)), true);
|
703 |
unset($post);
|
704 |
return;
|
705 |
}
|
708 |
$is_post_exist_in_db = get_post_type($processing_coupon_id);
|
709 |
|
710 |
if ($merging && $processing_coupon_id && !empty($is_post_exist_in_db) && (get_post_type($processing_coupon_id) !== $post['post_type'] )) {
|
711 |
+
$this->add_import_result('skipped', __('Post is not a coupon', 'order-import-export-for-woocommerce'), $processing_coupon_id, $processing_coupon_title);
|
712 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> “%s” is not a coupon.', 'order-import-export-for-woocommerce'), esc_html($processing_coupon_id)), true);
|
713 |
|
714 |
unset($post);
|
715 |
return;
|
718 |
if ($merging && !empty($is_post_exist_in_db)) {
|
719 |
$post_id = $processing_coupon_id;
|
720 |
|
721 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Merging coupon ID %s.', 'order-import-export-for-woocommerce'), $post_id), true);
|
722 |
|
723 |
$postdata = array(
|
724 |
'ID' => $post_id
|
764 |
$result = wp_update_post($postdata);
|
765 |
|
766 |
if (!$result) {
|
767 |
+
$this->add_import_result('failed', __('Failed to update coupon', 'order-import-export-for-woocommerce'), $post_id, $processing_coupon_title);
|
768 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Failed to update coupon %s', 'order-import-export-for-woocommerce'), $post_id), true);
|
769 |
unset($post);
|
770 |
return;
|
771 |
} else {
|
772 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', __('> Merged post data: ', 'order-import-export-for-woocommerce') . print_r($postdata, true));
|
773 |
}
|
774 |
}
|
775 |
} else {
|
776 |
$merging = FALSE;
|
777 |
|
778 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Inserting %s', 'order-import-export-for-woocommerce'), esc_html($processing_coupon_title)), true);
|
779 |
$postdata = array(
|
780 |
'post_author' => (isset($post['post_author']) && !empty($post['post_author'])) ? absint($post['post_author']) : get_current_user_id(),
|
781 |
'post_date' => (isset($post['post_date']) && !empty($post['post_date'])) ? date('Y-m-d H:i:s', strtotime($post['post_date'])) : '',
|
792 |
|
793 |
if (is_wp_error($post_id)) {
|
794 |
|
795 |
+
$this->add_import_result('failed', __('Failed to import coupon', 'order-import-export-for-woocommerce'), $processing_coupon_id, $processing_coupon_title);
|
796 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('Failed to import coupon “%s”', 'order-import-export-for-woocommerce'), esc_html($processing_coupon_title)));
|
797 |
unset($post);
|
798 |
return;
|
799 |
} else {
|
800 |
|
801 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Inserted - coupon ID is %s.', 'order-import-export-for-woocommerce'), $post_id));
|
802 |
}
|
803 |
}
|
804 |
|
830 |
}
|
831 |
if ($merging) {
|
832 |
$this->add_import_result('merged', 'Coupon Merge successful', $post_id, $processing_coupon_title);
|
833 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Finished merging post ID %s.', 'order-import-export-for-woocommerce'), $post_id));
|
834 |
} else {
|
835 |
$this->add_import_result('imported', 'Coupon Import successful', $post_id, $processing_coupon_title);
|
836 |
+
$this->hf_coupon_log_data_change('coupon-csv-import', sprintf(__('> Finished importing post ID %s.', 'order-import-export-for-woocommerce'), $post_id));
|
837 |
}
|
838 |
unset($post);
|
839 |
}
|
907 |
if ( 0 == $filesize ) {
|
908 |
@unlink( $upload['file'] );
|
909 |
unset( $upload );
|
910 |
+
return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'order-import-export-for-woocommerce') );
|
911 |
}
|
912 |
|
913 |
unset( $response );
|
980 |
// Display import page title
|
981 |
public function header() {
|
982 |
echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
983 |
+
echo '<h2>' . ( empty( $_GET['merge'] ) ? __( 'Import', 'order-import-export-for-woocommerce' ) : __( 'Merge Coupons', 'order-import-export-for-woocommerce' ) ) . '</h2>';
|
984 |
}
|
985 |
|
986 |
// Close div.wrap
|
includes/importer/class-wf-csv-parser-coupon.php
CHANGED
@@ -119,10 +119,10 @@ class WF_CSV_Parser_Coupon {
|
|
119 |
if ( $merging )
|
120 |
{
|
121 |
$product['merging'] = true;
|
122 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf( __('> Row %s - preparing for merge.', '
|
123 |
if ( ! $post_id )
|
124 |
{
|
125 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Cannot merge without id or sku. Importing instead.', '
|
126 |
|
127 |
$merging = false;
|
128 |
} else
|
@@ -142,14 +142,14 @@ class WF_CSV_Parser_Coupon {
|
|
142 |
$found_product_id = $wpdb->get_var($db_query);
|
143 |
if ( ! $found_product_id )
|
144 |
{
|
145 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf(__( '> > Skipped. Cannot find coupon with sku %s. Importing instead.', '
|
146 |
$merging = false;
|
147 |
|
148 |
} else
|
149 |
{
|
150 |
|
151 |
$post_id = $found_product_id;
|
152 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf(__( '> > Found coupon with ID %s.', '
|
153 |
|
154 |
}
|
155 |
}
|
@@ -161,15 +161,15 @@ class WF_CSV_Parser_Coupon {
|
|
161 |
{
|
162 |
|
163 |
$product['merging'] = false;
|
164 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf( __('> Row %s - preparing for import.', '
|
165 |
if ( isset($item['post_parent']) && $item['post_parent']=== '' && $item['post_title']=== '') {
|
166 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Skipped. No post_title set for new coupon.', '
|
167 |
-
return new WP_Error( 'parse-error', __( 'No post_title set for new coupon.', '
|
168 |
}
|
169 |
if ( isset($item['post_parent']) && $item['post_parent']!== '' && $item['post_parent']!== null && $item['parent_sku'] === '' )
|
170 |
{
|
171 |
-
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Skipped. No parent set for new variation product.', '
|
172 |
-
return new WP_Error( 'parse-error', __( 'No parent set for new variation product.', '
|
173 |
}
|
174 |
}
|
175 |
|
119 |
if ( $merging )
|
120 |
{
|
121 |
$product['merging'] = true;
|
122 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf( __('> Row %s - preparing for merge.', 'order-import-export-for-woocommerce'), $this->row ) );
|
123 |
if ( ! $post_id )
|
124 |
{
|
125 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Cannot merge without id or sku. Importing instead.', 'order-import-export-for-woocommerce') );
|
126 |
|
127 |
$merging = false;
|
128 |
} else
|
142 |
$found_product_id = $wpdb->get_var($db_query);
|
143 |
if ( ! $found_product_id )
|
144 |
{
|
145 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf(__( '> > Skipped. Cannot find coupon with sku %s. Importing instead.', 'order-import-export-for-woocommerce'), $item['sku']) );
|
146 |
$merging = false;
|
147 |
|
148 |
} else
|
149 |
{
|
150 |
|
151 |
$post_id = $found_product_id;
|
152 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf(__( '> > Found coupon with ID %s.', 'order-import-export-for-woocommerce'), $post_id) );
|
153 |
|
154 |
}
|
155 |
}
|
161 |
{
|
162 |
|
163 |
$product['merging'] = false;
|
164 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', sprintf( __('> Row %s - preparing for import.', 'order-import-export-for-woocommerce'), $this->row ) );
|
165 |
if ( isset($item['post_parent']) && $item['post_parent']=== '' && $item['post_title']=== '') {
|
166 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Skipped. No post_title set for new coupon.', 'order-import-export-for-woocommerce') );
|
167 |
+
return new WP_Error( 'parse-error', __( 'No post_title set for new coupon.', 'order-import-export-for-woocommerce' ) );
|
168 |
}
|
169 |
if ( isset($item['post_parent']) && $item['post_parent']!== '' && $item['post_parent']!== null && $item['parent_sku'] === '' )
|
170 |
{
|
171 |
+
$WF_CSV_Coupon_Import->hf_coupon_log_data_change( 'coupon-csv-import', __( '> > Skipped. No parent set for new variation product.', 'order-import-export-for-woocommerce') );
|
172 |
+
return new WP_Error( 'parse-error', __( 'No parent set for new variation product.', 'order-import-export-for-woocommerce' ) );
|
173 |
}
|
174 |
}
|
175 |
|
includes/importer/class-wf-csv-parser.php
CHANGED
@@ -64,7 +64,7 @@ class WF_CSV_Parser {
|
|
64 |
"shipping_postcode",
|
65 |
"shipping_country",
|
66 |
"shipping_method",
|
67 |
-
"
|
68 |
);
|
69 |
}
|
70 |
|
@@ -167,7 +167,7 @@ class WF_CSV_Parser {
|
|
167 |
$row++;
|
168 |
|
169 |
if ($row <= $record_offset) {
|
170 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> Row %s - skipped due to record offset.', '
|
171 |
unset($item);
|
172 |
return;
|
173 |
}
|
@@ -179,7 +179,7 @@ class WF_CSV_Parser {
|
|
179 |
$order_number = (!empty($item['order_number']) ) ? $item['order_number'] : null;
|
180 |
$order_number_formatted = (!empty($item['order_number_formatted']) ) ? $item['order_number_formatted'] : $order_number;
|
181 |
|
182 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> Row %s - preparing for import.', '
|
183 |
|
184 |
|
185 |
// validate the supplied formatted order number/order number
|
@@ -188,7 +188,7 @@ class WF_CSV_Parser {
|
|
188 |
|
189 |
if ($order_number && !is_numeric($order_number)) {
|
190 |
|
191 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Order number field must be an integer: %s.', '
|
192 |
$skipped++;
|
193 |
unset($item);
|
194 |
return;
|
@@ -196,7 +196,7 @@ class WF_CSV_Parser {
|
|
196 |
|
197 |
if ($order_number_formatted && !$order_number) {
|
198 |
|
199 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', __('> > Skipped. Formatted order number provided but no numerical order number, see the documentation for further details.', '
|
200 |
$skipped++;
|
201 |
unset($item);
|
202 |
return;
|
@@ -227,7 +227,7 @@ class WF_CSV_Parser {
|
|
227 |
|
228 |
if ($order_id) {
|
229 |
// skip if order ID already exist.
|
230 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Order %s already exists.', '
|
231 |
$skipped++;
|
232 |
unset($item);
|
233 |
return;
|
@@ -243,7 +243,7 @@ class WF_CSV_Parser {
|
|
243 |
|
244 |
if (!$found_customer) {
|
245 |
|
246 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Cannot find customer with id %s.', '
|
247 |
$skipped++;
|
248 |
unset($item);
|
249 |
return;
|
@@ -287,7 +287,7 @@ class WF_CSV_Parser {
|
|
287 |
}
|
288 |
|
289 |
if (!$found_status) {
|
290 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Unknown order status %s (%s).', '
|
291 |
$skipped++;
|
292 |
unset($item);
|
293 |
return;
|
@@ -300,13 +300,13 @@ class WF_CSV_Parser {
|
|
300 |
$item['date'] = $item['order_date'];
|
301 |
|
302 |
if (!empty($item['date'])) {
|
303 |
-
if(
|
304 |
$item['date'] = date_create_from_format('d-m-y H:i', $item['date']);
|
305 |
$item['date'] = date_format($item['date'], 'Y-m-d H:i:s');
|
306 |
}
|
307 |
if (false === ( $item['date'] = strtotime($item['date']) )) {
|
308 |
// invalid date format
|
309 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Invalid date format %s.', '
|
310 |
$skipped++;
|
311 |
unset($item);
|
312 |
return;
|
@@ -567,8 +567,8 @@ class WF_CSV_Parser {
|
|
567 |
$i = 1;
|
568 |
while (!empty($item['line_item_' . $i])) {
|
569 |
|
570 |
-
|
571 |
-
|
572 |
if ($item['line_item_' . $i] && empty($_item_meta)) {
|
573 |
$_item_meta = explode('|', $item['line_item_' . $i]);
|
574 |
}
|
@@ -606,7 +606,7 @@ class WF_CSV_Parser {
|
|
606 |
|
607 |
if (!$allow_unknown_products && !$product_id) {
|
608 |
// unknown product
|
609 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Unknown order item: %s.', '
|
610 |
$skipped++;
|
611 |
$i++;
|
612 |
continue; // break outer loop
|
@@ -640,7 +640,7 @@ class WF_CSV_Parser {
|
|
640 |
|
641 |
if (!$sku || !$qty || !is_numeric($total)) {
|
642 |
// invalid item
|
643 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Row %d - %s - skipped. Missing SKU, quantity or total', '
|
644 |
$skipped++;
|
645 |
unset($item);
|
646 |
return; // break outer loop
|
@@ -651,7 +651,7 @@ class WF_CSV_Parser {
|
|
651 |
|
652 |
if (!$product_id) {
|
653 |
// unknown product
|
654 |
-
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Row %d - %s - skipped. Unknown order item: %s.', '
|
655 |
$skipped++;
|
656 |
unset($item);
|
657 |
return; // break outer loop
|
64 |
"shipping_postcode",
|
65 |
"shipping_country",
|
66 |
"shipping_method",
|
67 |
+
"download_permissions",
|
68 |
);
|
69 |
}
|
70 |
|
167 |
$row++;
|
168 |
|
169 |
if ($row <= $record_offset) {
|
170 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> Row %s - skipped due to record offset.', 'order-import-export-for-woocommerce'), $row));
|
171 |
unset($item);
|
172 |
return;
|
173 |
}
|
179 |
$order_number = (!empty($item['order_number']) ) ? $item['order_number'] : null;
|
180 |
$order_number_formatted = (!empty($item['order_number_formatted']) ) ? $item['order_number_formatted'] : $order_number;
|
181 |
|
182 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> Row %s - preparing for import.', 'order-import-export-for-woocommerce'), $row));
|
183 |
|
184 |
|
185 |
// validate the supplied formatted order number/order number
|
188 |
|
189 |
if ($order_number && !is_numeric($order_number)) {
|
190 |
|
191 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Order number field must be an integer: %s.', 'order-import-export-for-woocommerce'), $order_number));
|
192 |
$skipped++;
|
193 |
unset($item);
|
194 |
return;
|
196 |
|
197 |
if ($order_number_formatted && !$order_number) {
|
198 |
|
199 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', __('> > Skipped. Formatted order number provided but no numerical order number, see the documentation for further details.', 'order-import-export-for-woocommerce'));
|
200 |
$skipped++;
|
201 |
unset($item);
|
202 |
return;
|
227 |
|
228 |
if ($order_id) {
|
229 |
// skip if order ID already exist.
|
230 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Order %s already exists.', 'order-import-export-for-woocommerce'), $order_number_formatted));
|
231 |
$skipped++;
|
232 |
unset($item);
|
233 |
return;
|
243 |
|
244 |
if (!$found_customer) {
|
245 |
|
246 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Cannot find customer with id %s.', 'order-import-export-for-woocommerce'), $item['customer_id']));
|
247 |
$skipped++;
|
248 |
unset($item);
|
249 |
return;
|
287 |
}
|
288 |
|
289 |
if (!$found_status) {
|
290 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Unknown order status %s (%s).', 'order-import-export-for-woocommerce'), $item['status'], implode($available_statuses, ', ')));
|
291 |
$skipped++;
|
292 |
unset($item);
|
293 |
return;
|
300 |
$item['date'] = $item['order_date'];
|
301 |
|
302 |
if (!empty($item['date'])) {
|
303 |
+
if(preg_match("/^(\d{2})-(\d{2})-(\d{2}) (\d{1}|\d{2}):(\d{2})$/", $item['date'])){
|
304 |
$item['date'] = date_create_from_format('d-m-y H:i', $item['date']);
|
305 |
$item['date'] = date_format($item['date'], 'Y-m-d H:i:s');
|
306 |
}
|
307 |
if (false === ( $item['date'] = strtotime($item['date']) )) {
|
308 |
// invalid date format
|
309 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Invalid date format %s.', 'order-import-export-for-woocommerce'), $item['date']));
|
310 |
$skipped++;
|
311 |
unset($item);
|
312 |
return;
|
567 |
$i = 1;
|
568 |
while (!empty($item['line_item_' . $i])) {
|
569 |
|
570 |
+
// $_item_meta = preg_split("~\\\\.(*SKIP)(*FAIL)|\|~s", $item['line_item_' . $i]);
|
571 |
+
$_item_meta = array();
|
572 |
if ($item['line_item_' . $i] && empty($_item_meta)) {
|
573 |
$_item_meta = explode('|', $item['line_item_' . $i]);
|
574 |
}
|
606 |
|
607 |
if (!$allow_unknown_products && !$product_id) {
|
608 |
// unknown product
|
609 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Skipped. Unknown order item: %s.', 'order-import-export-for-woocommerce'), $product_identifier));
|
610 |
$skipped++;
|
611 |
$i++;
|
612 |
continue; // break outer loop
|
640 |
|
641 |
if (!$sku || !$qty || !is_numeric($total)) {
|
642 |
// invalid item
|
643 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Row %d - %s - skipped. Missing SKU, quantity or total', 'order-import-export-for-woocommerce'), $row, $item['order_id']));
|
644 |
$skipped++;
|
645 |
unset($item);
|
646 |
return; // break outer loop
|
651 |
|
652 |
if (!$product_id) {
|
653 |
// unknown product
|
654 |
+
$WF_CSV_Order_Import->hf_order_log_data_change('order-csv-import', sprintf(__('> > Row %d - %s - skipped. Unknown order item: %s.', 'order-import-export-for-woocommerce'), $row, $item['order_id'], $sku));
|
655 |
$skipped++;
|
656 |
unset($item);
|
657 |
return; // break outer loop
|
includes/importer/class-wf-orderimpexpcsv-order-import.php
CHANGED
@@ -81,7 +81,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
81 |
if (!empty($_GET['clearmapping']) || $this->handle_upload())
|
82 |
$this->import_options();
|
83 |
else
|
84 |
-
_e('Error with handle_upload!', '
|
85 |
break;
|
86 |
case 2 :
|
87 |
$this->header();
|
@@ -105,10 +105,10 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
105 |
<table id="import-progress" class="widefat_importer widefat">
|
106 |
<thead>
|
107 |
<tr> <th class="status"> </th>
|
108 |
-
<th class="row"><?php _e('Row', '
|
109 |
-
<th><?php _e('OrderID', '
|
110 |
-
<th><?php _e('Order Status', '
|
111 |
-
<th class="reason"><?php _e('Status Msg', '
|
112 |
</tr>
|
113 |
</thead>
|
114 |
<tfoot>
|
@@ -174,7 +174,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
174 |
} catch (err) {}
|
175 |
|
176 |
} else {
|
177 |
-
$('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', '
|
178 |
}
|
179 |
|
180 |
var w = $(window);
|
@@ -268,7 +268,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
268 |
</script>
|
269 |
<?php
|
270 |
} else {
|
271 |
-
echo '<p class="error">' . __('Error finding uploaded file!', '
|
272 |
}
|
273 |
break;
|
274 |
case 3 :
|
@@ -325,19 +325,19 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
325 |
$this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
|
326 |
$this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
|
327 |
|
328 |
-
_e('Step 1...', '
|
329 |
|
330 |
wp_defer_term_counting(true);
|
331 |
wp_defer_comment_counting(true);
|
332 |
|
333 |
-
_e('Step 2...', '
|
334 |
|
335 |
echo 'Step 3...' . ' '; // Easter egg
|
336 |
|
337 |
-
_e('Finalizing...', '
|
338 |
|
339 |
// SUCCESS
|
340 |
-
_e('Finished. Import complete.', '
|
341 |
|
342 |
$this->import_end();
|
343 |
exit;
|
@@ -405,7 +405,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
405 |
|
406 |
wp_suspend_cache_invalidation(true);
|
407 |
$this->hf_order_log_data_change('order-csv-import', '---');
|
408 |
-
$this->hf_order_log_data_change('order-csv-import', __('Processing orders.', '
|
409 |
$merging = 1;
|
410 |
$record_offset = 0;
|
411 |
foreach ($this->parsed_data as $key => &$item) {
|
@@ -418,7 +418,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
418 |
unset($item, $order);
|
419 |
}
|
420 |
|
421 |
-
$this->hf_order_log_data_change('order-csv-import', __('Finished processing Orders.', '
|
422 |
wp_suspend_cache_invalidation(false);
|
423 |
}
|
424 |
|
@@ -433,13 +433,13 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
433 |
$wp_memory = size_format((WC()->version < '2.7.0') ? woocommerce_let_to_num(WP_MEMORY_LIMIT) : wc_let_to_num(WP_MEMORY_LIMIT));
|
434 |
|
435 |
$this->hf_order_log_data_change('order-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
436 |
-
$this->hf_order_log_data_change('order-csv-import', __('Parsing products CSV.', '
|
437 |
|
438 |
$this->parser = new WF_CSV_Parser('shop_order');
|
439 |
|
440 |
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $start_pos, $end_pos);
|
441 |
|
442 |
-
$this->hf_order_log_data_change('order-csv-import', __('Finished parsing products CSV.', '
|
443 |
|
444 |
unset($import_data);
|
445 |
|
@@ -478,7 +478,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
478 |
$file = wp_import_handle_upload();
|
479 |
|
480 |
if (isset($file['error'])) {
|
481 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', '
|
482 |
echo esc_html($file['error']) . '</p>';
|
483 |
return false;
|
484 |
}
|
@@ -493,7 +493,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
493 |
return true;
|
494 |
} else {
|
495 |
|
496 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', '
|
497 |
return false;
|
498 |
}
|
499 |
}
|
@@ -534,7 +534,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
534 |
$dry_run = FALSE;
|
535 |
|
536 |
$this->hf_order_log_data_change('order-csv-import', '---');
|
537 |
-
$this->hf_order_log_data_change('order-csv-import', __('Processing orders.', '
|
538 |
|
539 |
// check class-wc-checkout.php for reference
|
540 |
|
@@ -568,8 +568,8 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
568 |
|
569 |
$user_id = $this->hf_check_customer($meta_array);
|
570 |
if (is_wp_error($user_id)) {
|
571 |
-
$this->hf_order_log_data_change('order-csv-import', __($user_id->get_error_message(), '
|
572 |
-
$this->add_import_result('skipped', __($user_id->get_error_message(), '
|
573 |
$skipped++;
|
574 |
unset($post);
|
575 |
return;
|
@@ -580,8 +580,8 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
580 |
|
581 |
if (!$merging && $is_order_exist) {
|
582 |
$usr_msg = 'Order already exists.';
|
583 |
-
$this->add_import_result('skipped', __($usr_msg, '
|
584 |
-
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> “%s”' . $usr_msg, '
|
585 |
unset($post);
|
586 |
return;
|
587 |
} else {
|
@@ -595,8 +595,8 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
595 |
if (is_wp_error($order_id)) {
|
596 |
$this->errored++;
|
597 |
$new_added = false;
|
598 |
-
//$this->add_import_result('failed', __($order_id->get_error_message() , '
|
599 |
-
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> Error inserting %s: %s', '
|
600 |
}
|
601 |
}
|
602 |
}
|
@@ -661,7 +661,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
661 |
|
662 |
// order item
|
663 |
$order_items[] = array(
|
664 |
-
'order_item_name' => $product ? $product->get_title() : (!empty($item['unknown_product_name']) ? $item['unknown_product_name'] : __('Unknown Product', '
|
665 |
'order_item_type' => 'line_item',
|
666 |
);
|
667 |
|
@@ -764,7 +764,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
764 |
if (!$dry_run) {
|
765 |
// do our best to provide some custom order number functionality while also allowing 3rd party plugins to provide their own custom order number facilities
|
766 |
do_action('woocommerce_set_order_number', $order, $post['order_number'], $post['order_number_formatted']);
|
767 |
-
$order->add_order_note(sprintf(__("Original order #%s", '
|
768 |
|
769 |
// get the order so we can display the correct order number
|
770 |
$order = wc_get_order($order_id);
|
@@ -777,15 +777,15 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
777 |
else
|
778 |
$out_msg = 'Order Imported Successfully.';
|
779 |
|
780 |
-
$this->add_import_result('imported', __($out_msg, '
|
781 |
-
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> “%s”' . $out_msg, '
|
782 |
$this->imported++;
|
783 |
-
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> Finished importing order %s', '
|
784 |
|
785 |
// }
|
786 |
|
787 |
|
788 |
-
$this->hf_order_log_data_change('order-csv-import', __('Finished processing orders.', '
|
789 |
|
790 |
unset($post);
|
791 |
}
|
@@ -838,7 +838,7 @@ class WF_OrderImpExpCsv_Order_Import extends WP_Importer {
|
|
838 |
// Display import page title
|
839 |
public function header() {
|
840 |
echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
841 |
-
echo '<h2>' . ( empty($_GET['merge']) ? __('Import', '
|
842 |
}
|
843 |
|
844 |
// Close div.wrap
|
81 |
if (!empty($_GET['clearmapping']) || $this->handle_upload())
|
82 |
$this->import_options();
|
83 |
else
|
84 |
+
_e('Error with handle_upload!', 'order-import-export-for-woocommerce');
|
85 |
break;
|
86 |
case 2 :
|
87 |
$this->header();
|
105 |
<table id="import-progress" class="widefat_importer widefat">
|
106 |
<thead>
|
107 |
<tr> <th class="status"> </th>
|
108 |
+
<th class="row"><?php _e('Row', 'order-import-export-for-woocommerce'); ?></th>
|
109 |
+
<th><?php _e('OrderID', 'order-import-export-for-woocommerce'); ?></th>
|
110 |
+
<th><?php _e('Order Status', 'order-import-export-for-woocommerce'); ?></th>
|
111 |
+
<th class="reason"><?php _e('Status Msg', 'order-import-export-for-woocommerce'); ?></th>
|
112 |
</tr>
|
113 |
</thead>
|
114 |
<tfoot>
|
174 |
} catch (err) {}
|
175 |
|
176 |
} else {
|
177 |
+
$('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'order-import-export-for-woocommerce'); ?>' + '</td></tr>');
|
178 |
}
|
179 |
|
180 |
var w = $(window);
|
268 |
</script>
|
269 |
<?php
|
270 |
} else {
|
271 |
+
echo '<p class="error">' . __('Error finding uploaded file!', 'order-import-export-for-woocommerce') . '</p>';
|
272 |
}
|
273 |
break;
|
274 |
case 3 :
|
325 |
$this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
|
326 |
$this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
|
327 |
|
328 |
+
_e('Step 1...', 'order-import-export-for-woocommerce') . ' ';
|
329 |
|
330 |
wp_defer_term_counting(true);
|
331 |
wp_defer_comment_counting(true);
|
332 |
|
333 |
+
_e('Step 2...', 'order-import-export-for-woocommerce') . ' ';
|
334 |
|
335 |
echo 'Step 3...' . ' '; // Easter egg
|
336 |
|
337 |
+
_e('Finalizing...', 'order-import-export-for-woocommerce') . ' ';
|
338 |
|
339 |
// SUCCESS
|
340 |
+
_e('Finished. Import complete.', 'order-import-export-for-woocommerce');
|
341 |
|
342 |
$this->import_end();
|
343 |
exit;
|
405 |
|
406 |
wp_suspend_cache_invalidation(true);
|
407 |
$this->hf_order_log_data_change('order-csv-import', '---');
|
408 |
+
$this->hf_order_log_data_change('order-csv-import', __('Processing orders.', 'order-import-export-for-woocommerce'));
|
409 |
$merging = 1;
|
410 |
$record_offset = 0;
|
411 |
foreach ($this->parsed_data as $key => &$item) {
|
418 |
unset($item, $order);
|
419 |
}
|
420 |
|
421 |
+
$this->hf_order_log_data_change('order-csv-import', __('Finished processing Orders.', 'order-import-export-for-woocommerce'));
|
422 |
wp_suspend_cache_invalidation(false);
|
423 |
}
|
424 |
|
433 |
$wp_memory = size_format((WC()->version < '2.7.0') ? woocommerce_let_to_num(WP_MEMORY_LIMIT) : wc_let_to_num(WP_MEMORY_LIMIT));
|
434 |
|
435 |
$this->hf_order_log_data_change('order-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
436 |
+
$this->hf_order_log_data_change('order-csv-import', __('Parsing products CSV.', 'order-import-export-for-woocommerce'));
|
437 |
|
438 |
$this->parser = new WF_CSV_Parser('shop_order');
|
439 |
|
440 |
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $start_pos, $end_pos);
|
441 |
|
442 |
+
$this->hf_order_log_data_change('order-csv-import', __('Finished parsing products CSV.', 'order-import-export-for-woocommerce'));
|
443 |
|
444 |
unset($import_data);
|
445 |
|
478 |
$file = wp_import_handle_upload();
|
479 |
|
480 |
if (isset($file['error'])) {
|
481 |
+
echo '<p><strong>' . __('Sorry, there has been an error.', 'order-import-export-for-woocommerce') . '</strong><br />';
|
482 |
echo esc_html($file['error']) . '</p>';
|
483 |
return false;
|
484 |
}
|
493 |
return true;
|
494 |
} else {
|
495 |
|
496 |
+
echo '<p><strong>' . __('Sorry, there has been an error.', 'order-import-export-for-woocommerce') . '</strong></p>';
|
497 |
return false;
|
498 |
}
|
499 |
}
|
534 |
$dry_run = FALSE;
|
535 |
|
536 |
$this->hf_order_log_data_change('order-csv-import', '---');
|
537 |
+
$this->hf_order_log_data_change('order-csv-import', __('Processing orders.', 'order-import-export-for-woocommerce'));
|
538 |
|
539 |
// check class-wc-checkout.php for reference
|
540 |
|
568 |
|
569 |
$user_id = $this->hf_check_customer($meta_array);
|
570 |
if (is_wp_error($user_id)) {
|
571 |
+
$this->hf_order_log_data_change('order-csv-import', __($user_id->get_error_message(), 'order-import-export-for-woocommerce'));
|
572 |
+
$this->add_import_result('skipped', __($user_id->get_error_message(), 'order-import-export-for-woocommerce'), $post['order_number'], $post['order_number'], $post['order_number']);
|
573 |
$skipped++;
|
574 |
unset($post);
|
575 |
return;
|
580 |
|
581 |
if (!$merging && $is_order_exist) {
|
582 |
$usr_msg = 'Order already exists.';
|
583 |
+
$this->add_import_result('skipped', __($usr_msg, 'order-import-export-for-woocommerce'), $post['order_number'], $order_data['post_title'], $post['order_number']);
|
584 |
+
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> “%s”' . $usr_msg, 'order-import-export-for-woocommerce'), esc_html($order_data['post_title'])), true);
|
585 |
unset($post);
|
586 |
return;
|
587 |
} else {
|
595 |
if (is_wp_error($order_id)) {
|
596 |
$this->errored++;
|
597 |
$new_added = false;
|
598 |
+
//$this->add_import_result('failed', __($order_id->get_error_message() , 'order-import-export-for-woocommerce'), $post['order_number'], $order_data['post_title'], $post['order_number']);
|
599 |
+
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> Error inserting %s: %s', 'order-import-export-for-woocommerce'), $post['order_number'], $order_id->get_error_message()), true);
|
600 |
}
|
601 |
}
|
602 |
}
|
661 |
|
662 |
// order item
|
663 |
$order_items[] = array(
|
664 |
+
'order_item_name' => $product ? $product->get_title() : (!empty($item['unknown_product_name']) ? $item['unknown_product_name'] : __('Unknown Product', 'order-import-export-for-woocommerce')),
|
665 |
'order_item_type' => 'line_item',
|
666 |
);
|
667 |
|
764 |
if (!$dry_run) {
|
765 |
// do our best to provide some custom order number functionality while also allowing 3rd party plugins to provide their own custom order number facilities
|
766 |
do_action('woocommerce_set_order_number', $order, $post['order_number'], $post['order_number_formatted']);
|
767 |
+
$order->add_order_note(sprintf(__("Original order #%s", 'order-import-export-for-woocommerce'), $post['order_number_formatted']));
|
768 |
|
769 |
// get the order so we can display the correct order number
|
770 |
$order = wc_get_order($order_id);
|
777 |
else
|
778 |
$out_msg = 'Order Imported Successfully.';
|
779 |
|
780 |
+
$this->add_import_result('imported', __($out_msg, 'order-import-export-for-woocommerce'), $order_id, $order_data['post_title'], $order_id);
|
781 |
+
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> “%s”' . $out_msg, 'order-import-export-for-woocommerce'), esc_html($order_data['post_title'])), true);
|
782 |
$this->imported++;
|
783 |
+
$this->hf_order_log_data_change('order-csv-import', sprintf(__('> Finished importing order %s', 'order-import-export-for-woocommerce'), $dry_run ? "" : $order->get_order_number() ));
|
784 |
|
785 |
// }
|
786 |
|
787 |
|
788 |
+
$this->hf_order_log_data_change('order-csv-import', __('Finished processing orders.', 'order-import-export-for-woocommerce'));
|
789 |
|
790 |
unset($post);
|
791 |
}
|
838 |
// Display import page title
|
839 |
public function header() {
|
840 |
echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
841 |
+
echo '<h2>' . ( empty($_GET['merge']) ? __('Import', 'order-import-export-for-woocommerce') : __('Merge Orders', 'order-import-export-for-woocommerce') ) . '</h2>';
|
842 |
}
|
843 |
|
844 |
// Close div.wrap
|
includes/importer/views-coupon/html-wf-import-greeting.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
<div class="wrap woocommerce">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab"><?php _e('Order Import / Export', '
|
5 |
-
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab nav-tab-active"><?php _e('Coupon Import / Export', '
|
6 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab"><?php _e('Subscription Import / Export', '
|
7 |
-
<a href="
|
|
|
8 |
</h2>
|
9 |
<div class="orderimpexp-main-box">
|
10 |
<div class="tool-box bg-white p-20p orderimpexp-view">
|
11 |
-
<p><?php _e( 'You can import coupons (in CSV format) in to the shop using below methods.', '
|
12 |
|
13 |
<?php if ( ! empty( $upload_dir['error'] ) ) : ?>
|
14 |
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
|
1 |
<div class="wrap woocommerce">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab"><?php _e('Order Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
5 |
+
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab nav-tab-active"><?php _e('Coupon Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab"><?php _e('Subscription Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
7 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=help') ?>" class="nav-tab"><?php _e('Help', 'order-import-export-for-woocommerce'); ?></a>
|
8 |
+
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
</h2>
|
10 |
<div class="orderimpexp-main-box">
|
11 |
<div class="tool-box bg-white p-20p orderimpexp-view">
|
12 |
+
<p><?php _e( 'You can import coupons (in CSV format) in to the shop using below methods.', 'order-import-export-for-woocommerce' ); ?></p>
|
13 |
|
14 |
<?php if ( ! empty( $upload_dir['error'] ) ) : ?>
|
15 |
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
|
includes/importer/views-coupon/html-wf-import-options.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<?php endif; ?>
|
7 |
|
8 |
<p class="submit">
|
9 |
-
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', '
|
10 |
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
|
11 |
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
|
12 |
</p>
|
6 |
<?php endif; ?>
|
7 |
|
8 |
<p class="submit">
|
9 |
+
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'order-import-export-for-woocommerce'); ?>" />
|
10 |
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
|
11 |
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
|
12 |
</p>
|
includes/importer/views/html-wf-import-greeting.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
<div class="wrap woocommerce">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab nav-tab-active"><?php _e('Order Import / Export', '
|
5 |
-
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab"><?php _e('Coupon Import / Export', '
|
6 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab"><?php _e('Subscription Import / Export', '
|
7 |
-
<a href="
|
|
|
8 |
</h2>
|
9 |
<div class="orderimpexp-main-box">
|
10 |
<div class="tool-box bg-white p-20p orderimpexp-view">
|
11 |
-
<p><?php _e('You can import orders (in CSV format) in to the shop using below methods.', '
|
12 |
|
13 |
<?php if (!empty($upload_dir['error'])) : ?>
|
14 |
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
|
1 |
<div class="wrap woocommerce">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab nav-tab-active"><?php _e('Order Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
5 |
+
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab"><?php _e('Coupon Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab"><?php _e('Subscription Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
7 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=help') ?>" class="nav-tab"><?php _e('Help', 'order-import-export-for-woocommerce'); ?></a>
|
8 |
+
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
</h2>
|
10 |
<div class="orderimpexp-main-box">
|
11 |
<div class="tool-box bg-white p-20p orderimpexp-view">
|
12 |
+
<p><?php _e('You can import orders (in CSV format) in to the shop using below methods.', 'order-import-export-for-woocommerce'); ?></p>
|
13 |
|
14 |
<?php if (!empty($upload_dir['error'])) : ?>
|
15 |
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
|
includes/importer/views/html-wf-import-options.php
CHANGED
@@ -2,10 +2,11 @@
|
|
2 |
<div class="wrap woocommerce">
|
3 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
4 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
5 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('Order Import / Export', '
|
6 |
-
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab <?php echo ($tab == 'coupon') ? 'nav-tab-active' : ''; ?>"><?php _e('Coupon Import / Export', '
|
7 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab <?php echo ($tab == 'subscription') ? 'nav-tab-active' : ''; ?>"><?php _e('Subscription Import / Export', '
|
8 |
-
<a href="
|
|
|
9 |
</h2>
|
10 |
|
11 |
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $merge); ?>" method="post" id="nomap">
|
@@ -15,7 +16,7 @@
|
|
15 |
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
|
16 |
<?php endif; ?>
|
17 |
<p class="submit">
|
18 |
-
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', '
|
19 |
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
|
20 |
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
|
21 |
</p>
|
2 |
<div class="wrap woocommerce">
|
3 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
4 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
5 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('Order Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab <?php echo ($tab == 'coupon') ? 'nav-tab-active' : ''; ?>"><?php _e('Coupon Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
7 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab <?php echo ($tab == 'subscription') ? 'nav-tab-active' : ''; ?>"><?php _e('Subscription Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
8 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=help') ?>" class="nav-tab <?php echo ($tab == 'help') ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
+
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'order-import-export-for-woocommerce'); ?></a>
|
10 |
</h2>
|
11 |
|
12 |
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2&merge=' . $merge); ?>" method="post" id="nomap">
|
16 |
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
|
17 |
<?php endif; ?>
|
18 |
<p class="submit">
|
19 |
+
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'order-import-export-for-woocommerce'); ?>" />
|
20 |
<input type="hidden" name="delimiter" value="<?php echo $this->delimiter ?>" />
|
21 |
<input type="hidden" name="merge_empty_cells" value="<?php echo $this->merge_empty_cells ?>" />
|
22 |
</p>
|
includes/views/export/html-wf-export-coupons.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<div class="tool-box bg-white p-20p">
|
2 |
-
<h3 class="title"><?php _e('Export Coupon in CSV Format:', '
|
3 |
-
<p><?php _e('Export and download your coupons in CSV format. This file can be used to import coupons back into your Woocommerce shop.', '
|
4 |
<form action="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&action=export'); ?>" method="post">
|
5 |
|
6 |
<table class="form-table">
|
7 |
|
8 |
</table>
|
9 |
-
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Coupons', '
|
10 |
</form>
|
11 |
</div>
|
12 |
</div>
|
1 |
<div class="tool-box bg-white p-20p">
|
2 |
+
<h3 class="title"><?php _e('Export Coupon in CSV Format:', 'order-import-export-for-woocommerce'); ?></h3>
|
3 |
+
<p><?php _e('Export and download your coupons in CSV format. This file can be used to import coupons back into your Woocommerce shop.', 'order-import-export-for-woocommerce'); ?></p>
|
4 |
<form action="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&action=export'); ?>" method="post">
|
5 |
|
6 |
<table class="form-table">
|
7 |
|
8 |
</table>
|
9 |
+
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Coupons', 'order-import-export-for-woocommerce'); ?>" /></p>
|
10 |
</form>
|
11 |
</div>
|
12 |
</div>
|
includes/views/export/html-wf-export-orders.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<div class="tool-box bg-white p-20p">
|
2 |
-
<h3 class="title"><?php _e('Export Orders in CSV Format:', '
|
3 |
-
<p><?php _e('Export and download your orders in CSV format. This file can be used to import orders back into your Woocommerce shop.', '
|
4 |
<form action="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&action=export'); ?>" method="post">
|
5 |
-
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Orders', '
|
6 |
</form>
|
7 |
</div>
|
8 |
</div>
|
1 |
<div class="tool-box bg-white p-20p">
|
2 |
+
<h3 class="title"><?php _e('Export Orders in CSV Format:', 'order-import-export-for-woocommerce'); ?></h3>
|
3 |
+
<p><?php _e('Export and download your orders in CSV format. This file can be used to import orders back into your Woocommerce shop.', 'order-import-export-for-woocommerce'); ?></p>
|
4 |
<form action="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&action=export'); ?>" method="post">
|
5 |
+
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Orders', 'order-import-export-for-woocommerce'); ?>" /></p>
|
6 |
</form>
|
7 |
</div>
|
8 |
</div>
|
includes/views/html-wf-admin-screen.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<div class="woocommerce" style="margin: 10px 20px 0 2px;">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('Order Import / Export', '
|
5 |
-
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab <?php echo ($tab == 'coupon') ? 'nav-tab-active' : ''; ?>"><?php _e('Coupon Import / Export', '
|
6 |
-
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab <?php echo ($tab == 'subscription') ? 'nav-tab-active' : ''; ?>"><?php _e('Subscription Import / Export', '
|
7 |
-
<a href="
|
|
|
8 |
</h2>
|
9 |
|
10 |
<?php
|
@@ -18,6 +19,9 @@
|
|
18 |
case "subscription" :
|
19 |
$this->admin_subscription_page();
|
20 |
break;
|
|
|
|
|
|
|
21 |
default :
|
22 |
$this->admin_import_page();
|
23 |
break;
|
1 |
<div class="woocommerce" style="margin: 10px 20px 0 2px;">
|
2 |
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('Order Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
5 |
+
<a href="<?php echo admin_url('admin.php?page=wf_coupon_csv_im_ex&tab=coupon') ?>" class="nav-tab <?php echo ($tab == 'coupon') ? 'nav-tab-active' : ''; ?>"><?php _e('Coupon Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=subscription') ?>" class="nav-tab <?php echo ($tab == 'subscription') ? 'nav-tab-active' : ''; ?>"><?php _e('Subscription Import / Export', 'order-import-export-for-woocommerce'); ?></a>
|
7 |
+
<a href="<?php echo admin_url('admin.php?page=wf_woocommerce_order_im_ex&tab=help') ?>" class="nav-tab <?php echo ($tab == 'help') ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'order-import-export-for-woocommerce'); ?></a>
|
8 |
+
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
</h2>
|
10 |
|
11 |
<?php
|
19 |
case "subscription" :
|
20 |
$this->admin_subscription_page();
|
21 |
break;
|
22 |
+
case "help":
|
23 |
+
$this->admin_help_page();
|
24 |
+
break;
|
25 |
default :
|
26 |
$this->admin_import_page();
|
27 |
break;
|
includes/views/html-wf-getting-started-subscription.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
<div class="tool-box bg-white p-20p">
|
4 |
<div id="message" class="updated woocommerce-message wc-connect">
|
5 |
<div class="squeezer">
|
6 |
-
<h4><?php _e('<strong>This Feature is only available in Premium version</strong>', '
|
7 |
<p class="submit">
|
8 |
-
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="button button-primary"><?php _e('Upgrade to Premium Version', '
|
9 |
-
<a href="https://www.webtoffee.com/setting-up-order-import-export-plugin-for-woocommerce/" target="_blank" class="button"><?php _e('Documentation', '
|
10 |
-
<a href="<?php echo plugins_url('Sample_Subscription.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class="button"><?php _e('Sample Subscription CSV', '
|
11 |
</p>
|
12 |
</div>
|
13 |
</div>
|
3 |
<div class="tool-box bg-white p-20p">
|
4 |
<div id="message" class="updated woocommerce-message wc-connect">
|
5 |
<div class="squeezer">
|
6 |
+
<h4><?php _e('<strong>This Feature is only available in Premium version</strong>', 'order-import-export-for-woocommerce'); ?></h4>
|
7 |
<p class="submit">
|
8 |
+
<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" class="button button-primary"><?php _e('Upgrade to Premium Version', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
+
<a href="https://www.webtoffee.com/setting-up-order-import-export-plugin-for-woocommerce/" target="_blank" class="button"><?php _e('Documentation', 'order-import-export-for-woocommerce'); ?></a>
|
10 |
+
<a href="<?php echo plugins_url('Sample_Subscription.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class="button"><?php _e('Sample Subscription CSV', 'order-import-export-for-woocommerce'); ?></a>
|
11 |
</p>
|
12 |
</div>
|
13 |
</div>
|
includes/views/html-wf-help-guide.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="tool-box bg-white p-20p">
|
2 |
+
<div id="message" class="woocommerce-message wc-connect rTable">
|
3 |
+
<div class="rTableRow">
|
4 |
+
<div class="rTableCell">
|
5 |
+
<h4><?php _e('<strong>WooCommerce Order CSV</strong>', 'order-import-export-for-woocommerce'); ?></h4>
|
6 |
+
<p class="submit">
|
7 |
+
<a target="_blank" href="https://www.webtoffee.com/setting-up-order-import-export-plugin-for-woocommerce/" class="button-primary"><?php _e('Documentation', 'order-import-export-for-woocommerce'); ?></a>
|
8 |
+
<a class="docs button-primary" href="<?php echo WF_OrderImpExpCsv_FILE_Url.'Sample_Order.csv'; ?>"><?php _e('Sample Order CSV', 'order-import-export-for-woocommerce'); ?></a>
|
9 |
+
</p>
|
10 |
+
</div>
|
11 |
+
<div class="rTableCell">
|
12 |
+
<h4><?php _e('<strong>WooCommerce Coupon CSV</strong>', 'order-import-export-for-woocommerce'); ?></h4>
|
13 |
+
<p class="submit">
|
14 |
+
<a target="_blank" href="https://www.webtoffee.com/how-to-import-and-export-woocommerce-coupons-using-order-coupon-subscription-export-import-plugin/" class="button-primary"><?php _e( 'Documentation', 'order-import-export-for-woocommerce' ); ?></a>
|
15 |
+
<a class="docs button-primary" href="<?php echo WF_OrderImpExpCsv_FILE_Url.'Sample_Coupon.csv'; ?>"><?php _e('Sample Coupon CSV', 'order-import-export-for-woocommerce'); ?></a></p>
|
16 |
+
<p>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
</div>
|
includes/views/import/html-wf-import-coupons.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<div class="orderimpexp-main-box">
|
2 |
<div class="orderimpexp-view" style="width:68%;">
|
3 |
<div class="tool-box bg-white p-20p" style="margin-bottom: 20px;">
|
4 |
-
<h3 class="title"><?php _e('Import Coupons in CSV Format:', '
|
5 |
-
<p><?php _e('Import coupons in CSV format from different sources ( from your computer OR from another server via FTP )', '
|
6 |
<p class="submit">
|
7 |
<?php
|
8 |
$merge_url = admin_url('admin.php?import=coupon_csv&merge=1');
|
9 |
$import_url = admin_url('admin.php?import=coupon_csv');
|
10 |
?>
|
11 |
-
<a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=coupon_csv'); ?>"><?php _e('Import Coupons', '
|
12 |
|
13 |
-
<input type="checkbox" id="merge" value="0"><?php _e('Update coupons if exists', '
|
14 |
</p>
|
15 |
</div>
|
16 |
<script type="text/javascript">
|
1 |
<div class="orderimpexp-main-box">
|
2 |
<div class="orderimpexp-view" style="width:68%;">
|
3 |
<div class="tool-box bg-white p-20p" style="margin-bottom: 20px;">
|
4 |
+
<h3 class="title"><?php _e('Import Coupons in CSV Format:', 'order-import-export-for-woocommerce'); ?></h3>
|
5 |
+
<p><?php _e('Import coupons in CSV format from different sources ( from your computer OR from another server via FTP )', 'order-import-export-for-woocommerce'); ?></p>
|
6 |
<p class="submit">
|
7 |
<?php
|
8 |
$merge_url = admin_url('admin.php?import=coupon_csv&merge=1');
|
9 |
$import_url = admin_url('admin.php?import=coupon_csv');
|
10 |
?>
|
11 |
+
<a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=coupon_csv'); ?>"><?php _e('Import Coupons', 'order-import-export-for-woocommerce'); ?></a>
|
12 |
|
13 |
+
<input type="checkbox" id="merge" value="0"><?php _e('Update coupons if exists', 'order-import-export-for-woocommerce'); ?> <br>
|
14 |
</p>
|
15 |
</div>
|
16 |
<script type="text/javascript">
|
includes/views/import/html-wf-import-orders.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<div class="orderimpexp-main-box">
|
2 |
<div class="orderimpexp-view" style="width:68%;">
|
3 |
<div class="tool-box bg-white p-20p" style="margin-bottom: 20px;">
|
4 |
-
<h3 class="title"><?php _e('Import Orders in CSV Format:', '
|
5 |
-
<p><?php _e('Import Orders in CSV format from different sources ( from your computer OR from another server via FTP )', '
|
6 |
<p class="submit">
|
7 |
<?php
|
8 |
$merge_url = admin_url('admin.php?import=woocommerce_wf_order_csv&merge=1');
|
9 |
$import_url = admin_url('admin.php?import=woocommerce_wf_order_csv');
|
10 |
?>
|
11 |
-
<a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=woocommerce_wf_order_csv'); ?>"><?php _e('Import Orders', '
|
12 |
|
13 |
-
<input type="checkbox" id="merge" value="0"><?php _e('Update order if exists', '
|
14 |
</p>
|
15 |
</div>
|
16 |
<script type="text/javascript">
|
1 |
<div class="orderimpexp-main-box">
|
2 |
<div class="orderimpexp-view" style="width:68%;">
|
3 |
<div class="tool-box bg-white p-20p" style="margin-bottom: 20px;">
|
4 |
+
<h3 class="title"><?php _e('Import Orders in CSV Format:', 'order-import-export-for-woocommerce'); ?></h3>
|
5 |
+
<p><?php _e('Import Orders in CSV format from different sources ( from your computer OR from another server via FTP )', 'order-import-export-for-woocommerce'); ?></p>
|
6 |
<p class="submit">
|
7 |
<?php
|
8 |
$merge_url = admin_url('admin.php?import=woocommerce_wf_order_csv&merge=1');
|
9 |
$import_url = admin_url('admin.php?import=woocommerce_wf_order_csv');
|
10 |
?>
|
11 |
+
<a class="button button-primary" id="mylink" href="<?php echo admin_url('admin.php?import=woocommerce_wf_order_csv'); ?>"><?php _e('Import Orders', 'order-import-export-for-woocommerce'); ?></a>
|
12 |
|
13 |
+
<input type="checkbox" id="merge" value="0"><?php _e('Update order if exists', 'order-import-export-for-woocommerce'); ?> <br>
|
14 |
</p>
|
15 |
</div>
|
16 |
<script type="text/javascript">
|
includes/views/market.php
CHANGED
@@ -21,25 +21,25 @@ if (!defined('ABSPATH')) {
|
|
21 |
|
22 |
<span>
|
23 |
<ul class="ticked-list">
|
24 |
-
<li><?php _e('Import and Export Subscriptions.', '
|
25 |
-
<li><?php _e('Filter options for Export using Order Status, Date, Coupon Type etc.', '
|
26 |
-
<li><?php _e('Manipulate/evaluate data prior to import.', '
|
27 |
-
<li><?php _e('Map and transform custom columns to WC during import.', '
|
28 |
-
<li><?php _e('Choice to update or skip existing orders upon import.', '
|
29 |
-
<li><?php _e('Import and Export via FTP.', '
|
30 |
-
<li><?php _e('Schedule automatic import and export.', '
|
31 |
-
<li><?php _e('XML Export/Import supports Stamps.com desktop application, UPS WorldShip, Endicia and FedEx.', '
|
32 |
-
<li><?php _e('Third party plugin customization support.', '
|
33 |
</ul>
|
34 |
</span>
|
35 |
<div style="padding-bottom: 20px">
|
36 |
|
37 |
<center>
|
38 |
-
<a href="https://www.webtoffee.com/setting-up-order-import-export-plugin-for-woocommerce/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', '
|
39 |
</center>
|
40 |
<center style="margin-top: 10px">
|
41 |
-
<a href="<?php echo plugins_url('Sample_Order.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class=""><?php _e('Sample Order CSV', '
|
42 |
-
<a href="<?php echo plugins_url('Sample_Coupon.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class=""><?php _e('Sample Coupon CSV', '
|
43 |
</center>
|
44 |
</div>
|
45 |
|
21 |
|
22 |
<span>
|
23 |
<ul class="ticked-list">
|
24 |
+
<li><?php _e('Import and Export Subscriptions.', 'order-import-export-for-woocommerce'); ?></li>
|
25 |
+
<li><?php _e('Filter options for Export using Order Status, Date, Coupon Type etc.', 'order-import-export-for-woocommerce'); ?></li>
|
26 |
+
<li><?php _e('Manipulate/evaluate data prior to import.', 'order-import-export-for-woocommerce'); ?></li>
|
27 |
+
<li><?php _e('Map and transform custom columns to WC during import.', 'order-import-export-for-woocommerce'); ?> </li>
|
28 |
+
<li><?php _e('Choice to update or skip existing orders upon import.', 'order-import-export-for-woocommerce'); ?></li>
|
29 |
+
<li><?php _e('Import and Export via FTP.', 'order-import-export-for-woocommerce'); ?></li>
|
30 |
+
<li><?php _e('Schedule automatic import and export.', 'order-import-export-for-woocommerce'); ?></li>
|
31 |
+
<li><?php _e('XML Export/Import supports Stamps.com desktop application, UPS WorldShip, Endicia and FedEx.', 'order-import-export-for-woocommerce'); ?></li>
|
32 |
+
<li><?php _e('Third party plugin customization support.', 'order-import-export-for-woocommerce'); ?></li>
|
33 |
</ul>
|
34 |
</span>
|
35 |
<div style="padding-bottom: 20px">
|
36 |
|
37 |
<center>
|
38 |
+
<a href="https://www.webtoffee.com/setting-up-order-import-export-plugin-for-woocommerce/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'order-import-export-for-woocommerce'); ?></a>
|
39 |
</center>
|
40 |
<center style="margin-top: 10px">
|
41 |
+
<a href="<?php echo plugins_url('Sample_Order.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class=""><?php _e('Sample Order CSV', 'order-import-export-for-woocommerce'); ?></a>  /  
|
42 |
+
<a href="<?php echo plugins_url('Sample_Coupon.csv', WF_OrderImpExpCsv_FILE); ?>" target="_blank" class=""><?php _e('Sample Coupon CSV', 'order-import-export-for-woocommerce'); ?></a>
|
43 |
</center>
|
44 |
</div>
|
45 |
|
order-import-export.php → order-import-export-for-woocommerce.php
RENAMED
@@ -6,9 +6,9 @@ Plugin URI: https://wordpress.org/plugins/order-import-export-for-woocommerce/
|
|
6 |
Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
|
7 |
Author: WebToffee
|
8 |
Author URI: https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/
|
9 |
-
Version: 1.4.
|
10 |
-
Text Domain:
|
11 |
-
WC tested up to: 3.5.
|
12 |
License: GPLv3
|
13 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
*/
|
@@ -24,7 +24,7 @@ define("WF_CPN_IMP_EXP_ID", "wf_cpn_imp_exp");
|
|
24 |
define("wf_coupon_csv_im_ex", "wf_coupon_csv_im_ex");
|
25 |
|
26 |
if (!defined('WF_ORDERIMPEXP_CURRENT_VERSION')) {
|
27 |
-
define("WF_ORDERIMPEXP_CURRENT_VERSION", "1.4.
|
28 |
}
|
29 |
|
30 |
/**
|
@@ -45,6 +45,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
45 |
public function __construct() {
|
46 |
|
47 |
define( 'WF_OrderImpExpCsv_FILE', __FILE__ );
|
|
|
48 |
|
49 |
if (!defined('WT_OrdImpExpCsv_BASE')) {
|
50 |
define('WT_OrdImpExpCsv_BASE', plugin_dir_path(__FILE__));
|
@@ -57,7 +58,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
57 |
add_action( 'init', array( $this, 'catch_save_settings' ), 20 );
|
58 |
add_action( 'admin_init', array( $this, 'register_importers' ) );
|
59 |
|
60 |
-
|
61 |
include_once( 'includes/class-wf-orderimpexpcsv-admin-screen.php' );
|
62 |
include_once( 'includes/importer/class-wf-orderimpexpcsv-importer.php' );
|
63 |
|
@@ -71,9 +72,9 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
71 |
|
72 |
public function wf_plugin_action_links( $links ) {
|
73 |
$plugin_links = array(
|
74 |
-
'<a href="' . admin_url( 'admin.php?page=wf_woocommerce_order_im_ex' ) . '">' . __( 'Import Export', '
|
75 |
-
'<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" style="color:#3db634;">' . __( 'Premium Upgrade', '
|
76 |
-
'<a target="_blank" href="https://www.webtoffee.com/support/">' . __( 'Support', '
|
77 |
'<a target="_blank" href="https://wordpress.org/plugins/order-import-export-for-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
|
78 |
|
79 |
);
|
@@ -95,7 +96,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
95 |
* Handle localisation
|
96 |
*/
|
97 |
public function load_plugin_textdomain() {
|
98 |
-
load_plugin_textdomain( '
|
99 |
}
|
100 |
|
101 |
/**
|
@@ -132,7 +133,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
132 |
* Register importers for use
|
133 |
*/
|
134 |
public function register_importers() {
|
135 |
-
register_importer( 'woocommerce_wf_order_csv', 'WooCommerce Order (CSV)', __('Import <strong>Orders</strong> to your store via a csv file.', '
|
136 |
}
|
137 |
|
138 |
private function hf_user_permission() {
|
@@ -201,13 +202,13 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
201 |
|
202 |
switch ($wf_coupon_ie_msg) {
|
203 |
case "1":
|
204 |
-
echo '<div class="update"><p>' . __('Successfully uploaded via FTP.', '
|
205 |
break;
|
206 |
case "2":
|
207 |
-
echo '<div class="error"><p>' . __('Error while uploading via FTP.', '
|
208 |
break;
|
209 |
case "3":
|
210 |
-
echo '<div class="error"><p>' . __('Please choose the file in CSV format using Method 1.', '
|
211 |
break;
|
212 |
}
|
213 |
}
|
@@ -224,7 +225,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
224 |
* Handle localisation
|
225 |
*/
|
226 |
public function load_plugin_textdomain() {
|
227 |
-
load_plugin_textdomain('
|
228 |
}
|
229 |
|
230 |
/**
|
@@ -261,7 +262,7 @@ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', ge
|
|
261 |
* Register importers for use
|
262 |
*/
|
263 |
public function register_importers() {
|
264 |
-
register_importer('coupon_csv', 'WooCommerce Coupons (CSV)', __('Import <strong>coupon</strong> to your store via a csv file.', '
|
265 |
}
|
266 |
|
267 |
private function hf_user_permission() {
|
@@ -303,11 +304,11 @@ function webtoffee_storefrog_admin_notices() {
|
|
303 |
$allowed_screen_ids = array('woocommerce_page_wf_woocommerce_order_im_ex','woocommerce_page_wf_coupon_csv_im_ex');
|
304 |
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'woocommerce_wf_order_csv') || (isset($_GET['import']) && $_GET['import'] == 'coupon_csv') ) {
|
305 |
|
306 |
-
$notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', '
|
307 |
-
$notice .= __('<h3>Use StoreFrog Migration Services.</h3>', '
|
308 |
|
309 |
$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>';
|
310 |
-
$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_OrderImpExpCsv_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.', '
|
311 |
echo $content;
|
312 |
|
313 |
|
@@ -343,7 +344,7 @@ function WT_admin_footer_text($footer_text) {
|
|
343 |
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'woocommerce_wf_order_csv') || (isset($_GET['import']) && $_GET['import'] == 'coupon_csv') ) {
|
344 |
if (!get_option('ocsie_wt_plugin_reviewed')) {
|
345 |
$footer_text = sprintf(
|
346 |
-
__('If you like the plugin please leave us a %1$s review.', '
|
347 |
);
|
348 |
wc_enqueue_js(
|
349 |
"jQuery( 'a.wt-review-link' ).click( function() {
|
@@ -352,7 +353,7 @@ function WT_admin_footer_text($footer_text) {
|
|
352 |
});"
|
353 |
);
|
354 |
} else {
|
355 |
-
$footer_text = __('Thank you for your review.', '
|
356 |
}
|
357 |
}
|
358 |
|
6 |
Description: Export and Import Order detail including line items, From and To your WooCommerce Store.
|
7 |
Author: WebToffee
|
8 |
Author URI: https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/
|
9 |
+
Version: 1.4.1
|
10 |
+
Text Domain: order-import-export-for-woocommerce
|
11 |
+
WC tested up to: 3.5.4
|
12 |
License: GPLv3
|
13 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
*/
|
24 |
define("wf_coupon_csv_im_ex", "wf_coupon_csv_im_ex");
|
25 |
|
26 |
if (!defined('WF_ORDERIMPEXP_CURRENT_VERSION')) {
|
27 |
+
define("WF_ORDERIMPEXP_CURRENT_VERSION", "1.4.1");
|
28 |
}
|
29 |
|
30 |
/**
|
45 |
public function __construct() {
|
46 |
|
47 |
define( 'WF_OrderImpExpCsv_FILE', __FILE__ );
|
48 |
+
define('WF_OrderImpExpCsv_FILE_Url', plugin_dir_url(__FILE__));
|
49 |
|
50 |
if (!defined('WT_OrdImpExpCsv_BASE')) {
|
51 |
define('WT_OrdImpExpCsv_BASE', plugin_dir_path(__FILE__));
|
58 |
add_action( 'init', array( $this, 'catch_save_settings' ), 20 );
|
59 |
add_action( 'admin_init', array( $this, 'register_importers' ) );
|
60 |
|
61 |
+
include_once( 'includes/class-wf-orderimpexpcsv-system-status-tools.php' );
|
62 |
include_once( 'includes/class-wf-orderimpexpcsv-admin-screen.php' );
|
63 |
include_once( 'includes/importer/class-wf-orderimpexpcsv-importer.php' );
|
64 |
|
72 |
|
73 |
public function wf_plugin_action_links( $links ) {
|
74 |
$plugin_links = array(
|
75 |
+
'<a href="' . admin_url( 'admin.php?page=wf_woocommerce_order_im_ex' ) . '">' . __( 'Import Export', 'order-import-export-for-woocommerce' ) . '</a>',
|
76 |
+
'<a href="https://www.webtoffee.com/product/woocommerce-order-coupon-subscription-export-import/" target="_blank" style="color:#3db634;">' . __( 'Premium Upgrade', 'order-import-export-for-woocommerce' ) . '</a>',
|
77 |
+
'<a target="_blank" href="https://www.webtoffee.com/support/">' . __( 'Support', 'order-import-export-for-woocommerce' ) . '</a>',
|
78 |
'<a target="_blank" href="https://wordpress.org/plugins/order-import-export-for-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
|
79 |
|
80 |
);
|
96 |
* Handle localisation
|
97 |
*/
|
98 |
public function load_plugin_textdomain() {
|
99 |
+
load_plugin_textdomain( 'order-import-export-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
100 |
}
|
101 |
|
102 |
/**
|
133 |
* Register importers for use
|
134 |
*/
|
135 |
public function register_importers() {
|
136 |
+
register_importer( 'woocommerce_wf_order_csv', 'WooCommerce Order (CSV)', __('Import <strong>Orders</strong> to your store via a csv file.', 'order-import-export-for-woocommerce'), 'WF_OrderImpExpCsv_Importer::order_importer' );
|
137 |
}
|
138 |
|
139 |
private function hf_user_permission() {
|
202 |
|
203 |
switch ($wf_coupon_ie_msg) {
|
204 |
case "1":
|
205 |
+
echo '<div class="update"><p>' . __('Successfully uploaded via FTP.', 'order-import-export-for-woocommerce') . '</p></div>';
|
206 |
break;
|
207 |
case "2":
|
208 |
+
echo '<div class="error"><p>' . __('Error while uploading via FTP.', 'order-import-export-for-woocommerce') . '</p></div>';
|
209 |
break;
|
210 |
case "3":
|
211 |
+
echo '<div class="error"><p>' . __('Please choose the file in CSV format using Method 1.', 'order-import-export-for-woocommerce') . '</p></div>';
|
212 |
break;
|
213 |
}
|
214 |
}
|
225 |
* Handle localisation
|
226 |
*/
|
227 |
public function load_plugin_textdomain() {
|
228 |
+
load_plugin_textdomain('order-import-export-for-woocommerce', false, dirname(plugin_basename(__FILE__)) . '/lang/');
|
229 |
}
|
230 |
|
231 |
/**
|
262 |
* Register importers for use
|
263 |
*/
|
264 |
public function register_importers() {
|
265 |
+
register_importer('coupon_csv', 'WooCommerce Coupons (CSV)', __('Import <strong>coupon</strong> to your store via a csv file.', 'order-import-export-for-woocommerce'), 'WF_CpnImpExpCsv_Importer::coupon_importer');
|
266 |
}
|
267 |
|
268 |
private function hf_user_permission() {
|
304 |
$allowed_screen_ids = array('woocommerce_page_wf_woocommerce_order_im_ex','woocommerce_page_wf_coupon_csv_im_ex');
|
305 |
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'woocommerce_wf_order_csv') || (isset($_GET['import']) && $_GET['import'] == 'coupon_csv') ) {
|
306 |
|
307 |
+
$notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'order-import-export-for-woocommerce');
|
308 |
+
$notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'order-import-export-for-woocommerce');
|
309 |
|
310 |
$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>';
|
311 |
+
$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_OrderImpExpCsv_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.', 'order-import-export-for-woocommerce') . '</span></button></div></div>';
|
312 |
echo $content;
|
313 |
|
314 |
|
344 |
if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'woocommerce_wf_order_csv') || (isset($_GET['import']) && $_GET['import'] == 'coupon_csv') ) {
|
345 |
if (!get_option('ocsie_wt_plugin_reviewed')) {
|
346 |
$footer_text = sprintf(
|
347 |
+
__('If you like the plugin please leave us a %1$s review.', 'order-import-export-for-woocommerce'), '<a href="https://wordpress.org/support/plugin/order-import-export-for-woocommerce/reviews/?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__('Thanks :)', 'order-import-export-for-woocommerce') . '">★★★★★</a>'
|
348 |
);
|
349 |
wc_enqueue_js(
|
350 |
"jQuery( 'a.wt-review-link' ).click( function() {
|
353 |
});"
|
354 |
);
|
355 |
} else {
|
356 |
+
$footer_text = __('Thank you for your review.', 'order-import-export-for-woocommerce');
|
357 |
}
|
358 |
}
|
359 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
|
|
4 |
Tags: Order Export, Order Import, WooCommerce Export Orders , WooCommerce Import Orders , Export Orders, Import Orders
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.0.3
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -21,7 +21,7 @@ This is perfect tool if you are migrating an existing shop on a different eComme
|
|
21 |
🔸 Import Coupons from CSV file.
|
22 |
🔸 Export Subscription Orders to CSV file(Premium Feature).
|
23 |
🔸 Import Subscription Orders from CSV file(Premium Feature).
|
24 |
-
🔸 Tested OK with WooCommerce 3.5.
|
25 |
|
26 |
<blockquote>
|
27 |
|
@@ -110,6 +110,15 @@ Yes. You can import or export order line item details.
|
|
110 |
|
111 |
== Changelog ==
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
= 1.4.0 =
|
114 |
* Tested OK with WC 3.5.3 and WP 5.0.3.
|
115 |
* Content Update.
|
@@ -206,6 +215,12 @@ Yes. You can import or export order line item details.
|
|
206 |
* Export /Import WooCommerce Orders.
|
207 |
|
208 |
== Upgrade Notice ==
|
209 |
-
= 1.4.
|
210 |
-
*
|
211 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
4 |
Tags: Order Export, Order Import, WooCommerce Export Orders , WooCommerce Import Orders , Export Orders, Import Orders
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.0.3
|
7 |
+
Stable tag: 1.4.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
21 |
🔸 Import Coupons from CSV file.
|
22 |
🔸 Export Subscription Orders to CSV file(Premium Feature).
|
23 |
🔸 Import Subscription Orders from CSV file(Premium Feature).
|
24 |
+
🔸 Tested OK with WooCommerce 3.5.4
|
25 |
|
26 |
<blockquote>
|
27 |
|
110 |
|
111 |
== Changelog ==
|
112 |
|
113 |
+
= 1.4.1 =
|
114 |
+
* Tools Updated.
|
115 |
+
* Help tab added.
|
116 |
+
* Bug fix: Import of 'download permissions'.
|
117 |
+
* Bug fix: 2 blank meta columns on coupon export.
|
118 |
+
* All sample CSVs updated.
|
119 |
+
* Order date supports formats, 'd-m-y H:i' & 'Y-m-d H:i:s'.
|
120 |
+
* WC 3.5.4 compatibility.
|
121 |
+
* Language translation supported.
|
122 |
= 1.4.0 =
|
123 |
* Tested OK with WC 3.5.3 and WP 5.0.3.
|
124 |
* Content Update.
|
215 |
* Export /Import WooCommerce Orders.
|
216 |
|
217 |
== Upgrade Notice ==
|
218 |
+
= 1.4.1 =
|
219 |
+
* Tools Updated.
|
220 |
+
* Help tab added.
|
221 |
+
* Bug fix: Import of 'download permissions'.
|
222 |
+
* Bug fix: 2 blank meta columns on coupon export.
|
223 |
+
* All sample CSVs updated.
|
224 |
+
* Order date supports formats, 'd-m-y H:i' & 'Y-m-d H:i:s'.
|
225 |
+
* WC 3.5.4 compatibility.
|
226 |
+
* Language translation supported.
|
styles/wf-style.css
CHANGED
@@ -125,7 +125,21 @@
|
|
125 |
}
|
126 |
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
|
|
|
|
|
|
|
|
129 |
|
130 |
|
131 |
|
125 |
}
|
126 |
|
127 |
|
128 |
+
.rTable { display: table;}
|
129 |
+
.rTableRow { display: table-row; }
|
130 |
+
.rTableCell { display: table-cell; }
|
131 |
+
.rTable {
|
132 |
+
display: table;
|
133 |
+
width: 97.5%;
|
134 |
+
}
|
135 |
+
.rTableRow {
|
136 |
+
display: table-row;
|
137 |
+
}
|
138 |
|
139 |
+
.rTableCell {
|
140 |
+
display: table-cell;
|
141 |
+
border: none;
|
142 |
+
}
|
143 |
|
144 |
|
145 |
|