Advanced Shipment Tracking for WooCommerce - Version 3.2.2.2

Version Description

  • Enhancement - Update order details, Shipping address and billing address email template
  • Enhancement - Added admin notice and WooCommerce inbox message for Advanced Shipment Tracking PRO
  • Enhancement - Split Shipment Tracking customizer and TrackShip customizer
  • Fix - Fixed issue with the" Reset providers database" option in Synch providers
Download this release

Release Info

Developer zorem
Plugin Icon 128x128 Advanced Shipment Tracking for WooCommerce
Version 3.2.2.2
Comparing to
See all releases

Code changes from version 3.2.2.1 to 3.2.2.2

Files changed (31) hide show
  1. assets/css/admin.css +47 -14
  2. assets/images/trackship-logo.png +0 -0
  3. assets/js/admin.js +1 -4
  4. assets/js/customizer-scripts.js +5 -1
  5. assets/js/front.js +3 -3
  6. assets/js/preview-scripts.js +39 -1
  7. assets/js/shipping_row.js +0 -44
  8. assets/js/trackship.js +6 -91
  9. includes/class-wc-admin-notices.php +10 -10
  10. includes/class-wc-advanced-shipment-tracking-admin-notice.php +25 -25
  11. includes/class-wc-advanced-shipment-tracking-admin.php +1 -18
  12. includes/class-wc-advanced-shipment-tracking-settings.php +4 -5
  13. includes/class-wc-advanced-shipment-tracking-trackship.php +1 -23
  14. includes/class-wc-advanced-shipment-tracking.php +1 -1
  15. includes/customizer/class-trackship-customizer.php +315 -0
  16. includes/customizer/class-wc-availableforpickup-email-customizer.php +7 -7
  17. includes/customizer/class-wc-delivered-email-customizer.php +7 -7
  18. includes/customizer/class-wc-exception-email-customizer.php +7 -7
  19. includes/customizer/class-wc-failure-email-customizer.php +7 -7
  20. includes/customizer/class-wc-intransit-email-customizer.php +8 -8
  21. includes/customizer/class-wc-onhold-email-customizer.php +7 -7
  22. includes/customizer/class-wc-outfordelivery-email-customizer.php +7 -7
  23. includes/customizer/class-wc-returntosender-email-customizer.php +7 -7
  24. includes/customizer/class-wc-tracking-page-customizer.php +11 -13
  25. includes/customizer/class-wcast-customizer.php +19 -35
  26. includes/views/admin_options_addons.php +51 -12
  27. includes/views/front/preview_tracking_page.php +15 -12
  28. readme.txt +31 -32
  29. templates/emails/wcast-billing-email-addresses.php +3 -3
  30. templates/emails/wcast-shipping-email-addresses.php +3 -3
  31. woocommerce-advanced-shipment-tracking.php +6 -40
assets/css/admin.css CHANGED
@@ -11,9 +11,9 @@
11
  box-sizing: border-box;
12
  padding: 0;
13
  width: 100%;
14
- top: 32px;
15
  z-index: 1001;
16
  align-items: center;
 
17
  }
18
  .zorem-layout__header .zorem-layout__header-breadcrumbs {
19
  font-size: 14px;
@@ -91,28 +91,30 @@
91
  opacity: 1;
92
  }
93
  .woocommerce-layout__activity-panel-wrapper {
94
- height: calc(100vh - 166px);
95
  background: #f0f0f0;
96
- width: 510px;
97
- transform: translateX(100%);
98
  transition-property: transform box-shadow;
99
  transition-duration: .3s;
100
  transition-timing-function: ease-in-out;
101
- position: fixed;
102
  right: 0;
103
- top: 166px;
104
  z-index: 1000;
105
  overflow-x: hidden;
106
- overflow-y: auto;
 
 
107
  }
108
 
109
- .woocommerce-layout__activity-panel-wrapper.is-open {
110
- transform: none;
111
  box-shadow: 0 12px 12px 0 rgb(85 93 102 / 30%);
112
  }
113
  .woocommerce-layout__activity-panel-wrapper.is-switching {
114
  animation: tabSwitch;
115
  animation-duration: .3s;
 
 
116
  }
117
  .woocommerce-layout__activity-panel-header {
118
  height: 50px;
@@ -181,10 +183,6 @@
181
  margin-left: auto;
182
  }
183
  @media (min-width: 783px) {
184
- .woocommerce-layout__activity-panel-wrapper {
185
- height: calc(100vh - 92px);
186
- top: 92px;
187
- }
188
  .woocommerce-layout__activity-panel-header {
189
  padding: 16px 24px;
190
  }
@@ -1216,6 +1214,9 @@ a.reset_default_provider {
1216
  padding: 0;
1217
  margin: 10px 0 0;
1218
  }
 
 
 
1219
  .woocommerce.zorem_admin_layout table.form-table th{
1220
  padding: 20px;
1221
  }
@@ -1881,10 +1882,28 @@ p.zorem_description {
1881
  margin: 0 -15px;
1882
  border-bottom: 1px solid #e0e0e0;
1883
  padding: 0 0 15px;
 
 
 
 
1884
  }
1885
  .plugins_section.free_plugin_section .paid_plugin_image img{
1886
  height: 80px;
1887
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1888
  .plugins_section.free_plugin_section .plugin_image img{
1889
  width: 100%;
1890
  }
@@ -1899,6 +1918,9 @@ p.zorem_description {
1899
  .plugins_section.free_plugin_section .plugin_description h3{
1900
  margin: 0;
1901
  }
 
 
 
1902
  .plugins_section.free_plugin_section .plugin_description p{
1903
  display: -webkit-inline-box;
1904
  -webkit-line-clamp: 4;
@@ -2269,6 +2291,12 @@ ul.csv_error_details_ul li:before{
2269
  -ms-flex-preferred-size: 66%;
2270
  flex-basis: 66%;
2271
  }
 
 
 
 
 
 
2272
  .trackship_addon_section{
2273
  background: #fff;
2274
  border: 1px solid #e0e0e0;
@@ -2286,7 +2314,7 @@ ul.csv_error_details_ul li:before{
2286
  }
2287
  .paid_plugin_description p{
2288
  display: -webkit-inline-box;
2289
- -webkit-line-clamp: 4;
2290
  -webkit-box-orient: vertical;
2291
  overflow: hidden;
2292
  text-overflow: ellipsis;
@@ -2296,6 +2324,8 @@ ul.csv_error_details_ul li:before{
2296
  }
2297
  .ast_pro_features_list li{
2298
  margin: 0 0 10px;
 
 
2299
  }
2300
  .ast_pro_features_list li:before{
2301
  content: "\f147";
@@ -2304,6 +2334,9 @@ ul.csv_error_details_ul li:before{
2304
  vertical-align: middle;
2305
  color: #59c889;
2306
  padding-right: 5px;
 
 
 
2307
  }
2308
 
2309
  .multiple_select_container {
11
  box-sizing: border-box;
12
  padding: 0;
13
  width: 100%;
 
14
  z-index: 1001;
15
  align-items: center;
16
+ position: relative;
17
  }
18
  .zorem-layout__header .zorem-layout__header-breadcrumbs {
19
  font-size: 14px;
91
  opacity: 1;
92
  }
93
  .woocommerce-layout__activity-panel-wrapper {
94
+ height: calc(100vh - 60px);
95
  background: #f0f0f0;
96
+ width: 510px;
 
97
  transition-property: transform box-shadow;
98
  transition-duration: .3s;
99
  transition-timing-function: ease-in-out;
100
+ position: absolute;
101
  right: 0;
102
+ top: 60px;
103
  z-index: 1000;
104
  overflow-x: hidden;
105
+ overflow-y: auto;
106
+ visibility: hidden;
107
+ opacity: 0;
108
  }
109
 
110
+ .woocommerce-layout__activity-panel-wrapper.is-open {
 
111
  box-shadow: 0 12px 12px 0 rgb(85 93 102 / 30%);
112
  }
113
  .woocommerce-layout__activity-panel-wrapper.is-switching {
114
  animation: tabSwitch;
115
  animation-duration: .3s;
116
+ visibility: visible;
117
+ opacity: 1;
118
  }
119
  .woocommerce-layout__activity-panel-header {
120
  height: 50px;
183
  margin-left: auto;
184
  }
185
  @media (min-width: 783px) {
 
 
 
 
186
  .woocommerce-layout__activity-panel-header {
187
  padding: 16px 24px;
188
  }
1214
  padding: 0;
1215
  margin: 10px 0 0;
1216
  }
1217
+ .ast_admin_content #wc_ast_upload_csv_form div.submit{
1218
+ margin: 0 0 15px;
1219
+ }
1220
  .woocommerce.zorem_admin_layout table.form-table th{
1221
  padding: 20px;
1222
  }
1882
  margin: 0 -15px;
1883
  border-bottom: 1px solid #e0e0e0;
1884
  padding: 0 0 15px;
1885
+ height: 80px;
1886
+ display: flex;
1887
+ justify-content: center;
1888
+ align-items: center;
1889
  }
1890
  .plugins_section.free_plugin_section .paid_plugin_image img{
1891
  height: 80px;
1892
  }
1893
+ .plugins_section.free_plugin_section .ast_paid_plugin_image{
1894
+ text-align: center;
1895
+ margin: 0 -15px;
1896
+ border-bottom: 1px solid #e0e0e0;
1897
+ padding: 0 0 15px;
1898
+ height: 45px;
1899
+ display: flex;
1900
+ justify-content: center;
1901
+ align-items: center;
1902
+ }
1903
+
1904
+ .plugins_section.free_plugin_section .ast_paid_plugin_image img{
1905
+ height: 35px;
1906
+ }
1907
  .plugins_section.free_plugin_section .plugin_image img{
1908
  width: 100%;
1909
  }
1918
  .plugins_section.free_plugin_section .plugin_description h3{
1919
  margin: 0;
1920
  }
1921
+ .plugins_section.free_plugin_section .paid_plugin_description h3{
1922
+ margin: 1em 0 0;
1923
+ }
1924
  .plugins_section.free_plugin_section .plugin_description p{
1925
  display: -webkit-inline-box;
1926
  -webkit-line-clamp: 4;
2291
  -ms-flex-preferred-size: 66%;
2292
  flex-basis: 66%;
2293
  }
2294
+ .ast_pro_landing_header {
2295
+ font-size: 20px;
2296
+ line-height: 25px;
2297
+ margin: 0;
2298
+ font-weight: 500;
2299
+ }
2300
  .trackship_addon_section{
2301
  background: #fff;
2302
  border: 1px solid #e0e0e0;
2314
  }
2315
  .paid_plugin_description p{
2316
  display: -webkit-inline-box;
2317
+ -webkit-line-clamp: 3;
2318
  -webkit-box-orient: vertical;
2319
  overflow: hidden;
2320
  text-overflow: ellipsis;
2324
  }
2325
  .ast_pro_features_list li{
2326
  margin: 0 0 10px;
2327
+ padding: 0 0 0 28px;
2328
+ position: relative;
2329
  }
2330
  .ast_pro_features_list li:before{
2331
  content: "\f147";
2334
  vertical-align: middle;
2335
  color: #59c889;
2336
  padding-right: 5px;
2337
+ position: absolute;
2338
+ left: 0;
2339
+ top: 3px;
2340
  }
2341
 
2342
  .multiple_select_container {
assets/images/trackship-logo.png CHANGED
Binary file
assets/js/admin.js CHANGED
@@ -300,10 +300,7 @@ jQuery(document).on("click", ".add_inline_tracking", function(){
300
  jQuery("body").append(response);
301
  jQuery('.add_tracking_popup').show();
302
  jQuery( "#add_tracking_number_form #tracking_number" ).focus();
303
-
304
- jQuery('#tracking_provider').select2({
305
- matcher: modelMatcher
306
- });
307
 
308
  var selected_provider = jQuery("#tracking_provider").val();
309
 
300
  jQuery("body").append(response);
301
  jQuery('.add_tracking_popup').show();
302
  jQuery( "#add_tracking_number_form #tracking_number" ).focus();
303
+ jQuery('.tracking_provider_dropdown').select2();
 
 
 
304
 
305
  var selected_provider = jQuery("#tracking_provider").val();
306
 
assets/js/customizer-scripts.js CHANGED
@@ -9,7 +9,11 @@ jQuery(document).ready(function() {
9
  * Change description
10
  */
11
  jQuery('#customize-theme-controls #accordion-section-themes').hide();
12
- jQuery( '#sub-accordion-section-trackship_shipment_status_email .customize-section-title > h3 .customize-action' ).append( '<span class="dashicons dashicons-arrow-right" style="padding-top:4px;"></span> TrackShip' );
 
 
 
 
13
  });
14
 
15
  // Handle mobile button click
9
  * Change description
10
  */
11
  jQuery('#customize-theme-controls #accordion-section-themes').hide();
12
+ jQuery( '#sub-accordion-section-trackship_shipment_status_email .customize-section-title > h3 .customize-action' ).append( '<span class="dashicons dashicons-arrow-right" style="padding-top:4px;"></span> '+wcast_customizer.customizer_title );
13
+ jQuery( '#sub-accordion-section-ast_tracking_page_section .customize-section-title > h3 .customize-action' ).append( '<span class="dashicons dashicons-arrow-right" style="padding-top:4px;"></span> '+wcast_customizer.customizer_title );
14
+ jQuery( '#sub-accordion-section-ast_tracking_general_section .customize-section-title > h3 .customize-action' ).append( '<span class="dashicons dashicons-arrow-right" style="padding-top:4px;"></span> '+wcast_customizer.customizer_title );
15
+ jQuery( '#sub-accordion-section-custom_order_status_email .customize-section-title > h3 .customize-action' ).append( '<span class="dashicons dashicons-arrow-right" style="padding-top:4px;"></span> '+wcast_customizer.customizer_title );
16
+ jQuery( '.accordion-section .panel-title' ).html(wcast_customizer.customizer_title);
17
  });
18
 
19
  // Handle mobile button click
assets/js/front.js CHANGED
@@ -102,7 +102,7 @@ function hideerror(element){
102
 
103
  jQuery(document).on("click", ".open_tracking_lightbox", function(){
104
 
105
- jQuery(".tracking_info,.my_account_tracking").block({
106
  message: null,
107
  overlayCSS: {
108
  background: "#fff",
@@ -127,10 +127,10 @@ jQuery(document).on("click", ".open_tracking_lightbox", function(){
127
  success: function(response) {
128
  jQuery(".ts_tracking_popup .popuprow").html(response);
129
  jQuery('.ts_tracking_popup').show();
130
- jQuery(".tracking_info,.my_account_tracking").unblock();
131
  },
132
  error: function(response) {
133
- jQuery(".tracking_info,.my_account_tracking").unblock();
134
  }
135
  });
136
 
102
 
103
  jQuery(document).on("click", ".open_tracking_lightbox", function(){
104
 
105
+ jQuery(".tracking_info,.my_account_tracking,.fluid_section").block({
106
  message: null,
107
  overlayCSS: {
108
  background: "#fff",
127
  success: function(response) {
128
  jQuery(".ts_tracking_popup .popuprow").html(response);
129
  jQuery('.ts_tracking_popup').show();
130
+ jQuery(".tracking_info,.my_account_tracking,.fluid_section").unblock();
131
  },
132
  error: function(response) {
133
+ jQuery(".tracking_info,.my_account_tracking,.fluid_section").unblock();
134
  }
135
  });
136
 
assets/js/preview-scripts.js CHANGED
@@ -431,6 +431,44 @@
431
  $( '#header_wrapper h1' ).text('');
432
  }
433
  });
434
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
 
436
  } )( jQuery );
431
  $( '#header_wrapper h1' ).text('');
432
  }
433
  });
434
+ });
435
+
436
+ wp.customize( 'wc_ast_select_border_color', function( value ) {
437
+ value.bind( function( to ) {
438
+ $( '.col.tracking-detail' ).css( 'border', '1px solid ' + to );
439
+ $( 'body .col.tracking-detail .shipment-header' ).css( 'border-bottom', '1px solid ' + to );
440
+ $( 'body .col.tracking-detail .trackship_branding' ).css( 'border-top', '1px solid ' + to );
441
+ });
442
+ });
443
+
444
+ wp.customize( 'wc_ast_select_bg_color', function( value ) {
445
+ value.bind( function( to ) {
446
+ $( 'body .col.tracking-detail' ).css( 'background', to );
447
+ });
448
+ });
449
+
450
+ wp.customize( 'wc_ast_hide_tracking_provider_image', function( value ) {
451
+ value.bind( function( to ) {
452
+ if( to ){
453
+ $( '.provider_image_div' ).hide();
454
+ }
455
+ else{
456
+ $( '.provider_image_div' ).css( "display", "inline-block" );
457
+ }
458
+ });
459
+ });
460
+
461
+ wp.customize( 'wc_ast_link_to_shipping_provider', function( value ) {
462
+ value.bind( function( to ) {
463
+ if( to ){
464
+ $( '.tracking_number_div ul li > strong' ).hide();
465
+ $( '.tracking_number_div ul li > a' ).show();
466
+ }
467
+ else{
468
+ $( '.tracking_number_div ul li > strong' ).show();
469
+ $( '.tracking_number_div ul li > a' ).hide();
470
+ }
471
+ });
472
+ });
473
 
474
  } )( jQuery );
assets/js/shipping_row.js CHANGED
@@ -1117,36 +1117,6 @@ jQuery(document).on("click", ".inner_tab_input", function(){
1117
  window.history.pushState({path:url},'',url);
1118
  });
1119
 
1120
- jQuery(document).on("click", ".open_video_popup", function(){
1121
- jQuery('.how_to_video_popup').show();
1122
- });
1123
-
1124
- jQuery(document).on("click", ".ts_addons_header", function(){
1125
- jQuery('.ts_video_popup').show();
1126
- });
1127
- jQuery(document).on("click", ".import_tracking_sidebar", function(){
1128
- jQuery('.import_tracking_video_popup').show();
1129
- });
1130
-
1131
- jQuery(document).on("click", ".how_to_video_popup .popupclose", function(){
1132
- jQuery('#how_to_video').each(function(index) {
1133
- jQuery(this).attr('src', jQuery(this).attr('src'));
1134
- return false;
1135
- });
1136
- });
1137
- jQuery(document).on("click", ".ts_video_popup .popupclose", function(){
1138
- jQuery('#ts_video').each(function(index) {
1139
- jQuery(this).attr('src', jQuery(this).attr('src'));
1140
- return false;
1141
- });
1142
- });
1143
- jQuery(document).on("click", ".import_tracking_video_popup .popupclose", function(){
1144
- jQuery('#import_tracking_video').each(function(index) {
1145
- jQuery(this).attr('src', jQuery(this).attr('src'));
1146
- return false;
1147
- });
1148
- });
1149
-
1150
  jQuery('#shipping-provider-table').datatable({
1151
  pageSize: 25,
1152
  pagingDivClass: 'text-left',
@@ -1164,10 +1134,6 @@ jQuery('#shipping-provider-table').datatable({
1164
  }
1165
  });
1166
 
1167
- jQuery(document).on("click", ".tool_link", function(){
1168
- jQuery('#tab_tools').trigger( "click" );
1169
- });
1170
-
1171
  jQuery(document).on("change", ".order_status_toggle,.enable_order_status_email_input,.custom_order_color_select, #wc_ast_status_shipped", function(){
1172
  save_custom_order_status();
1173
  });
@@ -1179,16 +1145,6 @@ jQuery('#wc_ast_status_partial_shipped_label_color').wpColorPicker({
1179
  },
1180
  });
1181
 
1182
- /*jQuery('body').click( function(){
1183
- if ( jQuery('.partial_shipped_row button.button.wp-color-result').hasClass( 'wp-picker-open' ) ) {
1184
- save_custom_order_status();
1185
- }
1186
- });
1187
-
1188
- jQuery('.partial_shipped_row button.button.wp-color-result').click( function(){
1189
- if ( jQuery(this).hasClass( 'wp-picker-open' ) ) {}else{save_custom_order_status();}
1190
- });*/
1191
-
1192
  jQuery('#wc_ast_status_updated_tracking_label_color').wpColorPicker({
1193
  change: function(e, ui) {
1194
  var color = ui.color.toString();
1117
  window.history.pushState({path:url},'',url);
1118
  });
1119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1120
  jQuery('#shipping-provider-table').datatable({
1121
  pageSize: 25,
1122
  pagingDivClass: 'text-left',
1134
  }
1135
  });
1136
 
 
 
 
 
1137
  jQuery(document).on("change", ".order_status_toggle,.enable_order_status_email_input,.custom_order_color_select, #wc_ast_status_shipped", function(){
1138
  save_custom_order_status();
1139
  });
1145
  },
1146
  });
1147
 
 
 
 
 
 
 
 
 
 
 
1148
  jQuery('#wc_ast_status_updated_tracking_label_color').wpColorPicker({
1149
  change: function(e, ui) {
1150
  var color = ui.color.toString();
assets/js/trackship.js CHANGED
@@ -39,9 +39,7 @@
39
 
40
  jQuery("#ast_settings_snackbar").addClass('show_snackbar');
41
  jQuery("#ast_settings_snackbar").text(trackship_script.i18n.data_saved);
42
- setTimeout(function(){ jQuery("#ast_settings_snackbar").removeClass('show_snackbar'); }, 3000);
43
-
44
- jQuery('.tracking_page_preview').prop("disabled", false);
45
  });
46
  },
47
  save_trackship_late_shipments_form: function( event ) {
@@ -64,78 +62,10 @@
64
  });
65
  })( jQuery, trackship_script, wp, ajaxurl );
66
 
67
- jQuery( document ).ready(function() {
68
- jQuery('#wc_ast_select_border_color').wpColorPicker({
69
- change: function(e, ui) {
70
- var color = ui.color.toString();
71
- jQuery('#tracking_preview_iframe').contents().find('.col.tracking-detail').css('border','1px solid '+color);
72
- jQuery('.tracking_page_preview').prop("disabled", true);
73
- },
74
- });
75
- });
76
-
77
- jQuery(document).on("change", "#wc_ast_use_tracking_page", function(){
78
- if(jQuery(this).prop("checked") == true){
79
- jQuery('.tracking_page_preview').show();
80
- jQuery('.tracking_page_design_table').show();
81
- } else{
82
- jQuery('.tracking_page_preview').hide();
83
- jQuery('.tracking_page_design_table').hide();
84
- }
85
- });
86
-
87
- jQuery(document).on("change", ".select_t_layout_section .radio-img", function(){
88
- jQuery('.tracking_page_preview').prop("disabled", true);
89
- });
90
-
91
- jQuery(document).on("click", "#wc_ast_link_to_shipping_provider", function(){
92
- jQuery('.tracking_page_preview').prop("disabled", true);
93
- });
94
-
95
- jQuery(document).on("click", "#wc_ast_hide_tracking_provider_image", function(){
96
- jQuery('.tracking_page_preview').prop("disabled", true);
97
- });
98
-
99
- jQuery(document).on("click", "#wc_ast_hide_tracking_events", function(){
100
- jQuery('.tracking_page_preview').prop("disabled", true);
101
- });
102
-
103
- jQuery(document).on("click", "#wc_ast_remove_trackship_branding", function(){
104
- jQuery('.tracking_page_preview').prop("disabled", true);
105
- });
106
-
107
- jQuery(document).on("click", ".tracking_page_preview", function(){
108
- jQuery("#wc_ast_trackship_form").find(".spinner").addClass("active");
109
- document.getElementById('tracking_preview_iframe').contentDocument.location.reload(true);
110
-
111
- jQuery('#tracking_preview_iframe').load(function(){
112
- jQuery("#wc_ast_trackship_form").find(".spinner").removeClass("active");
113
- jQuery('.tracking_page_preview_popup').show();
114
- var iframe = document.getElementById("tracking_preview_iframe");
115
- iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
116
- });
117
- });
118
- jQuery(document).on("click", ".popupclose", function(){
119
- jQuery('.tracking_page_preview_popup').hide();
120
- });
121
- jQuery(document).on("click", ".popup_close_icon", function(){
122
- jQuery('.tracking_page_preview_popup').hide();
123
- });
124
-
125
- jQuery( document ).ready(function() {
126
- if(jQuery('#wc_ast_use_tracking_page').prop("checked") == true){
127
- jQuery('.tracking_page_preview').show();
128
- jQuery('.tracking_page_design_table').show();
129
- } else{
130
- jQuery('.tracking_page_preview').hide();
131
- jQuery('.tracking_page_design_table').hide();
132
- }
133
- });
134
 
135
  jQuery(document).on("click", ".tab_input", function(){
136
  var tab = jQuery(this).data('tab');
137
- var label = jQuery(this).data('label');
138
- //jQuery('.zorem-layout__header-breadcrumbs .header-breadcrumbs-last').text(label);
139
  var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=trackship-for-woocommerce&tab="+tab;
140
  window.history.pushState({path:url},'',url);
141
  });
@@ -169,21 +99,6 @@ jQuery(document).on("click", ".bulk_shipment_status_button", function(){
169
  return false;
170
  });
171
 
172
- jQuery(document).on("click", ".open_ts_video", function(){
173
- jQuery('.ts_video_popup').show();
174
- });
175
- jQuery(document).on("click", ".ts_video_popup .popupclose", function(){
176
- jQuery('#ts_video').each(function(index) {
177
- jQuery(this).attr('src', jQuery(this).attr('src'));
178
- return false;
179
- });
180
- jQuery('.ts_video_popup').hide();
181
- });
182
-
183
- jQuery(document).on("click", ".tool_link", function(){
184
- jQuery('#tab_tools').trigger( "click" );
185
- });
186
-
187
  jQuery(document).on("change", "#wc_ast_trackship_page_id", function(){
188
  var wc_ast_trackship_page_id = jQuery(this).val();
189
  if(wc_ast_trackship_page_id == 'other'){
@@ -304,10 +219,10 @@ jQuery(document).on( "input", "#wc_ast_trackship_other_page", function(){
304
  jQuery(document).on("change", "#wc_ast_use_tracking_page", function(){
305
  if(jQuery(this).prop("checked") == true){
306
  jQuery('.ts_customizer_btn').removeClass('disable_ts_btn');
307
- jQuery(this).parent('li').nextAll('li').fadeIn();
308
  } else{
309
  jQuery('.ts_customizer_btn').addClass('disable_ts_btn');
310
- jQuery(this).parent('li').nextAll('li').fadeOut();
311
  }
312
  save_tracking_page_form();
313
  });
@@ -315,10 +230,10 @@ jQuery(document).on("change", "#wc_ast_use_tracking_page", function(){
315
  jQuery( document ).ready(function() {
316
  if(jQuery('#wc_ast_use_tracking_page').prop("checked") == true){
317
  jQuery('.ts_customizer_btn').removeClass('disable_ts_btn');
318
- jQuery('#wc_ast_use_tracking_page').parent('li').nextAll('li').fadeIn();
319
  } else{
320
  jQuery('.ts_customizer_btn').addClass('disable_ts_btn');
321
- jQuery('#wc_ast_use_tracking_page').parent('li').nextAll('li').fadeOut();
322
  }
323
  });
324
 
39
 
40
  jQuery("#ast_settings_snackbar").addClass('show_snackbar');
41
  jQuery("#ast_settings_snackbar").text(trackship_script.i18n.data_saved);
42
+ setTimeout(function(){ jQuery("#ast_settings_snackbar").removeClass('show_snackbar'); }, 3000);
 
 
43
  });
44
  },
45
  save_trackship_late_shipments_form: function( event ) {
62
  });
63
  })( jQuery, trackship_script, wp, ajaxurl );
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  jQuery(document).on("click", ".tab_input", function(){
67
  var tab = jQuery(this).data('tab');
68
+ var label = jQuery(this).data('label');
 
69
  var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=trackship-for-woocommerce&tab="+tab;
70
  window.history.pushState({path:url},'',url);
71
  });
99
  return false;
100
  });
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  jQuery(document).on("change", "#wc_ast_trackship_page_id", function(){
103
  var wc_ast_trackship_page_id = jQuery(this).val();
104
  if(wc_ast_trackship_page_id == 'other'){
219
  jQuery(document).on("change", "#wc_ast_use_tracking_page", function(){
220
  if(jQuery(this).prop("checked") == true){
221
  jQuery('.ts_customizer_btn').removeClass('disable_ts_btn');
222
+ jQuery(this).parent().parent('li').nextAll('li').fadeIn();
223
  } else{
224
  jQuery('.ts_customizer_btn').addClass('disable_ts_btn');
225
+ jQuery(this).parent().parent('li').nextAll('li').fadeOut();
226
  }
227
  save_tracking_page_form();
228
  });
230
  jQuery( document ).ready(function() {
231
  if(jQuery('#wc_ast_use_tracking_page').prop("checked") == true){
232
  jQuery('.ts_customizer_btn').removeClass('disable_ts_btn');
233
+ jQuery('#wc_ast_use_tracking_page').parent().parent('li').nextAll('li').fadeIn();
234
  } else{
235
  jQuery('.ts_customizer_btn').addClass('disable_ts_btn');
236
+ jQuery('#wc_ast_use_tracking_page').parent().parent('li').nextAll('li').fadeOut();
237
  }
238
  });
239
 
includes/class-wc-admin-notices.php CHANGED
@@ -37,12 +37,12 @@ class WC_AST_Admin_Notices_Under_WC_Admin {
37
  * init from parent mail class
38
  */
39
  public function init(){
40
- //add_action('init', array( $this, 'admin_notices_for_shippstation_tracking_add_on' ) );
41
  }
42
 
43
- public function admin_notices_for_shippstation_tracking_add_on() {
44
 
45
- if ( !is_plugin_active( 'woocommerce-shipstation-integration/woocommerce-shipstation.php' ) ) {
46
  return;
47
  }
48
 
@@ -50,23 +50,23 @@ class WC_AST_Admin_Notices_Under_WC_Admin {
50
  return;
51
  }
52
 
53
- $already_set = get_transient( 'shippstation_tracking_add_on_wc_admin' );
54
 
55
  if( 'yes' == $already_set ){
56
  return;
57
  }
58
 
59
- set_transient( 'shippstation_tracking_add_on_wc_admin', 'yes' );
60
 
61
- $note_name = 'shippstation_tracking_add_on';
62
  $data_store = WC_Data_Store::load( 'admin-note' );
63
 
64
  // Otherwise, add the note
65
  $activated_time = current_time( 'timestamp', 0 );
66
  $activated_time_formatted = date( 'F jS', $activated_time );
67
  $note = new Automattic\WooCommerce\Admin\Notes\WC_Admin_Note();
68
- $note->set_title( 'Auto-sync Tracking from ShipStation to AST' );
69
- $note->set_content( 'We noticed that you use the ShipStation Integration plugin and the Advanced Shipment Tracking (AST) plugins. You can use the ShipStation tracking add-on for AST to auto-sync the tracking numbers created by ShipStation into the AST shipment tracking order meta!' );
70
  $note->set_content_data( (object) array(
71
  'getting_started' => true,
72
  'activated' => $activated_time,
@@ -76,12 +76,12 @@ class WC_AST_Admin_Notices_Under_WC_Admin {
76
  $note->set_layout('plain');
77
  $note->set_image('');
78
  $note->set_name( $note_name );
79
- $note->set_source( 'ShipStation Tracking Add-on' );
80
  $note->set_layout('plain');
81
  $note->set_image('');
82
  // This example has two actions. A note can have 0 or 1 as well.
83
  $note->add_action(
84
- 'settings', 'Get this add-on', 'https://www.zorem.com/product/shipstation-tracking-add-on/'
85
  );
86
  $note->save();
87
  }
37
  * init from parent mail class
38
  */
39
  public function init(){
40
+ add_action('init', array( $this, 'admin_notices_for_ast_pro' ) );
41
  }
42
 
43
+ public function admin_notices_for_ast_pro() {
44
 
45
+ if( class_exists( 'ast_pro' ) ) {
46
  return;
47
  }
48
 
50
  return;
51
  }
52
 
53
+ $already_set = get_transient( 'ast_pro_wc_admin' );
54
 
55
  if( 'yes' == $already_set ){
56
  return;
57
  }
58
 
59
+ set_transient( 'ast_pro_wc_admin', 'yes' );
60
 
61
+ $note_name = 'ast_pro_wc_admin_notice';
62
  $data_store = WC_Data_Store::load( 'admin-note' );
63
 
64
  // Otherwise, add the note
65
  $activated_time = current_time( 'timestamp', 0 );
66
  $activated_time_formatted = date( 'F jS', $activated_time );
67
  $note = new Automattic\WooCommerce\Admin\Notes\WC_Admin_Note();
68
+ $note->set_title( 'Advanced Shipment Tracking PRO' );
69
+ $note->set_content( 'We just released the Advanced Shipment Tracking Pro! Upgrade now and enjoy a 20% off early bird discount. To redeem your discount, use coupon code ASTPRO20 (valid until March 31st)' );
70
  $note->set_content_data( (object) array(
71
  'getting_started' => true,
72
  'activated' => $activated_time,
76
  $note->set_layout('plain');
77
  $note->set_image('');
78
  $note->set_name( $note_name );
79
+ $note->set_source( 'AST Pro' );
80
  $note->set_layout('plain');
81
  $note->set_image('');
82
  // This example has two actions. A note can have 0 or 1 as well.
83
  $note->add_action(
84
+ 'settings', 'Upgrade to AST Pro', 'https://www.zorem.com/product/woocommerce-advanced-shipment-tracking/'
85
  );
86
  $note->save();
87
  }
includes/class-wc-advanced-shipment-tracking-admin-notice.php CHANGED
@@ -37,43 +37,42 @@ class WC_Advanced_Shipment_Tracking_Admin_notice {
37
  * init from parent mail class
38
  */
39
  public function init() {
40
- //add_action( 'ast_settings_admin_notice', array( $this, 'trackship_admin_notice' ) );
41
- //add_action( 'admin_init', array( $this, 'trackship_admin_notice_ignore' ) );
42
  }
43
 
44
  /*
45
  * Display admin notice on plugin install or update
46
  */
47
- public function trackship_admin_notice() {
48
 
49
- $wc_ast_api_key = get_option('wc_ast_api_key');
50
- if ( $wc_ast_api_key ) {
51
- return;
52
- }
53
 
54
- if ( get_option('trackship_admin_notice_ignore') ) {
55
  return;
56
  }
57
 
58
- $dismissable_url = esc_url( add_query_arg( 'trackship-ignore-notice', 'true' ) );
59
  ?>
60
  <style>
61
- .wp-core-ui .notice.trakcship-dismissable-notice{
62
  position: relative;
63
  padding-right: 38px;
64
- border-left-color: #59c889;
65
  }
66
- .wp-core-ui .notice.trakcship-dismissable-notice h3{
67
  margin-bottom: 5px;
68
  }
69
- .wp-core-ui .notice.trakcship-dismissable-notice a.notice-dismiss{
70
  padding: 9px;
71
  text-decoration: none;
72
  }
73
- .wp-core-ui .button-primary.ts_notice_btn {
74
- background: transparent;
75
- color: #3c4858;
76
- border-color: #59c889;
77
  text-transform: uppercase;
78
  padding: 0 11px;
79
  font-size: 12px;
@@ -82,12 +81,13 @@ class WC_Advanced_Shipment_Tracking_Admin_notice {
82
  margin: 5px 0 15px;
83
  }
84
  </style>
85
- <div class="notice updated notice-success trakcship-dismissable-notice">
86
  <a href="<?php esc_html_e( $dismissable_url ); ?>" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>
87
- <h3>Automate your post-shipping workflow!</h3>
88
- <p>Get ready to for the Shopping Season, TrackShip fully integrates into your store admin, auto-tracks your orders, automates your fulfillment workflow and allows you to provide Superior Post-Purchase experience to your customers!</p>
89
- <a class="button-primary ts_notice_btn" target="blank" href="https://trackship.info/my-account/?register=1">Start Your Free Trial</a>
90
- <a class="button-primary ts_notice_btn" href="<?php esc_html_e( $dismissable_url ); ?>">No Thanks</a>
 
91
  </div>
92
  <?php
93
  }
@@ -95,9 +95,9 @@ class WC_Advanced_Shipment_Tracking_Admin_notice {
95
  /*
96
  * Dismiss admin notice for trackship
97
  */
98
- public function trackship_admin_notice_ignore() {
99
- if ( isset( $_GET['trackship-ignore-notice'] ) ) {
100
- update_option( 'trackship_admin_notice_ignore', 'true' );
101
  }
102
  }
103
  }
37
  * init from parent mail class
38
  */
39
  public function init() {
40
+ add_action( 'admin_notices', array( $this, 'ast_pro_admin_notice' ) );
41
+ add_action( 'admin_init', array( $this, 'ast_pro_admin_notice_ignore' ) );
42
  }
43
 
44
  /*
45
  * Display admin notice on plugin install or update
46
  */
47
+ public function ast_pro_admin_notice() {
48
 
49
+ if( class_exists( 'ast_pro' ) ) {
50
+ return;
51
+ }
 
52
 
53
+ if ( get_option('ast_pro_admin_notice_ignore') ) {
54
  return;
55
  }
56
 
57
+ $dismissable_url = esc_url( add_query_arg( 'ast-pro-ignore-notice', 'true' ) );
58
  ?>
59
  <style>
60
+ .wp-core-ui .notice.ast-dismissable-notice{
61
  position: relative;
62
  padding-right: 38px;
63
+ border-left-color: #005B9A;
64
  }
65
+ .wp-core-ui .notice.ast-dismissable-notice h3{
66
  margin-bottom: 5px;
67
  }
68
+ .wp-core-ui .notice.ast-dismissable-notice a.notice-dismiss{
69
  padding: 9px;
70
  text-decoration: none;
71
  }
72
+ .wp-core-ui .button-primary.ast_notice_btn {
73
+ background: #005B9A;
74
+ color: #fff;
75
+ border-color: #005B9A;
76
  text-transform: uppercase;
77
  padding: 0 11px;
78
  font-size: 12px;
81
  margin: 5px 0 15px;
82
  }
83
  </style>
84
+ <div class="notice updated notice-success ast-dismissable-notice">
85
  <a href="<?php esc_html_e( $dismissable_url ); ?>" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>
86
+ <h3>Advanced Shipment Tracking Pro</h3>
87
+ <p>We just released the Advanced Shipment Tracking Pro! Upgrade now and enjoy a 20% off early bird discount.</p>
88
+ <p>To redeem your discount, use coupon code <strong>ASTPRO20</strong> (valid until March 31st) </p>
89
+ <a class="button-primary ast_notice_btn" target="blank" href="https://www.zorem.com/product/woocommerce-advanced-shipment-tracking/">Upgrade to AST Pro</a>
90
+ <a class="button-primary ast_notice_btn" href="<?php esc_html_e( $dismissable_url ); ?>">No Thanks</a>
91
  </div>
92
  <?php
93
  }
95
  /*
96
  * Dismiss admin notice for trackship
97
  */
98
+ public function ast_pro_admin_notice_ignore() {
99
+ if ( isset( $_GET['ast-pro-ignore-notice'] ) ) {
100
+ update_option( 'ast_pro_admin_notice_ignore', 'true' );
101
  }
102
  }
103
  }
includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -329,7 +329,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
329
  </li>
330
  <?php if ( !class_exists( 'ast_pro' ) ) { ?>
331
  <li class="woocommerce-list__item has-action">
332
- <a href="https://www.zorem.com/product/ast-pro/" class="woocommerce-list__item-inner" target="_blank">
333
  <div class="woocommerce-list__item-before">
334
  <span class="dashicons dashicons-media-document"></span>
335
  </div>
@@ -366,23 +366,6 @@ class WC_Advanced_Shipment_Tracking_Admin {
366
  </div>
367
 
368
  <div id="ast_settings_snackbar" class="ast_snackbar"><?php _e( 'Data saved successfully.', 'woo-advanced-shipment-tracking' )?></div>
369
-
370
- <div id="" class="popupwrapper ts_video_popup" style="display:none;">
371
- <div class="popuprow">
372
- <div class="videoWrapper">
373
- <iframe id="ts_video" src="https://www.youtube.com/embed/PhnqDorKN_c" frameborder="0" allowfullscreen></iframe>
374
- </div>
375
- </div>
376
- <div class="popupclose"></div>
377
- </div>
378
- <div id="" class="popupwrapper import_tracking_video_popup" style="display:none;">
379
- <div class="popuprow">
380
- <div class="videoWrapper">
381
- <iframe id="import_tracking_video" src="https://www.youtube.com/embed/aX6fud-W7pc" frameborder="0" allowfullscreen></iframe>
382
- </div>
383
- </div>
384
- <div class="popupclose"></div>
385
- </div>
386
  </div>
387
  <?php }
388
 
329
  </li>
330
  <?php if ( !class_exists( 'ast_pro' ) ) { ?>
331
  <li class="woocommerce-list__item has-action">
332
+ <a href="https://www.zorem.com/product/woocommerce-advanced-shipment-tracking/" class="woocommerce-list__item-inner" target="_blank">
333
  <div class="woocommerce-list__item-before">
334
  <span class="dashicons dashicons-media-document"></span>
335
  </div>
366
  </div>
367
 
368
  <div id="ast_settings_snackbar" class="ast_snackbar"><?php _e( 'Data saved successfully.', 'woo-advanced-shipment-tracking' )?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  </div>
370
  <?php }
371
 
includes/class-wc-advanced-shipment-tracking-settings.php CHANGED
@@ -406,8 +406,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
406
 
407
  $shippment_countries = $wpdb->get_results( "SELECT shipping_country FROM $this->table WHERE display_in_order = 1 GROUP BY shipping_country" );
408
 
409
- $default_provider = get_option("wc_ast_default_provider" );
410
-
411
  ob_start();
412
  ?>
413
  <div id="" class="trackingpopup_wrapper add_tracking_popup" style="display:none;">
@@ -425,7 +424,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
425
  </p>
426
  <p class="form-field form-50">
427
  <label for="tracking_number"><?php esc_html_e( 'Shipping Provider:', 'woo-advanced-shipment-tracking'); ?></label>
428
- <select class="chosen_select" id="tracking_provider" name="tracking_provider">
429
  <option value=""><?php esc_html_e( 'Shipping Provider:', 'woo-advanced-shipment-tracking' ); ?></option>
430
  <?php
431
  foreach ( $shippment_countries as $s_c ) {
@@ -467,7 +466,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
467
  </div>
468
  <div class="popupclose"></div>
469
  </div>
470
- <?php
471
  $html = ob_get_clean();
472
  echo $html;exit;
473
  }
@@ -502,7 +501,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
502
 
503
  if ( 1 == $reset_checked ) {
504
 
505
- $wpdb->query( 'DROP TABLE IF EXISTS $this->table' );
506
 
507
  $install = WC_Advanced_Shipment_Tracking_Install::get_instance();
508
  $install->create_shippment_tracking_table();
406
 
407
  $shippment_countries = $wpdb->get_results( "SELECT shipping_country FROM $this->table WHERE display_in_order = 1 GROUP BY shipping_country" );
408
 
409
+ $default_provider = get_option("wc_ast_default_provider" );
 
410
  ob_start();
411
  ?>
412
  <div id="" class="trackingpopup_wrapper add_tracking_popup" style="display:none;">
424
  </p>
425
  <p class="form-field form-50">
426
  <label for="tracking_number"><?php esc_html_e( 'Shipping Provider:', 'woo-advanced-shipment-tracking'); ?></label>
427
+ <select class="chosen_select tracking_provider_dropdown" id="tracking_provider" name="tracking_provider">
428
  <option value=""><?php esc_html_e( 'Shipping Provider:', 'woo-advanced-shipment-tracking' ); ?></option>
429
  <?php
430
  foreach ( $shippment_countries as $s_c ) {
466
  </div>
467
  <div class="popupclose"></div>
468
  </div>
469
+ <?php
470
  $html = ob_get_clean();
471
  echo $html;exit;
472
  }
501
 
502
  if ( 1 == $reset_checked ) {
503
 
504
+ $wpdb->query( "DROP TABLE IF EXISTS {$this->table}" );
505
 
506
  $install = WC_Advanced_Shipment_Tracking_Install::get_instance();
507
  $install->create_shippment_tracking_table();
includes/class-wc-advanced-shipment-tracking-trackship.php CHANGED
@@ -389,6 +389,7 @@ class WC_Advanced_Shipment_Tracking_Trackship {
389
  * include file on plugin load
390
  */
391
  public function on_plugins_loaded() {
 
392
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-tracking-page-customizer.php';
393
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-intransit-email-customizer.php';
394
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-failure-email-customizer.php';
@@ -620,29 +621,6 @@ class WC_Advanced_Shipment_Tracking_Trackship {
620
  public function wc_add_order_shipment_status_column_content( $column ) {
621
 
622
  global $post;
623
-
624
- if ( 'shipment_status_old' === $column ) {
625
-
626
- $shipment_status = get_post_meta( $post->ID, 'shipment_status', true );
627
-
628
- if ( is_array( $shipment_status ) ) {
629
- foreach ( $shipment_status as $data ) {
630
- $status = $data["status"];
631
- $est_delivery_date = $data["est_delivery_date"];
632
- echo "<div class='ast-shipment-status shipment-" . sanitize_title($status) . "' >" . apply_filters( 'trackship_status_filter', $status ) . apply_filters( 'trackship_status_icon_filter', "", $status ) . "</div>";
633
-
634
- $date = $data["status_date"];
635
- if ( $date ) {
636
- $date = date( "Y-m-d", strtotime( $date ) );
637
- echo "<span class=description>on {$date}</span>";
638
- }
639
- if ( $est_delivery_date ) {
640
- echo "<div>EST Delivery: {$est_delivery_date}</div>";
641
- }
642
- }
643
- }
644
- }
645
-
646
  if ( 'shipment_status' === $column ) {
647
 
648
  $ast = new WC_Advanced_Shipment_Tracking_Actions;
389
  * include file on plugin load
390
  */
391
  public function on_plugins_loaded() {
392
+ require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-trackship-customizer.php';
393
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-tracking-page-customizer.php';
394
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-intransit-email-customizer.php';
395
  require_once wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/class-wc-failure-email-customizer.php';
621
  public function wc_add_order_shipment_status_column_content( $column ) {
622
 
623
  global $post;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  if ( 'shipment_status' === $column ) {
625
 
626
  $ast = new WC_Advanced_Shipment_Tracking_Actions;
includes/class-wc-advanced-shipment-tracking.php CHANGED
@@ -317,7 +317,7 @@ class WC_Advanced_Shipment_Tracking_Actions {
317
  <input type="text" class="short" style="" name="tracking_number" id="tracking_number" value="" autocomplete="off">
318
  </p>
319
  <?php
320
- echo '<p class="form-field tracking_provider_field"><label for="tracking_provider">' . __( 'Shipping Provider:', 'woo-advanced-shipment-tracking' ) . '</label><br/><select id="tracking_provider" name="tracking_provider" class="chosen_select" style="width:100%;">';
321
 
322
  echo '<option value="">'.__( 'Select Provider', 'woo-advanced-shipment-tracking' ).'</option>';
323
 
317
  <input type="text" class="short" style="" name="tracking_number" id="tracking_number" value="" autocomplete="off">
318
  </p>
319
  <?php
320
+ echo '<p class="form-field tracking_provider_field"><label for="tracking_provider">' . __( 'Shipping Provider:', 'woo-advanced-shipment-tracking' ) . '</label><br/><select id="tracking_provider" name="tracking_provider" class="chosen_select tracking_provider_dropdown" style="width:100%;">';
321
 
322
  echo '<option value="">'.__( 'Select Provider', 'woo-advanced-shipment-tracking' ).'</option>';
323
 
includes/customizer/class-trackship-customizer.php ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ class WC_TrackShip_Customizer {
7
+
8
+ /**
9
+ * Instance of this class.
10
+ *
11
+ * @var object Class Instance
12
+ */
13
+ private static $instance;
14
+
15
+ /**
16
+ * Initialize the main plugin function
17
+ */
18
+ public function __construct() {
19
+ }
20
+
21
+ /**
22
+ * Register the Customizer sections
23
+ */
24
+ public function wcast_add_customizer_sections( $wp_customize ) {
25
+
26
+ /**
27
+ * Tracking Page Customizer Section
28
+ */
29
+ $wp_customize->add_section( 'ast_tracking_page_section',
30
+ array(
31
+ 'title' => __( 'Tracking Page Widget', 'woo-advanced-shipment-tracking' ),
32
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' )
33
+ )
34
+ );
35
+
36
+ $wp_customize->add_section( 'trackship_shipment_status_email',
37
+ array(
38
+ 'title' => __( 'Shipping and Delivery Emails', 'woo-advanced-shipment-tracking' ),
39
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
40
+ )
41
+ );
42
+ }
43
+
44
+ /**
45
+ * add css and js for preview
46
+ */
47
+ public function enqueue_preview_scripts() {
48
+
49
+ wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
50
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
51
+ wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
52
+ 'site_title' => $this->get_blogname(),
53
+ 'order_number' => get_theme_mod('wcast_email_preview_order_id'),
54
+ ));
55
+ }
56
+
57
+ /**
58
+ * Get blog name formatted for emails.
59
+ *
60
+ * @return string
61
+ */
62
+ public function get_blogname() {
63
+ return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
64
+ }
65
+
66
+ /**
67
+ * add css and js for customizer
68
+ */
69
+ public function enqueue_customizer_scripts(){
70
+
71
+ if(isset( $_REQUEST['trackship-customizer'] ) && '1' === $_REQUEST['trackship-customizer']){
72
+ wp_enqueue_style( 'wp-color-picker' );
73
+ wp_enqueue_style('wcast-customizer-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/customizer-styles.css', array(), wc_advanced_shipment_tracking()->version );
74
+ wp_enqueue_script('wcast-customizer-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/customizer-scripts.js', array('jquery', 'customize-controls','wp-color-picker'), wc_advanced_shipment_tracking()->version, true);
75
+
76
+ $shipment_status = ( isset($_REQUEST['shipment_status']) ) ? $_REQUEST['shipment_status'] : 'in_transit';
77
+
78
+ // Send variables to Javascript
79
+ wp_localize_script('wcast-customizer-scripts', 'wcast_customizer', array(
80
+ 'ajax_url' => admin_url('admin-ajax.php'),
81
+ 'shipment_status' => $shipment_status,
82
+ 'tracking_preview_url' => $this->get_tracking_preview_url(),
83
+ 'tracking_page_preview_url' => $this->get_tracking_page_preview_url(),
84
+ 'customer_failure_preview_url' => $this->get_customer_failure_preview_url(),
85
+ 'customer_exception_preview_url' => $this->get_customer_exception_preview_url(),
86
+ 'customer_intransit_preview_url' => $this->get_customer_intransit_preview_url(),
87
+ 'customer_onhold_preview_url' => $this->get_customer_onhold_preview_url(),
88
+ 'customer_outfordelivery_preview_url' => $this->get_customer_outfordelivery_preview_url(),
89
+ 'customer_delivered_preview_url' => $this->get_customer_delivered_preview_url(),
90
+ 'customer_returntosender_preview_url' => $this->get_customer_returntosender_preview_url(),
91
+ 'customer_availableforpickup_preview_url' => $this->get_customer_availableforpickup_preview_url(),
92
+ 'trigger_click' => '#accordion-section-'.$_REQUEST['email'].' h3',
93
+ 'customizer_title' => 'TrackShip',
94
+ ));
95
+
96
+ wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
97
+ 'clear' => __( 'Clear' ),
98
+ 'clearAriaLabel' => __( 'Clear color' ),
99
+ 'defaultString' => __( 'Default' ),
100
+ 'defaultAriaLabel' => __( 'Select default color' ),
101
+ 'pick' => __( 'Select Color' ),
102
+ 'defaultLabel' => __( 'Color value' ),
103
+ ));
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Get Customizer URL
109
+ *
110
+ */
111
+ public function get_tracking_preview_url() {
112
+ return add_query_arg( array(
113
+ 'wcast-tracking-preview' => '1',
114
+ ), home_url( '' ) );
115
+ }
116
+
117
+ /**
118
+ * Get Tracking Page Preview URL
119
+ *
120
+ */
121
+ public function get_tracking_page_preview_url() {
122
+ return add_query_arg( array(
123
+ 'action' => 'preview_tracking_page',
124
+ ), home_url( '' ) );
125
+ }
126
+
127
+ /**
128
+ * Get Failuere Shipment status preview URL
129
+ *
130
+ */
131
+ public function get_customer_failure_preview_url() {
132
+ return add_query_arg( array(
133
+ 'wcast-failure-email-customizer-preview' => '1',
134
+ ), home_url( '' ) );
135
+ }
136
+
137
+ /**
138
+ * Get Exception Shipment status preview URL
139
+ *
140
+ */
141
+ public function get_customer_exception_preview_url(){
142
+ return add_query_arg( array(
143
+ 'wcast-exception-email-customizer-preview' => '1',
144
+ ), home_url( '' ) );
145
+ }
146
+
147
+ /**
148
+ * Get Tracking page preview URL
149
+ *
150
+ */
151
+ public function get_customer_intransit_preview_url() {
152
+ return add_query_arg( array(
153
+ 'wcast-intransit-email-customizer-preview' => '1',
154
+ ), home_url( '' ) );
155
+ }
156
+
157
+ /**
158
+ * Get Tracking page preview URL
159
+ *
160
+ */
161
+ public function get_customer_onhold_preview_url() {
162
+ return add_query_arg( array(
163
+ 'wcast-onhold-email-customizer-preview' => '1',
164
+ ), home_url( '' ) );
165
+ }
166
+
167
+ /**
168
+ * Get Tracking page preview URL
169
+ *
170
+ */
171
+ public function get_customer_outfordelivery_preview_url() {
172
+ return add_query_arg( array(
173
+ 'wcast-outfordelivery-email-customizer-preview' => '1',
174
+ ), home_url( '' ) );
175
+ }
176
+
177
+ /**
178
+ * Get Tracking page preview URL
179
+ *
180
+ */
181
+ public function get_customer_delivered_preview_url() {
182
+ return add_query_arg( array(
183
+ 'wcast-delivered-email-customizer-preview' => '1',
184
+ ), home_url( '' ) );
185
+ }
186
+
187
+ /**
188
+ * Get Tracking page preview URL
189
+ *
190
+ */
191
+ public function get_customer_returntosender_preview_url() {
192
+ return add_query_arg( array(
193
+ 'wcast-returntosender-email-customizer-preview' => '1',
194
+ ), home_url( '' ) );
195
+ }
196
+
197
+ /**
198
+ * Get Tracking page preview URL
199
+ *
200
+ */
201
+ public function get_customer_availableforpickup_preview_url() {
202
+ return add_query_arg( array(
203
+ 'wcast-availableforpickup-email-customizer-preview' => '1',
204
+ ), home_url( '' ) );
205
+ }
206
+
207
+ /**
208
+ * Remove unrelated components
209
+ *
210
+ * @access public
211
+ * @param array $components
212
+ * @param object $wp_customize
213
+ * @return array
214
+ */
215
+ public function remove_unrelated_components($components, $wp_customize) {
216
+ // Iterate over components
217
+ foreach ($components as $component_key => $component) {
218
+ // Check if current component is own component
219
+ if ( ! $this->is_own_component( $component ) ) {
220
+ unset($components[$component_key]);
221
+ }
222
+ }
223
+
224
+ // Return remaining components
225
+ return $components;
226
+ }
227
+
228
+ /**
229
+ * Remove unrelated sections
230
+ *
231
+ * @access public
232
+ * @param bool $active
233
+ * @param object $section
234
+ * @return bool
235
+ */
236
+ public function remove_unrelated_sections( $active, $section ) {
237
+ // Check if current section is own section
238
+ if ( ! $this->is_own_section( $section->id ) ) {
239
+ return false;
240
+ }
241
+
242
+ // We can override $active completely since this runs only on own Customizer requests
243
+ return true;
244
+ }
245
+
246
+ /**
247
+ * Check if current component is own component
248
+ *
249
+ * @access public
250
+ * @param string $component
251
+ * @return bool
252
+ */
253
+ public function is_own_component( $component ) {
254
+ return false;
255
+ }
256
+
257
+ /**
258
+ * Check if current section is own section
259
+ *
260
+ * @access public
261
+ * @param string $key
262
+ * @return bool
263
+ */
264
+ public function is_own_section( $key ) {
265
+
266
+ if ( $key === 'trackship_shipment_status_email' || $key === 'ast_tracking_page_section' ) {
267
+ return true;
268
+ }
269
+
270
+ // Section not found
271
+ return false;
272
+ }
273
+
274
+ /*
275
+ * Unhook flatsome front end.
276
+ */
277
+ public function unhook_flatsome() {
278
+ // Unhook flatsome issue.
279
+ wp_dequeue_style( 'flatsome-customizer-preview' );
280
+ wp_dequeue_script( 'flatsome-customizer-frontend-js' );
281
+ }
282
+
283
+ /*
284
+ * Unhook Divi front end.
285
+ */
286
+ public function unhook_divi() {
287
+ // Divi Theme issue.
288
+ remove_action( 'wp_footer', 'et_builder_get_modules_js_data' );
289
+ remove_action( 'et_customizer_footer_preview', 'et_load_social_icons' );
290
+ }
291
+ }
292
+ /**
293
+ * Returns an instance of WC_TrackShip_Customizer.
294
+ *
295
+ * @since 1.6.5
296
+ * @version 1.6.5
297
+ *
298
+ * @return WC_TrackShip_Customizer
299
+ */
300
+ function ts_customizer() {
301
+ static $instance;
302
+
303
+ if ( ! isset( $instance ) ) {
304
+ $instance = new WC_TrackShip_Customizer();
305
+ }
306
+
307
+ return $instance;
308
+ }
309
+
310
+ /**
311
+ * Register this class globally.
312
+ *
313
+ * Backward compatibility.
314
+ */
315
+ ts_customizer();
includes/customizer/class-wc-availableforpickup-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_availableforpickup_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
includes/customizer/class-wc-delivered-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_delivered_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
includes/customizer/class-wc-exception-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_exception_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
includes/customizer/class-wc-failure-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_failure_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
includes/customizer/class-wc-intransit-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_intransit_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
@@ -71,7 +71,7 @@ class wcast_intransit_customizer_email {
71
  public function get_customizer_url( $email, $shipment_status, $return_tab ) {
72
  $preview_status = str_replace( "_", "", $shipment_status );
73
  return add_query_arg( array(
74
- 'wcast-customizer' => '1',
75
  'email' => $email,
76
  'shipment_status' => $shipment_status,
77
  'autofocus[section]' => 'trackship_shipment_status_email',
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
71
  public function get_customizer_url( $email, $shipment_status, $return_tab ) {
72
  $preview_status = str_replace( "_", "", $shipment_status );
73
  return add_query_arg( array(
74
+ 'trackship-customizer' => '1',
75
  'email' => $email,
76
  'shipment_status' => $shipment_status,
77
  'autofocus[section]' => 'trackship_shipment_status_email',
includes/customizer/class-wc-onhold-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_onhold_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
includes/customizer/class-wc-outfordelivery-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_outfordelivery_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
  }
46
 
47
  /**
includes/customizer/class-wc-returntosender-email-customizer.php CHANGED
@@ -23,25 +23,25 @@ class wcast_returntosender_customizer_email {
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
- add_action( 'customize_preview_init', array( wcast_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
23
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
24
 
25
  // Register our sections
26
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
27
 
28
  // Remove unrelated components.
29
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
30
 
31
  // Remove unrelated sections.
32
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
33
 
34
  // Unhook divi front end.
35
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
36
 
37
  // Unhook Flatsome js
38
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
39
 
40
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
41
 
42
  add_action( 'parse_request', array( $this, 'set_up_preview' ) );
43
 
44
+ add_action( 'customize_preview_init', array( ts_customizer(), 'enqueue_preview_scripts' ) );
45
 
46
  }
47
 
includes/customizer/class-wc-tracking-page-customizer.php CHANGED
@@ -22,23 +22,21 @@ class ts_tracking_page_customizer {
22
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
23
 
24
  // Register our sections
25
- add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_sections' ) );
26
 
27
  // Remove unrelated components.
28
- add_filter( 'customize_loaded_components', array( wcast_customizer(), 'remove_unrelated_components' ), 99, 2 );
29
 
30
  // Remove unrelated sections.
31
- add_filter( 'customize_section_active', array( wcast_customizer(), 'remove_unrelated_sections' ), 10, 2 );
32
 
33
  // Unhook divi front end.
34
- add_action( 'woomail_footer', array( wcast_customizer(), 'unhook_divi' ), 10 );
35
 
36
  // Unhook Flatsome js
37
- add_action( 'customize_preview_init', array( wcast_customizer(), 'unhook_flatsome' ), 50 );
38
 
39
- add_filter( 'customize_controls_enqueue_scripts', array( wcast_customizer(), 'enqueue_customizer_scripts' ) );
40
-
41
- //add_action( 'parse_request', array( $this, 'set_up_preview' ) );
42
 
43
  add_action( 'customize_preview_init', array( $this, 'enqueue_preview_scripts' ) );
44
  }
@@ -92,7 +90,7 @@ class ts_tracking_page_customizer {
92
  */
93
  public function get_customizer_url( $email, $return_tab ) {
94
  return add_query_arg( array(
95
- 'wcast-customizer' => '1',
96
  'email' => $email,
97
  'autofocus[section]' => 'ast_tracking_page_section',
98
  'url' => urlencode( add_query_arg( array( 'action' => 'preview_tracking_page' ), home_url( '/' ) ) ),
@@ -168,7 +166,7 @@ class ts_tracking_page_customizer {
168
  $wp_customize->add_setting( 'wc_ast_select_border_color',
169
  array(
170
  'default' => $this->defaults['wc_ast_select_border_color'],
171
- 'transport' => 'refresh',
172
  'sanitize_callback' => '',
173
  'type' => 'option',
174
  )
@@ -184,7 +182,7 @@ class ts_tracking_page_customizer {
184
  $wp_customize->add_setting( 'wc_ast_select_bg_color',
185
  array(
186
  'default' => $this->defaults['wc_ast_select_bg_color'],
187
- 'transport' => 'refresh',
188
  'sanitize_callback' => '',
189
  'type' => 'option',
190
  )
@@ -224,7 +222,7 @@ class ts_tracking_page_customizer {
224
  $wp_customize->add_setting( 'wc_ast_hide_tracking_provider_image',
225
  array(
226
  'default' => $this->defaults['wc_ast_hide_tracking_provider_image'],
227
- 'transport' => 'refresh',
228
  'sanitize_callback' => '',
229
  'type' => 'option',
230
  )
@@ -240,7 +238,7 @@ class ts_tracking_page_customizer {
240
  $wp_customize->add_setting( 'wc_ast_link_to_shipping_provider',
241
  array(
242
  'default' => $this->defaults['wc_ast_link_to_shipping_provider'],
243
- 'transport' => 'refresh',
244
  'sanitize_callback' => '',
245
  'type' => 'option',
246
  )
22
  if ( ! $this->is_own_customizer_request() && ! $this->is_own_preview_request() )return;
23
 
24
  // Register our sections
25
+ add_action( 'customize_register', array( ts_customizer(), 'wcast_add_customizer_sections' ) );
26
 
27
  // Remove unrelated components.
28
+ add_filter( 'customize_loaded_components', array( ts_customizer(), 'remove_unrelated_components' ), 99, 2 );
29
 
30
  // Remove unrelated sections.
31
+ add_filter( 'customize_section_active', array( ts_customizer(), 'remove_unrelated_sections' ), 10, 2 );
32
 
33
  // Unhook divi front end.
34
+ add_action( 'woomail_footer', array( ts_customizer(), 'unhook_divi' ), 10 );
35
 
36
  // Unhook Flatsome js
37
+ add_action( 'customize_preview_init', array( ts_customizer(), 'unhook_flatsome' ), 50 );
38
 
39
+ add_filter( 'customize_controls_enqueue_scripts', array( ts_customizer(), 'enqueue_customizer_scripts' ) );
 
 
40
 
41
  add_action( 'customize_preview_init', array( $this, 'enqueue_preview_scripts' ) );
42
  }
90
  */
91
  public function get_customizer_url( $email, $return_tab ) {
92
  return add_query_arg( array(
93
+ 'trackship-customizer' => '1',
94
  'email' => $email,
95
  'autofocus[section]' => 'ast_tracking_page_section',
96
  'url' => urlencode( add_query_arg( array( 'action' => 'preview_tracking_page' ), home_url( '/' ) ) ),
166
  $wp_customize->add_setting( 'wc_ast_select_border_color',
167
  array(
168
  'default' => $this->defaults['wc_ast_select_border_color'],
169
+ 'transport' => 'postMessage',
170
  'sanitize_callback' => '',
171
  'type' => 'option',
172
  )
182
  $wp_customize->add_setting( 'wc_ast_select_bg_color',
183
  array(
184
  'default' => $this->defaults['wc_ast_select_bg_color'],
185
+ 'transport' => 'postMessage',
186
  'sanitize_callback' => '',
187
  'type' => 'option',
188
  )
222
  $wp_customize->add_setting( 'wc_ast_hide_tracking_provider_image',
223
  array(
224
  'default' => $this->defaults['wc_ast_hide_tracking_provider_image'],
225
+ 'transport' => 'postMessage',
226
  'sanitize_callback' => '',
227
  'type' => 'option',
228
  )
238
  $wp_customize->add_setting( 'wc_ast_link_to_shipping_provider',
239
  array(
240
  'default' => $this->defaults['wc_ast_link_to_shipping_provider'],
241
+ 'transport' => 'postMessage',
242
  'sanitize_callback' => '',
243
  'type' => 'option',
244
  )
includes/customizer/class-wcast-customizer.php CHANGED
@@ -30,28 +30,11 @@ class WC_Advanced_Shipment_Tracking_Customizer {
30
  )
31
  );
32
 
33
- /**
34
- * Tracking Page Customizer Section
35
- */
36
- $wp_customize->add_section( 'ast_tracking_page_section',
37
- array(
38
- 'title' => __( 'Tracking Page Widget', 'woo-advanced-shipment-tracking' ),
39
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' )
40
- )
41
- );
42
-
43
  $wp_customize->add_section( 'custom_order_status_email',
44
  array(
45
  'title' => __( 'Custom order status email', 'woo-advanced-shipment-tracking' ),
46
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
47
  )
48
- );
49
-
50
- $wp_customize->add_section( 'trackship_shipment_status_email',
51
- array(
52
- 'title' => __( 'Shipping and Delivery Emails', 'woo-advanced-shipment-tracking' ),
53
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
54
- )
55
  );
56
  }
57
 
@@ -92,24 +75,25 @@ class WC_Advanced_Shipment_Tracking_Customizer {
92
 
93
  // Send variables to Javascript
94
  wp_localize_script('wcast-customizer-scripts', 'wcast_customizer', array(
95
- 'ajax_url' => admin_url('admin-ajax.php'),
96
- 'email_preview_url' => $this->get_email_preview_url(),
97
- 'partial_shipped_email_preview_url' => $this->get_partial_shipped_email_preview_url(),
98
- 'shipped_email_preview_url' => $this->get_shipped_email_preview_url(),
99
- 'updated_tracking_email_preview_url' => $this->get_updated_tracking_email_preview_url(),
100
- 'email_type' => $email_type,
101
- 'shipment_status' => $shipment_status,
102
- 'tracking_preview_url' => $this->get_tracking_preview_url(),
103
- 'tracking_page_preview_url' => $this->get_tracking_page_preview_url(),
104
- 'customer_failure_preview_url' => $this->get_customer_failure_preview_url(),
105
- 'customer_exception_preview_url' => $this->get_customer_exception_preview_url(),
106
- 'customer_intransit_preview_url' => $this->get_customer_intransit_preview_url(),
107
- 'customer_onhold_preview_url' => $this->get_customer_onhold_preview_url(),
108
- 'customer_outfordelivery_preview_url' => $this->get_customer_outfordelivery_preview_url(),
109
- 'customer_delivered_preview_url' => $this->get_customer_delivered_preview_url(),
110
- 'customer_returntosender_preview_url' => $this->get_customer_returntosender_preview_url(),
111
  'customer_availableforpickup_preview_url' => $this->get_customer_availableforpickup_preview_url(),
112
- 'trigger_click' => '#accordion-section-'.$_REQUEST['email'].' h3',
 
113
  ));
114
 
115
  wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
@@ -332,7 +316,7 @@ class WC_Advanced_Shipment_Tracking_Customizer {
332
  */
333
  public function is_own_section( $key ) {
334
 
335
- if ($key === 'wcast_naviation_panel' || $key === 'ast_tracking_general_section' || $key === 'custom_order_status_email' || $key === 'trackship_shipment_status_email' || $key === 'ast_tracking_page_section' ) {
336
  return true;
337
  }
338
 
30
  )
31
  );
32
 
 
 
 
 
 
 
 
 
 
 
33
  $wp_customize->add_section( 'custom_order_status_email',
34
  array(
35
  'title' => __( 'Custom order status email', 'woo-advanced-shipment-tracking' ),
36
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
37
  )
 
 
 
 
 
 
 
38
  );
39
  }
40
 
75
 
76
  // Send variables to Javascript
77
  wp_localize_script('wcast-customizer-scripts', 'wcast_customizer', array(
78
+ 'ajax_url' => admin_url('admin-ajax.php'),
79
+ 'email_preview_url' => $this->get_email_preview_url(),
80
+ 'partial_shipped_email_preview_url' => $this->get_partial_shipped_email_preview_url(),
81
+ 'shipped_email_preview_url' => $this->get_shipped_email_preview_url(),
82
+ 'updated_tracking_email_preview_url' => $this->get_updated_tracking_email_preview_url(),
83
+ 'email_type' => $email_type,
84
+ 'shipment_status' => $shipment_status,
85
+ 'tracking_preview_url' => $this->get_tracking_preview_url(),
86
+ 'tracking_page_preview_url' => $this->get_tracking_page_preview_url(),
87
+ 'customer_failure_preview_url' => $this->get_customer_failure_preview_url(),
88
+ 'customer_exception_preview_url' => $this->get_customer_exception_preview_url(),
89
+ 'customer_intransit_preview_url' => $this->get_customer_intransit_preview_url(),
90
+ 'customer_onhold_preview_url' => $this->get_customer_onhold_preview_url(),
91
+ 'customer_outfordelivery_preview_url' => $this->get_customer_outfordelivery_preview_url(),
92
+ 'customer_delivered_preview_url' => $this->get_customer_delivered_preview_url(),
93
+ 'customer_returntosender_preview_url' => $this->get_customer_returntosender_preview_url(),
94
  'customer_availableforpickup_preview_url' => $this->get_customer_availableforpickup_preview_url(),
95
+ 'trigger_click' => '#accordion-section-'.$_REQUEST['email'].' h3',
96
+ 'customizer_title' => 'Shipment Tracking',
97
  ));
98
 
99
  wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
316
  */
317
  public function is_own_section( $key ) {
318
 
319
+ if ( $key === 'ast_tracking_general_section' || $key === 'custom_order_status_email' ) {
320
  return true;
321
  }
322
 
includes/views/admin_options_addons.php CHANGED
@@ -55,12 +55,12 @@ $more_plugins = array(
55
 
56
  $ast_paid_addons = array(
57
  0 => array(
58
- 'title' => 'Tracking Per Item Add-on',
59
- 'description' => 'The Tracking per item is add-on for the Advanced Shipment Tracking for WooCommerce plugin that lets you attach tracking numbers to line items and to line item quantities.',
60
  'url' => 'https://www.zorem.com/product/tracking-per-item-ast-add-on/',
61
- 'image' => 'tpi-addon-icon.png',
62
- 'file' => 'ast-tracking-per-order-items/ast-tracking-per-order-items.php',
63
- 'price' => 59,
64
  ),
65
  1 => array(
66
  'title' => 'PayPal Tracking Add-on',
@@ -99,20 +99,18 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
99
  <div class="ast-row">
100
  <div class="as-col-6">
101
  <div class="ts_col_inner">
102
- <h1 class="ts_landing_header">Advanced Shipment Tracking PRO</h1>
103
  <ul class="ast_pro_features_list">
104
  <li>Premium Support</li>
105
  <li>Tracking per item</li>
106
  <li>Fluid Responsive tracking widget</li>
107
  <li>Custom order status "Shipped"</li>
108
- <li>Custom email templates</li>
109
- <li>PayPal tracking integration</li>
110
  <li>Unfulfilled orders filter</li>
111
- <li>Auto-detect shipping providers</li>
112
- <li>Paste tracking numbers</li>
113
- <li>Integrations with ShipStation WC Shipping and more..</li>
114
  </ul>
115
- <a href="#" class="button-primary btn_ast2 btn_large">COMING SOON</a>
116
  </div>
117
  </div>
118
  <div class="as-col-6">
@@ -124,6 +122,47 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
124
  </div>
125
  <?php } ?>
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  <div class="plugins_section free_plugin_section">
128
  <?php foreach($more_plugins as $plugin){ ?>
129
  <div class="single_plugin as-col-4">
55
 
56
  $ast_paid_addons = array(
57
  0 => array(
58
+ 'title' => '',
59
+ 'description' => '',
60
  'url' => 'https://www.zorem.com/product/tracking-per-item-ast-add-on/',
61
+ 'image' => 'trackship-logo.png',
62
+ 'file' => '',
63
+ 'price' => '',
64
  ),
65
  1 => array(
66
  'title' => 'PayPal Tracking Add-on',
99
  <div class="ast-row">
100
  <div class="as-col-6">
101
  <div class="ts_col_inner">
102
+ <h1 class="ast_pro_landing_header">Advanced Shipment Tracking Pro</h1>
103
  <ul class="ast_pro_features_list">
104
  <li>Premium Support</li>
105
  <li>Tracking per item</li>
106
  <li>Fluid Responsive tracking widget</li>
107
  <li>Custom order status "Shipped"</li>
108
+ <li>Custom email templates</li>
 
109
  <li>Unfulfilled orders filter</li>
110
+ <li>Auto-detect shipping providers</li>
111
+ <li>Integrations with ShipStation, WooCommerce Shipping, Royal Mail Click & Drop and more..</li>
 
112
  </ul>
113
+ <a href="https://www.zorem.com/product/woocommerce-advanced-shipment-tracking/" class="button-primary btn_ast2 btn_large" target="_blank">UPGRADE NOW</a>
114
  </div>
115
  </div>
116
  <div class="as-col-6">
122
  </div>
123
  <?php } ?>
124
 
125
+ <div class="plugins_section free_plugin_section">
126
+ <div class="single_plugin as-col-6">
127
+ <div class="free_plugin_inner">
128
+ <div class="ast_paid_plugin_image">
129
+ <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/trackship-logo.png">
130
+ </div>
131
+ <div class="paid_plugin_description">
132
+ <h3>Your Post-Shipping & Delivery Autopilot</h3>
133
+ <p>Trackship is a Multi-Carrier Shipment Tracking API that seamlessly integrates into your WooCommerce store and auto-tracks your shipments.</p>
134
+
135
+ <?php
136
+ $wc_ast_api_key = get_option('wc_ast_api_key');
137
+ if ( $wc_ast_api_key ) {
138
+ ?>
139
+ <a href="https://trackship.info/my-account/" class="button button-primary btn_green2" target="blank"><?php _e('Connected', 'woo-advanced-shipment-tracking'); ?></a>
140
+ <?php } else { ?>
141
+ <a href="https://trackship.info/?utm_source=wpadmin&utm_campaign=tspage" class="button button-primary btn_ast2" target="blank"><?php _e('Connect your store', 'woo-advanced-shipment-tracking'); ?></a>
142
+ <?php } ?>
143
+
144
+ </div>
145
+ </div>
146
+ </div>
147
+ <div class="single_plugin as-col-6">
148
+ <div class="free_plugin_inner">
149
+ <div class="ast_paid_plugin_image">
150
+ <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/paypal-addon-banner.png">
151
+ </div>
152
+ <div class="paid_plugin_description">
153
+ <h3 class="plugin_title">PayPal Tracking for WooCommerce</h3>
154
+ <p>This add-on extends the Advanced shipment tracking plugin and will automatically send tracking numbers and associated information from WooCommerce to PayPal using the PayPal API.</p>
155
+ <?php
156
+ if ( is_plugin_active( 'paypal-tracking-add-on-for-ast/paypal-tracking-add-on-for-ast.php' ) ) { ?>
157
+ <button type="button" class="button button button-primary btn_green2">Active</button>
158
+ <?php } else { ?>
159
+ <a href="https://www.zorem.com/product/paypal-tracking-add-on/" class="button button-primary btn_ast2" target="blank"><?php _e('More Info', 'woo-advanced-shipment-tracking'); ?></a>
160
+ <?php } ?>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+
166
  <div class="plugins_section free_plugin_section">
167
  <?php foreach($more_plugins as $plugin){ ?>
168
  <div class="single_plugin as-col-4">
includes/views/front/preview_tracking_page.php CHANGED
@@ -24,6 +24,14 @@
24
  background: <?php echo $background_color; ?>;
25
  }
26
  <?php } ?>
 
 
 
 
 
 
 
 
27
  </style>
28
 
29
  <div class="tracking-detail col">
@@ -33,23 +41,18 @@
33
  <span><?php _e( 'Order', 'woocommerce' ); ?> <strong>#14696 </strong></span>
34
  </div>
35
 
36
- <div class="tracking-header">
37
- <?php if($hide_tracking_provider_image != 1) { ?>
38
- <div class="provider_image_div" style="">
39
- <img class="provider_image" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/usps.png?v=3.1.1">
40
- </div>
41
- <?php } ?>
42
 
43
  <div class="tracking_number_div">
44
  <ul>
45
  <li>
46
  USPS:
47
- <?php
48
- if($wc_ast_link_to_shipping_provider == 1) { ?>
49
- <a href="https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=9410803699300126968507" target="blank"><strong>9410803699300126968507</strong></a>
50
- <?php } else{ ?>
51
- <strong>9410803699300126968507</strong>
52
- <?php } ?>
53
  </li>
54
  </ul>
55
  </div>
24
  background: <?php echo $background_color; ?>;
25
  }
26
  <?php } ?>
27
+ <?php if( $hide_tracking_provider_image ) { ?>
28
+ .provider_image_div{display:none;}
29
+ <?php } ?>
30
+ <?php if ( $wc_ast_link_to_shipping_provider ) { ?>
31
+ .tracking_number_div ul li > strong{display:none;}
32
+ <?php } else { ?>
33
+ .tracking_number_div ul li > a{display:none;}
34
+ <?php } ?>
35
  </style>
36
 
37
  <div class="tracking-detail col">
41
  <span><?php _e( 'Order', 'woocommerce' ); ?> <strong>#14696 </strong></span>
42
  </div>
43
 
44
+ <div class="tracking-header">
45
+
46
+ <div class="provider_image_div" style="">
47
+ <img class="provider_image" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/usps.png?v=3.1.1">
48
+ </div>
 
49
 
50
  <div class="tracking_number_div">
51
  <ul>
52
  <li>
53
  USPS:
54
+ <a href="https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=9410803699300126968507" target="blank"><strong>9410803699300126968507</strong></a>
55
+ <strong>9410803699300126968507</strong>
 
 
 
 
56
  </li>
57
  </ul>
58
  </div>
readme.txt CHANGED
@@ -14,13 +14,11 @@ Add shipment tracking information to your WooCommerce orders and provide your cu
14
 
15
  Advanced Shipment Tracking (AST) for WooCommerce lets you add tracking information to orders and provides your customers an easy way to track their orders. AST provides powerful features that let WooCommerce shop owners to better manage and automate their post-shipping orders flow, reduce time spent on customer service and increase customer satisfaction.
16
 
17
- Advanced Shipment Tracking is the #1 shipment tracking plugin for WooCommerce. AST provides powerful tools that help shops to manage WooCommerce orders in a more officiant ways and to automate the post-shipping operations.
18
-
19
  https://www.youtube.com/watch?v=QOVbwfgXQdU
20
 
21
  ==Key Features==
22
 
23
- * **Easily add Tracking information to orders**
24
  Easily add tracking information to your orders, AST lets you add the tracking from the WooCommerce orders admin or from a single order admin, we also allow you to mark the order as Completed when adding the tracking information.
25
 
26
  * **Customize The Tracking Display on the Order Emails**
@@ -44,40 +42,34 @@ If your shipper provides the tracking information in files and you want to avoid
44
  * **Custom Order Statuses**
45
  Improve your order management flow, with custom order statuses, enable the Partially Shipped for orders that you ship in separate packages at different times or enable the Delivered order status if you use [TrackShip](https://trackship.info/) for tracking & delivery automation.
46
 
47
- * **Compatibility with many shipping providers plugins and services**
48
- AST is compatible with many shipping labels plugins.
49
-
50
- == PREMIUM ADD-ONS ==
51
 
52
- **Tracking Per Item Add-on** - The Tracking per item add-on allows you to attach tracking numbers to specific order items and also to attach tracking numbers to different quantities of the same line item.
53
- [Get this Add-on](https://www.zorem.com/shop/tracking-per-item-ast-add-on/)
54
-
55
- **PayPal Tracking Add-on** - Save time on manual work, automatically send tracking numbers and associated information from WooCommerce to PayPal using the PayPal API. Sending the tracking information to PayPal can help reduce chargebacks and will help you to quickly resolve PayPal payment holds.
56
- [Get this Add-on](https://www.zorem.com/product/paypal-tracking-add-on/)
 
 
 
 
57
 
58
- **WooCommerce Shipping Tracking Add-on**
59
- Save time on manual work, automatically add the tracking information into the AST shipment tracking for orders shipped with WooCommerce Shipping. This Add-on provides integration with the [WooCommerce Shipping & Tax tracking integration]() plugin.
60
- [Ge the WooCommerce Shipping Tracking Add-on](https://www.zorem.com/product/wc-shipping-tracking-add-on/)
61
 
62
- **ShipStation Tracking Add-on**
63
- Save time on manual work, automatically add the tracking information into the AST shipment tracking for orders shipped with ShipStation. This Add-on provides integration with the [WooCommerce ShipStation integration](https://wordpress.org/plugins/woocommerce-shipstation-integration/) plugin
64
- [Get the ShipStation Tracking Add-on](https://www.zorem.com/product/shipstation-tracking-add-on/)
65
-
66
- **ReadyToShip Tracking Add-on**
67
- Save time on manual work, automatically add the tracking information into the AST shipment tracking for orders shipped with ReadyToShip.
68
- [Get the ReadyToShip Tracking Add-on](https://www.zorem.com/product/readytoship-tracking-add-on/)
69
 
 
70
 
71
- **TrackShip Integration** - [TrackShip](https://trackship.info/) is a multi-carrier shipment tracking API that seamlessly integrates into your store and works inside the WooCommerce ecosystem. TrackShip will auto-track your Shipped orders and will proactively update your orders with shipments status changes, until the shipments are delivered to your customers.
72
- TrackShip allows you to provide “Amazon” style post-purchase experience to your customers, it will automate your orders workflow, reduce customer inquiries after shipping and time spent on customer service, and will keep your customers informed on their order status at all times.
73
 
74
- * Auto-track shipped orders with 200+ shipping providers
75
- * Up-to-date shipment status and est. delivery date on your orders admin
76
- * Automatically change the order status to Delivered once it’s delivered to your customers
77
- * Send shipment status update emails to notify your customers when their shipments are Out For Delivery, Delivered or have an exception
78
- * Direct customers to a detailed Tracking Page on your store
79
 
80
- You must have a [TrackShip](https://trackship.info/) account to activate these advanced features.
81
 
82
  == Compatibility ==
83
  The Advanced Shipment Tracking plugin is compatible with many other plugins such as shipping label plugins and services, email customizer plugins, Customer order number plugins, PDF invoices plugins, multi vendor plugins, SMS plugins and more. Check out [AST's full list of plugins compatibility](https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/compatibility/).
@@ -94,9 +86,10 @@ If your language is not in this list and you want us to include it in the plugi
94
 
95
  == Shipping Providers ==
96
 
97
- AST comes with a list of 250+ shipping providers (carriers) with predefined tracking link:
98
 
99
- USPS, ePacket, Delhivery, Yun Express Tracking, UPS, Australia Post, FedEx, Aramex, DHL eCommerce, ELTA Courier, Colissimo, DHL Express, La Poste, DHLParcel NL, Purolator, 4px, Brazil Correios, Deutsche Post, Bpost, DHL, EMS, DPD.de, GLS, China Post, Loomis Express, DHL Express, PostNL International 3S, Royal Mail and many others..
 
100
 
101
  == FAQ ==
102
 
@@ -142,6 +135,12 @@ Yes, if you use external shipping services that work with the WooCommerce REST A
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
145
  = 3.2.2.1 =
146
  * Enhancement - Updated Settings page header design
147
  * Enhancement - Updated TrackShip Settings page header design
14
 
15
  Advanced Shipment Tracking (AST) for WooCommerce lets you add tracking information to orders and provides your customers an easy way to track their orders. AST provides powerful features that let WooCommerce shop owners to better manage and automate their post-shipping orders flow, reduce time spent on customer service and increase customer satisfaction.
16
 
 
 
17
  https://www.youtube.com/watch?v=QOVbwfgXQdU
18
 
19
  ==Key Features==
20
 
21
+ * **Add Tracking information to orders**
22
  Easily add tracking information to your orders, AST lets you add the tracking from the WooCommerce orders admin or from a single order admin, we also allow you to mark the order as Completed when adding the tracking information.
23
 
24
  * **Customize The Tracking Display on the Order Emails**
42
  * **Custom Order Statuses**
43
  Improve your order management flow, with custom order statuses, enable the Partially Shipped for orders that you ship in separate packages at different times or enable the Delivered order status if you use [TrackShip](https://trackship.info/) for tracking & delivery automation.
44
 
45
+ == AST PRO FEATURES==
 
 
 
46
 
47
+ * Tracking per item
48
+ * Fluid Responsive tracking widget
49
+ * Custom order status "Shipped"
50
+ * Custom email templates
51
+ * Multiple API name mapping
52
+ * Unfulfilled orders filter
53
+ * Auto-detect shipping providers
54
+ * Integrations with ShipStation, WooCommerce Shipping & Tax, Royal Mail Click & Drop, PDF invoices and more..
55
+ * Updates & Support
56
 
57
+ [Get the AST PRO](https://www.zorem.com/product/woocommerce-advanced-shipment-tracking/)
 
 
58
 
59
+ == PayPal Tracking Integration for WooCommerce ==
60
+ The PayPal Tracking for WooCommerce will automatically export the tracking numbers, shipping provider and shipment status to PayPal using the PayPal Tracking API. adding the tracking information to PayPal transactions can help reduce chargebacks and will help you to quickly resolve PayPal payment holds.
 
 
 
 
 
61
 
62
+ [Get this Add-on](https://www.zorem.com/product/paypal-tracking-add-on/)
63
 
64
+ **TrackShip Integration** - [TrackShip](https://trackship.info/) is a Multi-Carrier Shipment Tracking platform that seamlessly integrates into WooCommerce with the AST plugin, TrackShip auto-tracks your shipments, automates your post-shipping workflow, reduces the time spent on customer service and lets you provide a superior post-purchase experience to your customers.
 
65
 
66
+ * Auto-Track Shipments with 200+ Shipping Providers
67
+ * Automate Your Post-Shipping Workflow
68
+ * Keep Your Customers Informed with Shipping & Delivery Updates
69
+ * Further Engage Your Customers With a Tracking Page on your store
70
+ * Tracking & Delivery Analytics
71
 
72
+ You must have a [TrackShip](https://trackship.info/) account to activate these features.
73
 
74
  == Compatibility ==
75
  The Advanced Shipment Tracking plugin is compatible with many other plugins such as shipping label plugins and services, email customizer plugins, Customer order number plugins, PDF invoices plugins, multi vendor plugins, SMS plugins and more. Check out [AST's full list of plugins compatibility](https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/compatibility/).
86
 
87
  == Shipping Providers ==
88
 
89
+ AST comes with a list of 300+ shipping providers (carriers) with predefined tracking link:
90
 
91
+ USPS, ePacket, Delhivery, Yun Express Tracking, UPS, Australia Post, FedEx, Aramex, DHL eCommerce, ELTA Courier, Colissimo, DHL Express, La Poste, DHLParcel NL, Purolator, 4px, Brazil Correios, Deutsche Post, Bpost, DHL, EMS, DPD.de, GLS, China Post, Loomis Express, DHL Express, PostNL International 3S, Royal Mail and more…
92
+ Check out the complete list of [shipping providers](https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/setting-shipping-providers/shipping-providers/)
93
 
94
  == FAQ ==
95
 
135
 
136
  == Changelog ==
137
 
138
+ = 3.2.2.2 =
139
+ * Enhancement - Update order details, Shipping address and billing address email template
140
+ * Enhancement - Added admin notice and WooCommerce inbox message for Advanced Shipment Tracking PRO
141
+ * Enhancement - Split Shipment Tracking customizer and TrackShip customizer
142
+ * Fix - Fixed issue with the" Reset providers database" option in Synch providers
143
+
144
  = 3.2.2.1 =
145
  * Enhancement - Updated Settings page header design
146
  * Enhancement - Updated TrackShip Settings page header design
templates/emails/wcast-billing-email-addresses.php CHANGED
@@ -22,10 +22,10 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  $text_align = is_rtl() ? 'right' : 'left';
23
  $address = $order->get_formatted_billing_address();
24
 
25
- ?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 48%;display:inline-block;vertical-align: top; margin-bottom: 20px; padding:0;border: 1px solid #e0e0e0;" border="0">
26
  <tr>
27
- <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:15px;" valign="top" width="50%">
28
- <strong style="color: #4e4e4e;padding-bottom: 5px;font-size: 14px;"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></strong>
29
  <address class="address" style="padding: 0;border:0;margin: 5px 0 0 0;font-size: 14px;font-style: normal;vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;line-height: 20px;color: #4e4e4e;">
30
  <?php echo wp_kses_post( $address ? $address : esc_html__( 'N/A', 'woocommerce' ) ); ?>
31
  <?php if ( $order->get_billing_phone() ) : ?>
22
  $text_align = is_rtl() ? 'right' : 'left';
23
  $address = $order->get_formatted_billing_address();
24
 
25
+ ?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 48%;display:inline-block;vertical-align: top; margin-bottom: 20px; padding:0;border: 0;" border="0">
26
  <tr>
27
+ <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
28
+ <h2 style="padding-bottom: 5px;margin-bottom: 0;border: 0;"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
29
  <address class="address" style="padding: 0;border:0;margin: 5px 0 0 0;font-size: 14px;font-style: normal;vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;line-height: 20px;color: #4e4e4e;">
30
  <?php echo wp_kses_post( $address ? $address : esc_html__( 'N/A', 'woocommerce' ) ); ?>
31
  <?php if ( $order->get_billing_phone() ) : ?>
templates/emails/wcast-shipping-email-addresses.php CHANGED
@@ -23,10 +23,10 @@ $text_align = is_rtl() ? 'right' : 'left';
23
  $address = $order->get_formatted_billing_address();
24
  $shipping = $order->get_formatted_shipping_address();
25
  if( !empty($shipping) ){ ?>
26
- <table id="addresses" cellspacing="0" cellpadding="0" style="width: 48%;display:inline-block;vertical-align: top; margin-bottom: 20px; padding:0;border: 1px solid #e0e0e0;margin-right: 15px;" border="0">
27
  <tr>
28
- <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding:15px;" valign="top" width="50%">
29
- <strong style="color: #4e4e4e;padding-bottom: 5px;font-size: 14px;"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></strong>
30
  <address class="address" style="padding: 0;border:0;margin: 5px 0 0 0;font-size: 14px;font-style: normal;vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;line-height: 20px;color: #4e4e4e;"><?php echo wp_kses_post( $shipping ); ?></address>
31
  </td>
32
  </tr>
23
  $address = $order->get_formatted_billing_address();
24
  $shipping = $order->get_formatted_shipping_address();
25
  if( !empty($shipping) ){ ?>
26
+ <table id="addresses" cellspacing="0" cellpadding="0" style="width: 48%;display:inline-block;vertical-align: top; margin-bottom: 20px; padding:0;border: 0;margin-right: 15px;" border="0">
27
  <tr>
28
+ <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding:0;" valign="top" width="50%">
29
+ <h2 style="padding-bottom: 5px;margin-bottom: 0;border:0;"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
30
  <address class="address" style="padding: 0;border:0;margin: 5px 0 0 0;font-size: 14px;font-style: normal;vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;line-height: 20px;color: #4e4e4e;"><?php echo wp_kses_post( $shipping ); ?></address>
31
  </td>
32
  </tr>
woocommerce-advanced-shipment-tracking.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI: https://www.zorem.com/products/woocommerce-advanced-shipment-tracking/
6
  * Description: Add shipment tracking information to your WooCommerce orders and provide customers with an easy way to track their orders. Shipment tracking Info will appear in customers accounts (in the order panel) and in WooCommerce order complete email.
7
- * Version: 3.2.2.1
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
20
  *
21
  * @var string
22
  */
23
- public $version = '3.2.2.1';
24
 
25
  /**
26
  * Initialize the main plugin function
@@ -398,16 +398,14 @@ class zorem_woocommerce_advanced_shipment_tracking {
398
  }
399
 
400
  $delivered_count = wc_orders_count( 'delivered' );
401
- $ps_count = wc_orders_count( 'partial-shipped' );
402
- $ut_count = wc_orders_count( 'updated-tracking' );
403
 
404
  $order_statuses = wc_get_order_statuses();
405
 
406
- unset( $order_statuses['wc-partial-shipped'] );
407
- unset( $order_statuses['wc-updated-tracking'] );
408
  unset( $order_statuses['wc-delivered'] );
409
 
410
- if( $delivered_count > 0 || $ps_count > 0 || $ut_count > 0 ) {
411
  ?>
412
 
413
  <script>
@@ -493,21 +491,6 @@ class zorem_woocommerce_advanced_shipment_tracking {
493
  <?php } ?>
494
  </select>
495
 
496
- <?php }
497
- if( $ut_count > 0 ){
498
- ?>
499
- <p><?php
500
- /* translators: %s: replace with Updated Tracking order count */
501
- printf( esc_html__('We detected %s orders that use the Updated Tracking order status, You can reassign these orders to a different status', 'woo-advanced-shipment-tracking'), $ut_count );
502
- ?>
503
- </p>
504
- <select id="reassign_ut_order" name="reassign_ut_order" class="reassign_select">
505
- <option value=""><?php _e('Select', 'woocommerce'); ?></option>
506
- <?php foreach($order_statuses as $key => $status){ ?>
507
- <option value="<?php echo $key; ?>"><?php echo $status; ?></option>
508
- <?php } ?>
509
- </select>
510
-
511
  <?php } ?>
512
  <p>
513
  <input type="hidden" name="action" value="reassign_order_status">
@@ -528,8 +511,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
528
  public function reassign_order_status() {
529
 
530
  $reassign_delivered_order = isset( $_POST['reassign_delivered_order'] ) ? wc_clean( $_POST['reassign_delivered_order'] ) : '';
531
- $reassign_ps_order = isset( $_POST['reassign_ps_order'] ) ? wc_clean( $_POST['reassign_ps_order'] ) : '';
532
- $reassign_ut_order = isset( $_POST['reassign_ut_order'] ) ? wc_clean( $_POST['reassign_ut_order'] ) : '';
533
 
534
  if ( '' != $reassign_delivered_order ) {
535
 
@@ -562,22 +544,6 @@ class zorem_woocommerce_advanced_shipment_tracking {
562
  $order->update_status( $reassign_ps_order );
563
  }
564
  }
565
-
566
- if( '' != $reassign_ut_order ){
567
-
568
- $args = array(
569
- 'status' => 'updated-tracking',
570
- 'limit' => '-1',
571
- );
572
-
573
- $ut_orders = wc_get_orders( $args );
574
-
575
- foreach ( $ut_orders as $order ) {
576
- $order_id = $order->get_id();
577
- $order = new WC_Order( $order_id );
578
- $order->update_status( $reassign_ut_order );
579
- }
580
- }
581
  echo 1;
582
  die();
583
  }
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI: https://www.zorem.com/products/woocommerce-advanced-shipment-tracking/
6
  * Description: Add shipment tracking information to your WooCommerce orders and provide customers with an easy way to track their orders. Shipment tracking Info will appear in customers accounts (in the order panel) and in WooCommerce order complete email.
7
+ * Version: 3.2.2.2
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
20
  *
21
  * @var string
22
  */
23
+ public $version = '3.2.2.2';
24
 
25
  /**
26
  * Initialize the main plugin function
398
  }
399
 
400
  $delivered_count = wc_orders_count( 'delivered' );
401
+ $ps_count = wc_orders_count( 'partial-shipped' );
 
402
 
403
  $order_statuses = wc_get_order_statuses();
404
 
405
+ unset( $order_statuses['wc-partial-shipped'] );
 
406
  unset( $order_statuses['wc-delivered'] );
407
 
408
+ if( $delivered_count > 0 || $ps_count > 0 ) {
409
  ?>
410
 
411
  <script>
491
  <?php } ?>
492
  </select>
493
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  <?php } ?>
495
  <p>
496
  <input type="hidden" name="action" value="reassign_order_status">
511
  public function reassign_order_status() {
512
 
513
  $reassign_delivered_order = isset( $_POST['reassign_delivered_order'] ) ? wc_clean( $_POST['reassign_delivered_order'] ) : '';
514
+ $reassign_ps_order = isset( $_POST['reassign_ps_order'] ) ? wc_clean( $_POST['reassign_ps_order'] ) : '';
 
515
 
516
  if ( '' != $reassign_delivered_order ) {
517
 
544
  $order->update_status( $reassign_ps_order );
545
  }
546
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  echo 1;
548
  die();
549
  }