Version Description
2022-04-05 = * Enhancement: Option to - Update stock status and sales count of products upon order import. * Enhancement: Compatibility with WooCommerce shipment tracking and Advanced Shipment Tracking for WooCommerce.
Download this release
Release Info
Developer | webtoffee |
Plugin | Order Export & Order Import for WooCommerce |
Version | 2.2.2 |
Comparing to | |
See all releases |
Code changes from version 2.2.1 to 2.2.2
- admin/class-wt-import-export-for-woo-admin.php +52 -10
- admin/classes/class-csvwriter.php +9 -2
- admin/css/wt-import-export-for-woo-admin.css +1 -0
- admin/modules/coupon/import/import.php +1 -1
- admin/modules/export/assets/js/main.js +14 -1
- admin/modules/export/export.php +15 -3
- admin/modules/export/views/_export_post_type_page.php +34 -0
- admin/modules/import/assets/js/main.js +13 -2
- admin/modules/import/views/_import_post_type_page.php +34 -0
- admin/modules/order/data/data-order-post-columns.php +4 -0
- admin/modules/order/data/data/data-wf-reserved-fields-pair.php +5 -1
- admin/modules/order/export/export.php +11 -3
- admin/modules/order/import/import.php +36 -8
- admin/modules/order/order.php +17 -3
- includes/class-wt-import-export-for-woo.php +3 -1
- order-import-export-for-woocommerce.php +3 -3
- readme.txt +10 -4
admin/class-wt-import-export-for-woo-admin.php
CHANGED
@@ -103,6 +103,15 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
|
|
103 |
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-tiptip', WT_O_IEW_PLUGIN_URL.'admin/js/tiptip.js', array('jquery'), WT_O_IEW_VERSION, false);
|
104 |
}
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
$params=array(
|
107 |
'nonces' => array(
|
108 |
'main' => wp_create_nonce(WT_IEW_PLUGIN_ID_BASIC),
|
@@ -128,43 +137,50 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
|
|
128 |
'url' => "https://www.webtoffee.com/product/order-import-export-plugin-for-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Order_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
129 |
'name' => __('Order, Coupon, Subscription Export Import for WooCommerce'),
|
130 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/order-ie.svg',
|
131 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/03/Order_SampleCSV.csv"
|
|
|
132 |
),
|
133 |
'coupon' => array(
|
134 |
'url' => "https://www.webtoffee.com/product/order-import-export-plugin-for-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Order_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
135 |
'name' => __('Order, Coupon, Subscription Export Import for WooCommerce'),
|
136 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/order-ie.svg',
|
137 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2016/09/Coupon_Sample_CSV.csv"
|
|
|
138 |
),
|
139 |
'product' => array(
|
140 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
141 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
142 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
143 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/03/Product_SampleCSV.csv"
|
|
|
144 |
),
|
145 |
'product_review' => array(
|
146 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
147 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
148 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
149 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/04/product_review_SampleCSV.csv"
|
|
|
150 |
),
|
151 |
'product_categories' => array(
|
152 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
153 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
154 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
155 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/09/Sample-CSV-of-product-categories.csv"
|
|
|
156 |
),
|
157 |
'product_tags' => array(
|
158 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
159 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
160 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
161 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/09/Sample-CSV-with-product-tags.csv"
|
|
|
162 |
),
|
163 |
'user' => array(
|
164 |
'url' => "https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=User_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
165 |
'name' => __('WordPress Users & WooCommerce Customers Import Export'),
|
166 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/user-ie.svg',
|
167 |
-
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2020/10/Sample_Users.csv"
|
|
|
168 |
)
|
169 |
)
|
170 |
);
|
@@ -274,7 +290,7 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
|
|
274 |
$new_advanced_settings[$field_name]=Wt_Iew_Sh::sanitize_data($_POST[$field_name], $validation_key, $validation_rule);
|
275 |
}
|
276 |
}
|
277 |
-
$checkbox_items = array( 'wt_iew_enable_import_log', 'wt_iew_enable_history_auto_delete' );
|
278 |
foreach ( $checkbox_items as $checkbox_item ){
|
279 |
$new_advanced_settings[$checkbox_item] = isset( $new_advanced_settings[$checkbox_item] ) ? $new_advanced_settings[$checkbox_item] : 0;
|
280 |
}
|
@@ -443,8 +459,34 @@ class Wt_Import_Export_For_Woo_Admin_Basic {
|
|
443 |
return $links;
|
444 |
}
|
445 |
|
446 |
-
|
447 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
* Search for coupons and return json.
|
449 |
*/
|
450 |
public static function ajax_coupon_search() {
|
103 |
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-tiptip', WT_O_IEW_PLUGIN_URL.'admin/js/tiptip.js', array('jquery'), WT_O_IEW_VERSION, false);
|
104 |
}
|
105 |
|
106 |
+
$product_addon_active_status = false;
|
107 |
+
$user_addon_active_status = false;
|
108 |
+
if(is_plugin_active( 'product-import-export-for-woo/product-import-export-for-woo.php' )){
|
109 |
+
$product_addon_active_status = true;
|
110 |
+
}
|
111 |
+
if(is_plugin_active( 'users-customers-import-export-for-wp-woocommerce/users-customers-import-export-for-wp-woocommerce.php' )){
|
112 |
+
$user_addon_active_status = true;
|
113 |
+
}
|
114 |
+
|
115 |
$params=array(
|
116 |
'nonces' => array(
|
117 |
'main' => wp_create_nonce(WT_IEW_PLUGIN_ID_BASIC),
|
137 |
'url' => "https://www.webtoffee.com/product/order-import-export-plugin-for-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Order_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
138 |
'name' => __('Order, Coupon, Subscription Export Import for WooCommerce'),
|
139 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/order-ie.svg',
|
140 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/03/Order_SampleCSV.csv",
|
141 |
+
'is_active' => true
|
142 |
),
|
143 |
'coupon' => array(
|
144 |
'url' => "https://www.webtoffee.com/product/order-import-export-plugin-for-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Order_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
145 |
'name' => __('Order, Coupon, Subscription Export Import for WooCommerce'),
|
146 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/order-ie.svg',
|
147 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2016/09/Coupon_Sample_CSV.csv",
|
148 |
+
'is_active' => true
|
149 |
),
|
150 |
'product' => array(
|
151 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
152 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
153 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
154 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/03/Product_SampleCSV.csv",
|
155 |
+
'is_active' => $product_addon_active_status
|
156 |
),
|
157 |
'product_review' => array(
|
158 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
159 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
160 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
161 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/04/product_review_SampleCSV.csv",
|
162 |
+
'is_active' => $product_addon_active_status
|
163 |
),
|
164 |
'product_categories' => array(
|
165 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
166 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
167 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
168 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/09/Sample-CSV-of-product-categories.csv",
|
169 |
+
'is_active' => $product_addon_active_status
|
170 |
),
|
171 |
'product_tags' => array(
|
172 |
'url' => "https://www.webtoffee.com/product/product-import-export-woocommerce/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=Product_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
173 |
'name' => __('Product Import Export Plugin For WooCommerce'),
|
174 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/product-ie.svg',
|
175 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2021/09/Sample-CSV-with-product-tags.csv",
|
176 |
+
'is_active' => $product_addon_active_status
|
177 |
),
|
178 |
'user' => array(
|
179 |
'url' => "https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=free_plugin_revamp&utm_medium=basic_revamp&utm_campaign=User_Import_Export&utm_content=" . WT_O_IEW_VERSION,
|
180 |
'name' => __('WordPress Users & WooCommerce Customers Import Export'),
|
181 |
'icon_url' => WT_O_IEW_PLUGIN_URL.'assets/images/gopro/user-ie.svg',
|
182 |
+
'sample_csv_url' => "https://www.webtoffee.com/wp-content/uploads/2020/10/Sample_Users.csv",
|
183 |
+
'is_active' => $user_addon_active_status
|
184 |
)
|
185 |
)
|
186 |
);
|
290 |
$new_advanced_settings[$field_name]=Wt_Iew_Sh::sanitize_data($_POST[$field_name], $validation_key, $validation_rule);
|
291 |
}
|
292 |
}
|
293 |
+
$checkbox_items = array( 'wt_iew_enable_import_log', 'wt_iew_enable_history_auto_delete', 'wt_iew_include_bom' );
|
294 |
foreach ( $checkbox_items as $checkbox_item ){
|
295 |
$new_advanced_settings[$checkbox_item] = isset( $new_advanced_settings[$checkbox_item] ) ? $new_advanced_settings[$checkbox_item] : 0;
|
296 |
}
|
459 |
return $links;
|
460 |
}
|
461 |
|
462 |
+
public function tools_wtexport_text(){
|
463 |
+
|
464 |
+
echo "<p><b>" . sprintf( __( 'Export WooCommerce orders and coupons in CSV format using <a href="%s">this exporter</a>.' ), admin_url( 'admin.php?page=wt_import_export_for_woo_basic_export' ) ) . "</b></p>";
|
465 |
+
|
466 |
+
if( !is_plugin_active( 'users-customers-import-export-for-wp-woocommerce/users-customers-import-export-for-wp-woocommerce.php' ) ){
|
467 |
+
echo "<p><b>" . sprintf(
|
468 |
+
/* translators: %s: User Import Export for WooCommerce plugin URL */
|
469 |
+
__( 'You can export Users and WooCommerce customers in CSV format using the plugin <a href="%s" target="_blank">Import Export WordPress Users and WooCommerce Customers</a>.' ),
|
470 |
+
admin_url('plugin-install.php?tab=plugin-information&plugin=users-customers-import-export-for-wp-woocommerce')
|
471 |
+
) . "</b></p>";
|
472 |
+
}else{
|
473 |
+
echo "<p><b>" . sprintf( __( 'Export Users and WooCommerce customers in CSV format using <a href="%s">this exporter</a>.' ), admin_url( 'admin.php?page=wt_import_export_for_woo_basic_export' ) ) . "</b></p>";
|
474 |
+
}
|
475 |
+
|
476 |
+
if( !is_plugin_active( 'product-import-export-for-woo/product-import-export-for-woo.php' ) ){
|
477 |
+
echo "<p><b>" . sprintf(
|
478 |
+
/* translators: %s: Product Import Export for WooCommerce plugin URL */
|
479 |
+
__( 'You can export WooCommerce products, product categories, product tags and product reviews in CSV format using the plugin <a href="%s" target="_blank">Product Import Export for WooCommerce</a>.' ),
|
480 |
+
admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
481 |
+
) . "</b></p>";
|
482 |
+
}else{
|
483 |
+
echo "<p><b>" . sprintf( __( 'Export WooCommerce products, product categories, product tags and product reviews in CSV format using <a href="%s">this exporter</a>.' ), admin_url( 'admin.php?page=wt_import_export_for_woo_basic_export' ) ) . "</b></p>";
|
484 |
+
}
|
485 |
+
|
486 |
+
}
|
487 |
+
|
488 |
+
|
489 |
+
/**
|
490 |
* Search for coupons and return json.
|
491 |
*/
|
492 |
public static function ajax_coupon_search() {
|
admin/classes/class-csvwriter.php
CHANGED
@@ -15,10 +15,12 @@ class Wt_Import_Export_For_Woo_Basic_Csvwriter
|
|
15 |
public $file_path='';
|
16 |
public $data_ar='';
|
17 |
public $csv_delimiter='';
|
18 |
-
public
|
|
|
19 |
{
|
20 |
$this->csv_delimiter=$csv_delimiter;
|
21 |
$this->file_path=$file_path;
|
|
|
22 |
$this->get_file_pointer($offset);
|
23 |
}
|
24 |
|
@@ -55,7 +57,12 @@ class Wt_Import_Export_For_Woo_Basic_Csvwriter
|
|
55 |
{
|
56 |
if($offset==0)
|
57 |
{
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
59 |
}else
|
60 |
{
|
61 |
$this->file_pointer=fopen($this->file_path, 'a+');
|
15 |
public $file_path='';
|
16 |
public $data_ar='';
|
17 |
public $csv_delimiter='';
|
18 |
+
public $use_bom=true;
|
19 |
+
public function __construct($file_path, $offset, $csv_delimiter=",", $use_bom=true)
|
20 |
{
|
21 |
$this->csv_delimiter=$csv_delimiter;
|
22 |
$this->file_path=$file_path;
|
23 |
+
$this->use_bom = $use_bom;
|
24 |
$this->get_file_pointer($offset);
|
25 |
}
|
26 |
|
57 |
{
|
58 |
if($offset==0)
|
59 |
{
|
60 |
+
$this->file_pointer=fopen($this->file_path, 'w');
|
61 |
+
$this->use_bom = apply_filters('wt_ier_include_bom_in_csv', $this->use_bom);
|
62 |
+
if($this->use_bom){
|
63 |
+
$BOM = "\xEF\xBB\xBF"; // UTF-8 BOM
|
64 |
+
fwrite($this->file_pointer, $BOM); // NEW LINE
|
65 |
+
}
|
66 |
}else
|
67 |
{
|
68 |
$this->file_pointer=fopen($this->file_path, 'a+');
|
admin/css/wt-import-export-for-woo-admin.css
CHANGED
@@ -181,6 +181,7 @@
|
|
181 |
|
182 |
.wt_iew_warn_box{padding:20px; padding-bottom:0px;}
|
183 |
.wt_iew_warn{ display:inline-block; width:100%; box-sizing:border-box; padding:10px; background-color:#fff8e5; border-left:solid 2px #ffb900; color:#333; }
|
|
|
184 |
.wt_iew_rerun_warn{ width:95%; margin:30px 2.5%; }
|
185 |
|
186 |
.wt_iew_info_box{padding:20px; padding-bottom:0px;}
|
181 |
|
182 |
.wt_iew_warn_box{padding:20px; padding-bottom:0px;}
|
183 |
.wt_iew_warn{ display:inline-block; width:100%; box-sizing:border-box; padding:10px; background-color:#fff8e5; border-left:solid 2px #ffb900; color:#333; }
|
184 |
+
.wt_iew_free_addon_warn{ display:inline-block; width:100%; box-sizing:border-box; padding:10px; background-color:#fff8e5; border:solid 1px #ffb900; color:#333; text-align: center; }
|
185 |
.wt_iew_rerun_warn{ width:95%; margin:30px 2.5%; }
|
186 |
|
187 |
.wt_iew_info_box{padding:20px; padding-bottom:0px;}
|
admin/modules/coupon/import/import.php
CHANGED
@@ -825,7 +825,7 @@ class Wt_Import_Export_For_Woo_Basic_Coupon_Import {
|
|
825 |
|
826 |
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Found coupon object. ID:".$coupon_object->get_id());
|
827 |
|
828 |
-
$boolean_keys = apply_filters('wt_ier_coupon_boolean_keys', array('exclude_sale_items', 'individual_use', 'free_shipping'));
|
829 |
|
830 |
foreach ($data as $key => $value) {
|
831 |
|
825 |
|
826 |
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Found coupon object. ID:".$coupon_object->get_id());
|
827 |
|
828 |
+
$boolean_keys = apply_filters( 'wt_ier_coupon_boolean_keys', array( 'exclude_sale_items', 'individual_use', 'free_shipping', 'date_expires' ) );
|
829 |
|
830 |
foreach ($data as $key => $value) {
|
831 |
|
admin/modules/export/assets/js/main.js
CHANGED
@@ -635,13 +635,26 @@ var wt_iew_basic_export=(function( $ ) {
|
|
635 |
$('.wt-ierpro-name>img').attr("src", wt_iew_basic_params.pro_plugins[this.to_export]['icon_url']);
|
636 |
$('.wt-ier-gopro-cta').hide();
|
637 |
$('.wt-ier-'+this.to_export).show();
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
},
|
639 |
page_actions:function(step)
|
640 |
{
|
641 |
if(step=='post_type') /* post type page */
|
642 |
{
|
643 |
$('[name="wt_iew_export_post_type"]').unbind('change').change(function(){
|
644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
645 |
wt_iew_basic_export.to_export_title='';
|
646 |
wt_iew_basic_export.reset_form_data();
|
647 |
$('.wt_iew_post_type_name').html('');
|
635 |
$('.wt-ierpro-name>img').attr("src", wt_iew_basic_params.pro_plugins[this.to_export]['icon_url']);
|
636 |
$('.wt-ier-gopro-cta').hide();
|
637 |
$('.wt-ier-'+this.to_export).show();
|
638 |
+
$('.wt_iew_free_addon').hide();
|
639 |
+
$('.wt_iew_export_action_btn').prop('disabled', false);
|
640 |
+
if(!wt_iew_basic_params.pro_plugins[this.to_export]['is_active']){
|
641 |
+
$('.wt_iew_type_'+this.to_export).show();
|
642 |
+
$('.wt_iew_export_action_btn').prop('disabled', true);
|
643 |
+
}
|
644 |
},
|
645 |
page_actions:function(step)
|
646 |
{
|
647 |
if(step=='post_type') /* post type page */
|
648 |
{
|
649 |
$('[name="wt_iew_export_post_type"]').unbind('change').change(function(){
|
650 |
+
|
651 |
+
if (!wt_iew_basic_params.pro_plugins[$(this).val()]['is_active']) {
|
652 |
+
$('.wt_iew_export_action_btn').prop('disabled', true);
|
653 |
+
$('.wt_iew_type_' + this.to_export).show();
|
654 |
+
}
|
655 |
+
|
656 |
+
|
657 |
+
wt_iew_basic_export.to_export=$(this).val();
|
658 |
wt_iew_basic_export.to_export_title='';
|
659 |
wt_iew_basic_export.reset_form_data();
|
660 |
$('.wt_iew_post_type_name').html('');
|
admin/modules/export/export.php
CHANGED
@@ -30,6 +30,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
|
|
30 |
public $default_batch_count=0; /* configure this value in `advanced_setting_fields` method */
|
31 |
public $selected_template_data=array();
|
32 |
public $default_export_method=''; /* configure this value in `advanced_setting_fields` method */
|
|
|
33 |
public $form_data=array();
|
34 |
|
35 |
public function __construct()
|
@@ -105,6 +106,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
|
|
105 |
{
|
106 |
$this->default_export_method= Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_method');
|
107 |
$this->default_batch_count=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_batch');
|
|
|
108 |
}
|
109 |
|
110 |
/**
|
@@ -123,6 +125,17 @@ class Wt_Import_Export_For_Woo_Basic_Export
|
|
123 |
'field_group'=>'advanced_field',
|
124 |
'help_text'=>__('Select the default method of export.'),
|
125 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
$fields['default_export_batch']=array(
|
127 |
'label'=>__("Default Export batch count"),
|
128 |
'type'=>'number',
|
@@ -591,8 +604,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
|
|
591 |
array("abc"=>"Abc1", "bcd"=>"Bcd1", "cde"=>"Cde1", "def"=>"Def1"),
|
592 |
array("abc"=>"Abc2", "bcd"=>"Bcd2", "cde"=>"Cde2", "def"=>"Def2")
|
593 |
),
|
594 |
-
);
|
595 |
-
|
596 |
/* in scheduled export. The export method will not available so we need to take it from form_data */
|
597 |
$form_data_export_method=(isset($form_data['method_export_form_data']) && isset($form_data['method_export_form_data']['method_export']) ? $form_data['method_export_form_data']['method_export'] : $this->default_export_method);
|
598 |
$this->export_method=($this->export_method=="" ? $form_data_export_method : $this->export_method);
|
@@ -621,7 +633,7 @@ class Wt_Import_Export_For_Woo_Basic_Export
|
|
621 |
{
|
622 |
|
623 |
include_once WT_O_IEW_PLUGIN_PATH.'admin/classes/class-csvwriter.php';
|
624 |
-
$writer=new Wt_Import_Export_For_Woo_Basic_Csvwriter($file_path, $offset, $csv_delimiter);
|
625 |
|
626 |
|
627 |
/**
|
30 |
public $default_batch_count=0; /* configure this value in `advanced_setting_fields` method */
|
31 |
public $selected_template_data=array();
|
32 |
public $default_export_method=''; /* configure this value in `advanced_setting_fields` method */
|
33 |
+
public $use_bom = true;
|
34 |
public $form_data=array();
|
35 |
|
36 |
public function __construct()
|
106 |
{
|
107 |
$this->default_export_method= Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_method');
|
108 |
$this->default_batch_count=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_batch');
|
109 |
+
$this->use_bom = (bool)Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('include_bom');
|
110 |
}
|
111 |
|
112 |
/**
|
125 |
'field_group'=>'advanced_field',
|
126 |
'help_text'=>__('Select the default method of export.'),
|
127 |
);
|
128 |
+
|
129 |
+
$fields['include_bom'] = array(
|
130 |
+
'label'=>__( "Include BOM in export file" ),
|
131 |
+
'value'=>1,
|
132 |
+
'checkbox_fields' => array( 1 => __( 'Enable' ) ),
|
133 |
+
'type'=>'checkbox',
|
134 |
+
'field_name'=>'include_bom',
|
135 |
+
'field_group'=>'advanced_field',
|
136 |
+
'help_text'=>__( "The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters." ),
|
137 |
+
);
|
138 |
+
|
139 |
$fields['default_export_batch']=array(
|
140 |
'label'=>__("Default Export batch count"),
|
141 |
'type'=>'number',
|
604 |
array("abc"=>"Abc1", "bcd"=>"Bcd1", "cde"=>"Cde1", "def"=>"Def1"),
|
605 |
array("abc"=>"Abc2", "bcd"=>"Bcd2", "cde"=>"Cde2", "def"=>"Def2")
|
606 |
),
|
607 |
+
);
|
|
|
608 |
/* in scheduled export. The export method will not available so we need to take it from form_data */
|
609 |
$form_data_export_method=(isset($form_data['method_export_form_data']) && isset($form_data['method_export_form_data']['method_export']) ? $form_data['method_export_form_data']['method_export'] : $this->default_export_method);
|
610 |
$this->export_method=($this->export_method=="" ? $form_data_export_method : $this->export_method);
|
633 |
{
|
634 |
|
635 |
include_once WT_O_IEW_PLUGIN_PATH.'admin/classes/class-csvwriter.php';
|
636 |
+
$writer=new Wt_Import_Export_For_Woo_Basic_Csvwriter($file_path, $offset, $csv_delimiter, $this->use_bom);
|
637 |
|
638 |
|
639 |
/**
|
admin/modules/export/views/_export_post_type_page.php
CHANGED
@@ -27,4 +27,38 @@ if (!defined('ABSPATH')) {
|
|
27 |
<td></td>
|
28 |
</tr>
|
29 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</div>
|
27 |
<td></td>
|
28 |
</tr>
|
29 |
</table>
|
30 |
+
<br/>
|
31 |
+
<?php
|
32 |
+
$wt_iew_post_types = array(
|
33 |
+
'product' => array(
|
34 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Products.'),
|
35 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
36 |
+
),
|
37 |
+
'product_review' => array(
|
38 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product reviews.'),
|
39 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
40 |
+
),
|
41 |
+
'product_categories' => array(
|
42 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product categories.'),
|
43 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
44 |
+
),
|
45 |
+
'product_tags' => array(
|
46 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product tags.'),
|
47 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
48 |
+
),
|
49 |
+
'user' => array(
|
50 |
+
'message' => __('The <b>Import Export WordPress Users and WooCommerce Customers Add-On</b> is required to export users/customers.'),
|
51 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=users-customers-import-export-for-wp-woocommerce')
|
52 |
+
)
|
53 |
+
);
|
54 |
+
foreach ($wt_iew_post_types as $wt_iew_post_type => $wt_iew_post_type_detail) { ?>
|
55 |
+
|
56 |
+
<div class="wt_iew_free_addon wt_iew_free_addon_warn <?php echo 'wt_iew_type_'.$wt_iew_post_type; ?>" style="display:none">
|
57 |
+
<p><?php echo $wt_iew_post_type_detail['message']; ?></p>
|
58 |
+
<a target="_blank" href="<?php echo $wt_iew_post_type_detail['link']; ?>"><?php _e( 'Install now for free' ); ?></a>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
?>
|
64 |
</div>
|
admin/modules/import/assets/js/main.js
CHANGED
@@ -787,13 +787,24 @@ var wt_iew_basic_import=(function( $ ) {
|
|
787 |
$('#user-required-field-message').show();
|
788 |
|
789 |
$('.wt-ier-gopro-cta').hide();
|
790 |
-
$('.wt-ier-'+this.to_import).show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
},
|
792 |
page_actions:function(step)
|
793 |
{
|
794 |
if(step=='post_type') /* post type page */
|
795 |
{
|
796 |
-
$('[name="wt_iew_import_post_type"]').unbind('change').change(function(){
|
|
|
|
|
|
|
|
|
797 |
wt_iew_basic_import.to_import=$(this).val();
|
798 |
wt_iew_basic_import.to_import_title='';
|
799 |
wt_iew_basic_import.reset_form_data();
|
787 |
$('#user-required-field-message').show();
|
788 |
|
789 |
$('.wt-ier-gopro-cta').hide();
|
790 |
+
$('.wt-ier-'+this.to_import).show();
|
791 |
+
|
792 |
+
$('.wt_iew_free_addon').hide();
|
793 |
+
$('.wt_iew_import_action_btn').prop('disabled', false);
|
794 |
+
if(!wt_iew_basic_params.pro_plugins[this.to_import]['is_active']){
|
795 |
+
$('.wt_iew_type_'+this.to_import).show();
|
796 |
+
$('.wt_iew_import_action_btn').prop('disabled', true);
|
797 |
+
}
|
798 |
},
|
799 |
page_actions:function(step)
|
800 |
{
|
801 |
if(step=='post_type') /* post type page */
|
802 |
{
|
803 |
+
$('[name="wt_iew_import_post_type"]').unbind('change').change(function(){
|
804 |
+
if (!wt_iew_basic_params.pro_plugins[$(this).val()]['is_active']) {
|
805 |
+
$('.wt_iew_import_action_btn').prop('disabled', true);
|
806 |
+
$('.wt_iew_type_' + this.to_import).show();
|
807 |
+
}
|
808 |
wt_iew_basic_import.to_import=$(this).val();
|
809 |
wt_iew_basic_import.to_import_title='';
|
810 |
wt_iew_basic_import.reset_form_data();
|
admin/modules/import/views/_import_post_type_page.php
CHANGED
@@ -28,4 +28,38 @@ if (!defined('ABSPATH')) {
|
|
28 |
<td></td>
|
29 |
</tr>
|
30 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
</div>
|
28 |
<td></td>
|
29 |
</tr>
|
30 |
</table>
|
31 |
+
<br/>
|
32 |
+
<?php
|
33 |
+
$wt_iew_post_types = array(
|
34 |
+
'product' => array(
|
35 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Products.'),
|
36 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
37 |
+
),
|
38 |
+
'product_review' => array(
|
39 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product reviews.'),
|
40 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
41 |
+
),
|
42 |
+
'product_categories' => array(
|
43 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product categories.'),
|
44 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
45 |
+
),
|
46 |
+
'product_tags' => array(
|
47 |
+
'message' => __('The <b>Product Import Export for WooCommerce Add-On</b> is required to export WooCommerce Product tags.'),
|
48 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=product-import-export-for-woo')
|
49 |
+
),
|
50 |
+
'user' => array(
|
51 |
+
'message' => __('The <b>Import Export WordPress Users and WooCommerce Customers Add-On</b> is required to export users/customers.'),
|
52 |
+
'link' => admin_url('plugin-install.php?tab=plugin-information&plugin=users-customers-import-export-for-wp-woocommerce')
|
53 |
+
)
|
54 |
+
);
|
55 |
+
foreach ($wt_iew_post_types as $wt_iew_post_type => $wt_iew_post_type_detail) { ?>
|
56 |
+
|
57 |
+
<div class="wt_iew_free_addon wt_iew_free_addon_warn <?php echo 'wt_iew_type_'.$wt_iew_post_type; ?>" style="display:none">
|
58 |
+
<p><?php echo $wt_iew_post_type_detail['message']; ?></p>
|
59 |
+
<a target="_blank" href="<?php echo $wt_iew_post_type_detail['link']; ?>"><?php _e( 'Install now for free' ); ?></a>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<?php
|
63 |
+
}
|
64 |
+
?>
|
65 |
</div>
|
admin/modules/order/data/data-order-post-columns.php
CHANGED
@@ -79,4 +79,8 @@ if (is_plugin_active('yith-woocommerce-order-tracking-premium/init.php')):
|
|
79 |
$base_columns['meta:ywot_picked_up'] = 'Order picked up?';
|
80 |
endif;
|
81 |
|
|
|
|
|
|
|
|
|
82 |
return apply_filters('hf_csv_order_post_columns', $base_columns);
|
79 |
$base_columns['meta:ywot_picked_up'] = 'Order picked up?';
|
80 |
endif;
|
81 |
|
82 |
+
if (class_exists('Zorem_Woocommerce_Advanced_Shipment_Tracking') || class_exists('WC_Shipment_Tracking')):
|
83 |
+
$base_columns['meta:_wc_shipment_tracking_items'] = 'Advanced/WC shipment tracking';
|
84 |
+
endif;
|
85 |
+
|
86 |
return apply_filters('hf_csv_order_post_columns', $base_columns);
|
admin/modules/order/data/data/data-wf-reserved-fields-pair.php
CHANGED
@@ -76,7 +76,11 @@ if (is_plugin_active('yith-woocommerce-order-tracking-premium/init.php')):
|
|
76 |
$base_reserved_columns['meta:ywot_tracking_postcode'] = array('title' => 'Tracking postcode', 'description' => 'YITH Tracking postcode');
|
77 |
$base_reserved_columns['meta:ywot_carrier_id'] = array('title' => 'Carrier name', 'description' => 'YITH Tracking carrier');
|
78 |
$base_reserved_columns['meta:ywot_pick_up_date'] = array('title' => 'Pickup date', 'description' => 'YITH pickup date');
|
79 |
-
$base_reserved_columns['meta:ywot_picked_up'] = array('title' => 'Order picked up?', 'description' => 'YITH Is Order picked up?');
|
|
|
|
|
|
|
|
|
80 |
endif;
|
81 |
|
82 |
// Reserved column names
|
76 |
$base_reserved_columns['meta:ywot_tracking_postcode'] = array('title' => 'Tracking postcode', 'description' => 'YITH Tracking postcode');
|
77 |
$base_reserved_columns['meta:ywot_carrier_id'] = array('title' => 'Carrier name', 'description' => 'YITH Tracking carrier');
|
78 |
$base_reserved_columns['meta:ywot_pick_up_date'] = array('title' => 'Pickup date', 'description' => 'YITH pickup date');
|
79 |
+
$base_reserved_columns['meta:ywot_picked_up'] = array('title' => 'Order picked up?', 'description' => 'YITH Is Order picked up?');
|
80 |
+
endif;
|
81 |
+
|
82 |
+
if (class_exists('Zorem_Woocommerce_Advanced_Shipment_Tracking') || class_exists('WC_Shipment_Tracking')):
|
83 |
+
$base_reserved_columns['meta:_wc_shipment_tracking_items'] = array('title' => 'Shipment Tracking', 'description' => 'Shipment tracking');
|
84 |
endif;
|
85 |
|
86 |
// Reserved column names
|
admin/modules/order/export/export.php
CHANGED
@@ -14,6 +14,7 @@ class Wt_Import_Export_For_Woo_Basic_Order_Export {
|
|
14 |
private $line_item_meta;
|
15 |
private $is_wt_invoice_active = false;
|
16 |
private $is_yith_tracking_active = false;
|
|
|
17 |
|
18 |
public function __construct($parent_object) {
|
19 |
|
@@ -28,9 +29,12 @@ class Wt_Import_Export_For_Woo_Basic_Order_Export {
|
|
28 |
if (is_plugin_active('print-invoices-packing-slip-labels-for-woocommerce/print-invoices-packing-slip-labels-for-woocommerce.php')):
|
29 |
$this->is_wt_invoice_active = true;
|
30 |
endif;
|
31 |
-
if (
|
|
|
|
|
|
|
32 |
$this->is_yith_tracking_active = true;
|
33 |
-
endif;
|
34 |
|
35 |
$max_line_items = $this->line_items_max_count;
|
36 |
|
@@ -764,7 +768,11 @@ class Wt_Import_Export_For_Woo_Basic_Order_Export {
|
|
764 |
$order_data['meta:ywot_carrier_id'] = empty($ywot_carrier_id) ? '' : $ywot_carrier_id;
|
765 |
$order_data['meta:ywot_pick_up_date'] = empty($ywot_pick_up_date) ? '' : $ywot_pick_up_date;
|
766 |
$order_data['meta:ywot_picked_up'] = empty($ywot_picked_up) ? '' : $ywot_picked_up;
|
767 |
-
endif;
|
|
|
|
|
|
|
|
|
768 |
|
769 |
$order_export_data = array();
|
770 |
foreach ($csv_columns as $key => $value) {
|
14 |
private $line_item_meta;
|
15 |
private $is_wt_invoice_active = false;
|
16 |
private $is_yith_tracking_active = false;
|
17 |
+
private $shipment_tracking_active = false;
|
18 |
|
19 |
public function __construct($parent_object) {
|
20 |
|
29 |
if (is_plugin_active('print-invoices-packing-slip-labels-for-woocommerce/print-invoices-packing-slip-labels-for-woocommerce.php')):
|
30 |
$this->is_wt_invoice_active = true;
|
31 |
endif;
|
32 |
+
if (class_exists('Zorem_Woocommerce_Advanced_Shipment_Tracking') || class_exists('WC_Shipment_Tracking')):
|
33 |
+
$this->shipment_tracking_active = true;
|
34 |
+
endif;
|
35 |
+
if (is_plugin_active('yith-woocommerce-order-tracking-premium/init.php')):
|
36 |
$this->is_yith_tracking_active = true;
|
37 |
+
endif;
|
38 |
|
39 |
$max_line_items = $this->line_items_max_count;
|
40 |
|
768 |
$order_data['meta:ywot_carrier_id'] = empty($ywot_carrier_id) ? '' : $ywot_carrier_id;
|
769 |
$order_data['meta:ywot_pick_up_date'] = empty($ywot_pick_up_date) ? '' : $ywot_pick_up_date;
|
770 |
$order_data['meta:ywot_picked_up'] = empty($ywot_picked_up) ? '' : $ywot_picked_up;
|
771 |
+
endif;
|
772 |
+
if ($this->shipment_tracking_active):
|
773 |
+
$advanced_shipment_tracking = get_post_meta($order_data['order_id'], '_wc_shipment_tracking_items', true);
|
774 |
+
$order_data['meta:_wc_shipment_tracking_items'] = empty($advanced_shipment_tracking) ? '' : json_encode($advanced_shipment_tracking);
|
775 |
+
endif;
|
776 |
|
777 |
$order_export_data = array();
|
778 |
foreach ($csv_columns as $key => $value) {
|
admin/modules/order/import/import.php
CHANGED
@@ -16,6 +16,7 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
16 |
public $merge_empty_cells;
|
17 |
public $delete_existing;
|
18 |
public $ord_link_using_sku;
|
|
|
19 |
public $create_user;
|
20 |
public $status_mail;
|
21 |
public $new_order_status;
|
@@ -45,6 +46,7 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
45 |
$this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_existing']) ? 1 : 0;
|
46 |
|
47 |
$this->ord_link_using_sku = !empty($form_data['advanced_form_data']['wt_iew_ord_link_using_sku']) ? 1 : 0;
|
|
|
48 |
$this->create_user = !empty($form_data['advanced_form_data']['wt_iew_create_user']) ? 1 : 0;
|
49 |
$this->notify_customer = !empty($form_data['advanced_form_data']['wt_iew_notify_customer']) ? 1 : 0;
|
50 |
$this->status_mail = !empty($form_data['advanced_form_data']['wt_iew_status_mail']) ? 1 : 0;
|
@@ -447,7 +449,13 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
447 |
if ('meta:ywot_picked_up' == $column ) {
|
448 |
$this->item_data['meta_data'][] = array('key'=>'ywot_picked_up', 'value'=> $value);
|
449 |
continue;
|
450 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
|
452 |
if(strstr($column, 'line_item_')){
|
453 |
$this->item_data['order_items'][] = $this->wt_parse_line_item_field($value,$column);
|
@@ -1453,7 +1461,7 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
1453 |
// woocommerce/includes/class-wc-order.php:218 -> parent::save(); woocommerce/includes/abstracts/abstract_wc_order.php:168 -> $this->data_store->create( $this ); woocommerce/includes/data-store/abstract-wc-order-data-store-cpt.php:58
|
1454 |
|
1455 |
add_action( 'woocommerce_email', array($this, 'wt_iew_order_import_unhook_woocommerce_email') ); // disabled all order related email sending. Need to implimet a way to send status change email based on $this->status_mail flag
|
1456 |
-
|
1457 |
|
1458 |
remove_all_actions('woocommerce_order_status_refunded_notification');
|
1459 |
remove_all_actions('woocommerce_order_partially_refunded_notification');
|
@@ -1571,6 +1579,9 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
1571 |
$order_item_id = wc_add_order_item($order_id, $order_item);
|
1572 |
if ($order_item_id) {
|
1573 |
foreach ($order_item_meta[$key] as $meta_key => $meta_value) {
|
|
|
|
|
|
|
1574 |
wc_add_order_item_meta($order_item_id, $meta_key, maybe_unserialize($meta_value));
|
1575 |
}
|
1576 |
}
|
@@ -1805,16 +1816,31 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
1805 |
|
1806 |
$order = apply_filters('wt_woocommerce_import_pre_insert_order_object', $order, $data);
|
1807 |
|
1808 |
-
|
1809 |
-
|
1810 |
$order->save();
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1814 |
$result = array(
|
1815 |
'id' => $order->get_id(),
|
1816 |
'updated' => $this->merge,
|
1817 |
-
);
|
|
|
1818 |
return $result;
|
1819 |
} catch (Exception $e) {
|
1820 |
return new WP_Error('woocommerce_product_importer_error', $e->getMessage(), array('status' => $e->getCode()));
|
@@ -2022,6 +2048,8 @@ class Wt_Import_Export_For_Woo_Basic_Order_Import {
|
|
2022 |
remove_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
|
2023 |
remove_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
|
2024 |
|
|
|
|
|
2025 |
// Processing emails
|
2026 |
remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
|
2027 |
remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
|
16 |
public $merge_empty_cells;
|
17 |
public $delete_existing;
|
18 |
public $ord_link_using_sku;
|
19 |
+
public $update_stock_details;
|
20 |
public $create_user;
|
21 |
public $status_mail;
|
22 |
public $new_order_status;
|
46 |
$this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_existing']) ? 1 : 0;
|
47 |
|
48 |
$this->ord_link_using_sku = !empty($form_data['advanced_form_data']['wt_iew_ord_link_using_sku']) ? 1 : 0;
|
49 |
+
$this->update_stock_details = !empty($form_data['advanced_form_data']['wt_iew_update_stock_details']) ? 1 : 0;
|
50 |
$this->create_user = !empty($form_data['advanced_form_data']['wt_iew_create_user']) ? 1 : 0;
|
51 |
$this->notify_customer = !empty($form_data['advanced_form_data']['wt_iew_notify_customer']) ? 1 : 0;
|
52 |
$this->status_mail = !empty($form_data['advanced_form_data']['wt_iew_status_mail']) ? 1 : 0;
|
449 |
if ('meta:ywot_picked_up' == $column ) {
|
450 |
$this->item_data['meta_data'][] = array('key'=>'ywot_picked_up', 'value'=> $value);
|
451 |
continue;
|
452 |
+
}
|
453 |
+
if ('meta:_wc_shipment_tracking_items' == $column ) {
|
454 |
+
if(!empty($value)){
|
455 |
+
$this->item_data['meta_data'][] = array('key'=>'_wc_shipment_tracking_items', 'value'=> json_decode($value, true) );
|
456 |
+
}
|
457 |
+
continue;
|
458 |
+
}
|
459 |
|
460 |
if(strstr($column, 'line_item_')){
|
461 |
$this->item_data['order_items'][] = $this->wt_parse_line_item_field($value,$column);
|
1461 |
// woocommerce/includes/class-wc-order.php:218 -> parent::save(); woocommerce/includes/abstracts/abstract_wc_order.php:168 -> $this->data_store->create( $this ); woocommerce/includes/data-store/abstract-wc-order-data-store-cpt.php:58
|
1462 |
|
1463 |
add_action( 'woocommerce_email', array($this, 'wt_iew_order_import_unhook_woocommerce_email') ); // disabled all order related email sending. Need to implimet a way to send status change email based on $this->status_mail flag
|
1464 |
+
remove_all_actions('woocommerce_email_attachments');
|
1465 |
|
1466 |
remove_all_actions('woocommerce_order_status_refunded_notification');
|
1467 |
remove_all_actions('woocommerce_order_partially_refunded_notification');
|
1579 |
$order_item_id = wc_add_order_item($order_id, $order_item);
|
1580 |
if ($order_item_id) {
|
1581 |
foreach ($order_item_meta[$key] as $meta_key => $meta_value) {
|
1582 |
+
if( '_reduced_stock' === $meta_key && $this->update_stock_details ){
|
1583 |
+
continue;
|
1584 |
+
}
|
1585 |
wc_add_order_item_meta($order_item_id, $meta_key, maybe_unserialize($meta_value));
|
1586 |
}
|
1587 |
}
|
1816 |
|
1817 |
$order = apply_filters('wt_woocommerce_import_pre_insert_order_object', $order, $data);
|
1818 |
|
|
|
|
|
1819 |
$order->save();
|
1820 |
+
|
1821 |
+
if ($this->update_stock_details) {
|
1822 |
+
$donot_reduce_statuses = apply_filters( 'wt_iew_order_import_donot_reduce_statuses', array( 'refunded', 'cancelled', 'failed' ) );
|
1823 |
+
if (!in_array($order->get_status(), $donot_reduce_statuses)) {
|
1824 |
+
wc_reduce_stock_levels($order->get_id());
|
1825 |
+
if (count($order->get_items()) > 0) {
|
1826 |
+
foreach ($order->get_items() as $item) {
|
1827 |
+
$product_id = $item->get_product_id();
|
1828 |
+
if ($product_id) {
|
1829 |
+
$data_store = WC_Data_Store::load('product');
|
1830 |
+
$data_store->update_product_sales($product_id, absint($item->get_quantity()), 'increase');
|
1831 |
+
}
|
1832 |
+
}
|
1833 |
+
}
|
1834 |
+
}
|
1835 |
+
}
|
1836 |
+
|
1837 |
+
do_action('wt_woocommerce_order_import_inserted_object', $order, $data);
|
1838 |
+
|
1839 |
$result = array(
|
1840 |
'id' => $order->get_id(),
|
1841 |
'updated' => $this->merge,
|
1842 |
+
);
|
1843 |
+
|
1844 |
return $result;
|
1845 |
} catch (Exception $e) {
|
1846 |
return new WP_Error('woocommerce_product_importer_error', $e->getMessage(), array('status' => $e->getCode()));
|
2048 |
remove_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
|
2049 |
remove_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
|
2050 |
|
2051 |
+
remove_action( 'woocommerce_order_status_pending_to_processing', array( 'WC_Emails', 'queue_transactional_email' ) );
|
2052 |
+
|
2053 |
// Processing emails
|
2054 |
remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
|
2055 |
remove_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
|
admin/modules/order/order.php
CHANGED
@@ -56,7 +56,7 @@ class Wt_Import_Export_For_Woo_Basic_Order {
|
|
56 |
add_filter('wt_iew_exporter_alter_mapping_fields_basic', array($this, 'exporter_alter_mapping_fields'), 10, 3);
|
57 |
add_filter('wt_iew_importer_alter_mapping_fields_basic', array($this, 'get_importer_post_columns'), 10, 3);
|
58 |
|
59 |
-
|
60 |
|
61 |
add_filter('wt_iew_exporter_alter_advanced_fields_basic', array($this, 'exporter_alter_advanced_fields'), 10, 3);
|
62 |
add_filter('wt_iew_importer_alter_advanced_fields_basic', array($this, 'importer_alter_advanced_fields'), 10, 3);
|
@@ -149,6 +149,12 @@ class Wt_Import_Export_For_Woo_Basic_Order {
|
|
149 |
*/
|
150 |
public function wt_iew_exporter_post_types_basic($arr) {
|
151 |
$arr['order'] = __('Order');
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
return $arr;
|
153 |
}
|
154 |
|
@@ -465,7 +471,7 @@ class Wt_Import_Export_For_Woo_Basic_Order {
|
|
465 |
)
|
466 |
);
|
467 |
|
468 |
-
|
469 |
'label' => __('Link order items using'),
|
470 |
'type' => 'radio',
|
471 |
'radio_fields' => array(
|
@@ -497,7 +503,15 @@ class Wt_Import_Export_For_Woo_Basic_Order {
|
|
497 |
admin_url('plugin-install.php?s=product import export for woocommerce by webtoffee&tab=search&type=term')
|
498 |
);
|
499 |
}
|
500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
|
502 |
foreach ($fields as $fieldk => $fieldv) {
|
503 |
$out[$fieldk] = $fieldv;
|
56 |
add_filter('wt_iew_exporter_alter_mapping_fields_basic', array($this, 'exporter_alter_mapping_fields'), 10, 3);
|
57 |
add_filter('wt_iew_importer_alter_mapping_fields_basic', array($this, 'get_importer_post_columns'), 10, 3);
|
58 |
|
59 |
+
add_filter('wt_iew_exporter_alter_filter_fields_basic', array($this, 'exporter_alter_filter_fields'), 10, 3);
|
60 |
|
61 |
add_filter('wt_iew_exporter_alter_advanced_fields_basic', array($this, 'exporter_alter_advanced_fields'), 10, 3);
|
62 |
add_filter('wt_iew_importer_alter_advanced_fields_basic', array($this, 'importer_alter_advanced_fields'), 10, 3);
|
149 |
*/
|
150 |
public function wt_iew_exporter_post_types_basic($arr) {
|
151 |
$arr['order'] = __('Order');
|
152 |
+
$arr['coupon'] = __('Coupon');
|
153 |
+
$arr['product'] = __('Product');
|
154 |
+
$arr['product_review'] = __('Product Review');
|
155 |
+
$arr['product_categories'] = __('Product Categories');
|
156 |
+
$arr['product_tags'] = __('Product Tags');
|
157 |
+
$arr['user'] = __('User/Customer');
|
158 |
return $arr;
|
159 |
}
|
160 |
|
471 |
)
|
472 |
);
|
473 |
|
474 |
+
$out['ord_link_using_sku'] = array(
|
475 |
'label' => __('Link order items using'),
|
476 |
'type' => 'radio',
|
477 |
'radio_fields' => array(
|
503 |
admin_url('plugin-install.php?s=product import export for woocommerce by webtoffee&tab=search&type=term')
|
504 |
);
|
505 |
}
|
506 |
+
|
507 |
+
$out['update_stock_details'] = array(
|
508 |
+
'label' => __("Update stock details"),
|
509 |
+
'type' => 'checkbox',
|
510 |
+
'checkbox_fields' => array( 1 => __( 'Enable' ) ),
|
511 |
+
'value' => 0,
|
512 |
+
'field_name' => 'update_stock_details',
|
513 |
+
'help_text' => __('Select to update the sale count and stock quantity of a product associated with the order.<br/>Note: Ensure the manage stock option is enabled. This feature is not meant to work for the refunded, cancelled or failed order statuses.'),
|
514 |
+
);
|
515 |
|
516 |
foreach ($fields as $fieldk => $fieldv) {
|
517 |
$out[$fieldk] = $fieldv;
|
includes/class-wt-import-export-for-woo.php
CHANGED
@@ -80,7 +80,7 @@ class Wt_Import_Export_For_Woo_Basic {
|
|
80 |
if ( defined( 'WT_O_IEW_VERSION' ) ) {
|
81 |
$this->version = WT_O_IEW_VERSION;
|
82 |
} else {
|
83 |
-
$this->version = '2.2.
|
84 |
}
|
85 |
$this->plugin_name = 'wt-import-export-for-woo-basic';
|
86 |
|
@@ -208,6 +208,8 @@ class Wt_Import_Export_For_Woo_Basic {
|
|
208 |
/* Enqueue CSS and JS */
|
209 |
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_styles' );
|
210 |
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_scripts' );
|
|
|
|
|
211 |
|
212 |
}
|
213 |
|
80 |
if ( defined( 'WT_O_IEW_VERSION' ) ) {
|
81 |
$this->version = WT_O_IEW_VERSION;
|
82 |
} else {
|
83 |
+
$this->version = '2.2.2';
|
84 |
}
|
85 |
$this->plugin_name = 'wt-import-export-for-woo-basic';
|
86 |
|
208 |
/* Enqueue CSS and JS */
|
209 |
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_styles' );
|
210 |
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_scripts' );
|
211 |
+
|
212 |
+
$this->loader->add_action( 'export_filters', $this->plugin_admin, 'tools_wtexport_text' );
|
213 |
|
214 |
}
|
215 |
|
order-import-export-for-woocommerce.php
CHANGED
@@ -6,12 +6,12 @@ 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: 2.2.
|
10 |
Text Domain: order-import-export-for-woocommerce
|
11 |
Domain Path: /languages
|
12 |
Requires at least: 3.0
|
13 |
Requires PHP: 5.6
|
14 |
-
WC tested up to: 6.
|
15 |
License: GPLv3
|
16 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
17 |
*/
|
@@ -48,7 +48,7 @@ if ( !defined( 'WT_IEW_DEBUG_BASIC_TROUBLESHOOT' ) ) {
|
|
48 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
49 |
* Rename this for your plugin and update it as you release new versions.
|
50 |
*/
|
51 |
-
define( 'WT_O_IEW_VERSION', '2.2.
|
52 |
|
53 |
/**
|
54 |
* The code that runs during plugin activation.
|
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: 2.2.2
|
10 |
Text Domain: order-import-export-for-woocommerce
|
11 |
Domain Path: /languages
|
12 |
Requires at least: 3.0
|
13 |
Requires PHP: 5.6
|
14 |
+
WC tested up to: 6.3
|
15 |
License: GPLv3
|
16 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
17 |
*/
|
48 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
49 |
* Rename this for your plugin and update it as you release new versions.
|
50 |
*/
|
51 |
+
define( 'WT_O_IEW_VERSION', '2.2.2' );
|
52 |
|
53 |
/**
|
54 |
* The code that runs during plugin activation.
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: order export, woocommerce, order, export, csv, order import, woocommerce e
|
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.9
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 2.2.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -28,7 +28,7 @@ The following are functionalities offered by the basic version of the plugin.
|
|
28 |
🔸 Bulk update WooCommerce orders and coupons.
|
29 |
🔸 Compatible with YITH WooCommerce Order Tracking plugin.
|
30 |
🔸 Supports various export filters (order status, product, coupon, customer, date range)
|
31 |
-
🔸 Tested OK with WooCommerce 6.
|
32 |
🔸 Tested OK with WP 5.9
|
33 |
🔸 Tested OK with PHP 8.0
|
34 |
|
@@ -51,6 +51,8 @@ More information about the setup of the plugin and a sample CSV that is taken as
|
|
51 |
|
52 |
* [Sequential Order Number for WooCommerce by WebToffee](https://wordpress.org/plugins/wt-woocommerce-sequential-order-numbers/)
|
53 |
* [WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels by WebToffee](https://wordpress.org/plugins/print-invoices-packing-slip-labels-for-woocommerce/)
|
|
|
|
|
54 |
|
55 |
<blockquote>
|
56 |
|
@@ -226,6 +228,9 @@ Yes.
|
|
226 |
|
227 |
== Changelog ==
|
228 |
|
|
|
|
|
|
|
229 |
= 2.2.1 =
|
230 |
* Bugfix: Download link in imported orders not working.
|
231 |
= 2.2.0 =
|
@@ -494,5 +499,6 @@ Yes.
|
|
494 |
|
495 |
== Upgrade Notice ==
|
496 |
|
497 |
-
= 2.2.
|
498 |
-
*
|
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.9
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.2.2
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
28 |
🔸 Bulk update WooCommerce orders and coupons.
|
29 |
🔸 Compatible with YITH WooCommerce Order Tracking plugin.
|
30 |
🔸 Supports various export filters (order status, product, coupon, customer, date range)
|
31 |
+
🔸 Tested OK with WooCommerce 6.3
|
32 |
🔸 Tested OK with WP 5.9
|
33 |
🔸 Tested OK with PHP 8.0
|
34 |
|
51 |
|
52 |
* [Sequential Order Number for WooCommerce by WebToffee](https://wordpress.org/plugins/wt-woocommerce-sequential-order-numbers/)
|
53 |
* [WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels by WebToffee](https://wordpress.org/plugins/print-invoices-packing-slip-labels-for-woocommerce/)
|
54 |
+
* [Advanced Shipment Tracking for WooCommerce](https://wordpress.org/plugins/woo-advanced-shipment-tracking/)
|
55 |
+
* [WooCommerce Shipment Tracking](https://woocommerce.com/products/shipment-tracking/)
|
56 |
|
57 |
<blockquote>
|
58 |
|
228 |
|
229 |
== Changelog ==
|
230 |
|
231 |
+
= 2.2.2 2022-04-05 =
|
232 |
+
* Enhancement: Option to - Update stock status and sales count of products upon order import.
|
233 |
+
* Enhancement: Compatibility with WooCommerce shipment tracking and Advanced Shipment Tracking for WooCommerce.
|
234 |
= 2.2.1 =
|
235 |
* Bugfix: Download link in imported orders not working.
|
236 |
= 2.2.0 =
|
499 |
|
500 |
== Upgrade Notice ==
|
501 |
|
502 |
+
= 2.2.2 =
|
503 |
+
* Enhancement: Option to - Update stock status and sales count of products upon order import.
|
504 |
+
* Enhancement: Compatibility with WooCommerce shipment tracking and Advanced Shipment Tracking for WooCommerce.
|