Advanced Shipment Tracking for WooCommerce - Version 3.2.1.4

Version Description

  • Enhancement - Improved the TrackShip tools page design
  • Enhancement - Set pagination in shipping provider list when bulk Activate/Deactivate all providers
  • Enhancement - Improved the design of Shipping Providers list search bar
  • Enhancement - After adding custom shipping provider reload the page and sort the shipping providers list by custom provider
  • Enhancement - Add sub tab and notification type in settings page URL parameter
  • Enhancement - Improved the design of Documentation button in header of settings page
  • Enhancement - Improved the TrackShip shipment status email customizer and tracking page customizer
  • Enhancement - On Shipping provider sync with check "Reset providers database, it will reset all your shipping provider database" option delete the Shipping provider table and create again
  • Enhancement - Added back functionality for add only one API name in shipping providers list
  • Enhancement - On My account order details page if TrackShip tracking page is enable open tracking page in lightbox
  • Enhancement - Updated design of Addons page
  • Fix - Fixed shipment status filter bug in orders list page
Download this release

Release Info

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

Code changes from version 3.2.1.3 to 3.2.1.4

Files changed (39) hide show
  1. assets/css/admin.css +49 -24
  2. assets/css/front.css +48 -0
  3. assets/css/trackship.css +1 -5
  4. assets/images/alp-icon.png +0 -0
  5. assets/images/cev-icon.png +0 -0
  6. assets/images/smswoo-icon.png +0 -0
  7. assets/images/sre-icon.png +0 -0
  8. assets/images/trackship-ast-banner.png +0 -0
  9. assets/js/customizer-scripts.js +1 -0
  10. assets/js/front.js +41 -1
  11. assets/js/shipping_row.js +41 -30
  12. includes/api/class-wc-advanced-shipment-tracking-rest-api-controller.php +7 -2
  13. includes/class-wc-advanced-shipment-tracking-admin.php +11 -26
  14. includes/class-wc-advanced-shipment-tracking-api-call.php +21 -1
  15. includes/class-wc-advanced-shipment-tracking-front.php +36 -2
  16. includes/class-wc-advanced-shipment-tracking-install.php +69 -26
  17. includes/class-wc-advanced-shipment-tracking-settings.php +11 -40
  18. includes/class-wc-advanced-shipment-tracking-trackship.php +14 -3
  19. includes/class-wc-advanced-shipment-tracking.php +22 -1
  20. includes/customizer/class-wc-availableforpickup-email-customizer.php +39 -5
  21. includes/customizer/class-wc-delivered-email-customizer.php +79 -24
  22. includes/customizer/class-wc-failure-email-customizer.php +40 -5
  23. includes/customizer/class-wc-intransit-email-customizer.php +40 -4
  24. includes/customizer/class-wc-onhold-email-customizer.php +41 -7
  25. includes/customizer/class-wc-outfordelivery-email-customizer.php +40 -7
  26. includes/customizer/class-wc-returntosender-email-customizer.php +40 -21
  27. includes/customizer/class-wcast-customizer.php +1 -1
  28. includes/trackship-email-manager.php +9 -3
  29. includes/views/admin_options_addons.php +61 -39
  30. includes/views/admin_options_settings.php +3 -3
  31. includes/views/admin_options_shipping_provider.php +1 -1
  32. includes/views/admin_status_notifications.php +130 -131
  33. includes/views/admin_trackship_dashboard.php +6 -5
  34. readme.txt +14 -0
  35. templates/emails/wcast-email-order-details.php +53 -12
  36. templates/emails/wcast-email-order-items.php +106 -0
  37. templates/emails/wcast-shipping-email-addresses.php +3 -2
  38. templates/myaccount/tracking-info.php +53 -13
  39. woocommerce-advanced-shipment-tracking.php +2 -2
assets/css/admin.css CHANGED
@@ -46,13 +46,11 @@ body.shipment_tracking_admin_settings{
46
  .ast-docs-btn {
47
  background: #fafafa;
48
  border: 1px solid #e0e0e0;
49
- padding: 10px 15px;
50
- text-decoration: none;
51
- text-transform: uppercase;
52
  border-radius: 3px;
53
  }
54
- .ast-docs-btn span.dashicons{
55
- vertical-align: bottom;
56
  margin-left: 2px;
57
  }
58
  #woocommerce-advanced-shipment-tracking .inside {
@@ -122,7 +120,9 @@ body.shipment_tracking_admin_settings{
122
  section.tab_section {
123
  display: none;
124
  padding: 0;
 
125
  border-top: 1px solid #ddd;
 
126
  }
127
  section.inner_tab_section {
128
  display: none;
@@ -147,7 +147,7 @@ label.tab_label.first_label {
147
  }
148
  label.inner_tab_label {
149
  text-decoration: none;
150
- padding: 15px 12px 10px;
151
  font-size: 14px;
152
  color: #32373c;
153
  display: inline-block;
@@ -176,7 +176,7 @@ input.tab_input:checked + label {
176
  }
177
  input.inner_tab_input:checked + label{
178
  border-bottom: 3px solid #005b9a;
179
- padding: 24px 12px 15px;
180
  }
181
  input.inner_tab_input:checked + label.ts_tabs_label{
182
  border-bottom: 3px solid #59c889;
@@ -260,6 +260,12 @@ input.tab_input_1:checked + label{
260
  .ast_admin_content .get_shipment_status_tool .form-table th.titledesc{
261
  width: 70%;
262
  }
 
 
 
 
 
 
263
  .ast_admin_content table.form-table.upload_csv_table th{
264
  width: 40%;
265
  }
@@ -347,9 +353,9 @@ input.tab_input_1:checked + label{
347
  .wp-core-ui .launch_customizer_btn{
348
  float: right;
349
  }
350
- .wp-core-ui .btn_large .dashicons{
351
- vertical-align: sub;
352
- margin-left: 5px;
353
  }
354
  .wp-core-ui .btn_large.add_custom_provider .dashicons {
355
  margin-left: 0;
@@ -631,9 +637,9 @@ span.provider_name {
631
  }
632
 
633
  #search_provider{
634
- width: 225px;
635
- min-width: 225px;
636
- font-size: 12px;
637
  border: 1px solid #e0e0e0;
638
  padding: 0 0 0 45px;
639
  line-height: 2;
@@ -1642,18 +1648,15 @@ p.zorem_description {
1642
  flex-wrap: wrap;
1643
  }
1644
  .single_plugin {
1645
- flex-grow: 1;
1646
- width: 33%;
1647
- max-width: 33%;
1648
  padding: 20px 20px 0 0;
1649
  box-sizing: border-box;
1650
  }
1651
- .single_plugin:nth-child(2n){
1652
  padding-right: 0;
1653
  }
1654
- .plugins_section.free_plugin_section .single_plugin{
1655
- width: 50%;
1656
- max-width: 50%;
1657
  }
1658
  .plugins_section.pro_plugin_section .plugin_image {
1659
  border: 1px solid #e0e0e0;
@@ -1676,7 +1679,7 @@ p.zorem_description {
1676
  padding: 0 0 15px;
1677
  }
1678
  .plugins_section.free_plugin_section .paid_plugin_image img{
1679
- max-width: 100px;
1680
  }
1681
  .plugins_section.free_plugin_section .plugin_image img{
1682
  width: 100%;
@@ -2039,9 +2042,9 @@ ul.csv_error_details_ul li:before{
2039
  justify-content: center;
2040
  }
2041
  .as-col-4 {
2042
- max-width: 33%;
2043
- -ms-flex-preferred-size: 33%;
2044
- flex-basis: 33%;
2045
  }
2046
  .as-col-6 {
2047
  max-width: 50%;
@@ -2053,6 +2056,28 @@ ul.csv_error_details_ul li:before{
2053
  -ms-flex-preferred-size: 66%;
2054
  flex-basis: 66%;
2055
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2056
 
2057
  /*** RTL CSS ***/
2058
  .rtl .zorem-layout__header .zorem-layout__header-breadcrumbs{
46
  .ast-docs-btn {
47
  background: #fafafa;
48
  border: 1px solid #e0e0e0;
49
+ padding: 8px 6px 8px 8px;
50
+ text-decoration: none;
 
51
  border-radius: 3px;
52
  }
53
+ .ast-docs-btn span.dashicons{
 
54
  margin-left: 2px;
55
  }
56
  #woocommerce-advanced-shipment-tracking .inside {
120
  section.tab_section {
121
  display: none;
122
  padding: 0;
123
+ margin-bottom: 20px;
124
  border-top: 1px solid #ddd;
125
+ min-height: 100vh;
126
  }
127
  section.inner_tab_section {
128
  display: none;
147
  }
148
  label.inner_tab_label {
149
  text-decoration: none;
150
+ padding: 15px 12px 8px;
151
  font-size: 14px;
152
  color: #32373c;
153
  display: inline-block;
176
  }
177
  input.inner_tab_input:checked + label{
178
  border-bottom: 3px solid #005b9a;
179
+ padding: 15px 12px 5px;
180
  }
181
  input.inner_tab_input:checked + label.ts_tabs_label{
182
  border-bottom: 3px solid #59c889;
260
  .ast_admin_content .get_shipment_status_tool .form-table th.titledesc{
261
  width: 70%;
262
  }
263
+ .ast_admin_content .get_shipment_status_tool .form-table td:last-child{
264
+ text-align: right;
265
+ }
266
+ .ast_admin_content .get_shipment_status_tool .form-table.heading-table td:last-child{
267
+ text-align: left;
268
+ }
269
  .ast_admin_content table.form-table.upload_csv_table th{
270
  width: 40%;
271
  }
353
  .wp-core-ui .launch_customizer_btn{
354
  float: right;
355
  }
356
+ .wp-core-ui .btn_green2 .dashicons{
357
+ vertical-align: middle;
358
+ line-height: 0.9;
359
  }
360
  .wp-core-ui .btn_large.add_custom_provider .dashicons {
361
  margin-left: 0;
637
  }
638
 
639
  #search_provider{
640
+ width: 250px;
641
+ min-width: 250px;
642
+ font-size: 13px;
643
  border: 1px solid #e0e0e0;
644
  padding: 0 0 0 45px;
645
  line-height: 2;
1648
  flex-wrap: wrap;
1649
  }
1650
  .single_plugin {
1651
+ flex-grow: 1;
 
 
1652
  padding: 20px 20px 0 0;
1653
  box-sizing: border-box;
1654
  }
1655
+ .single_plugin.as-col-6:nth-child(2n){
1656
  padding-right: 0;
1657
  }
1658
+ .single_plugin.as-col-4:nth-child(3n){
1659
+ padding-right: 0;
 
1660
  }
1661
  .plugins_section.pro_plugin_section .plugin_image {
1662
  border: 1px solid #e0e0e0;
1679
  padding: 0 0 15px;
1680
  }
1681
  .plugins_section.free_plugin_section .paid_plugin_image img{
1682
+ height: 80px;
1683
  }
1684
  .plugins_section.free_plugin_section .plugin_image img{
1685
  width: 100%;
2042
  justify-content: center;
2043
  }
2044
  .as-col-4 {
2045
+ max-width: 33.33%;
2046
+ -ms-flex-preferred-size: 33.33%;
2047
+ flex-basis: 33.33%;
2048
  }
2049
  .as-col-6 {
2050
  max-width: 50%;
2056
  -ms-flex-preferred-size: 66%;
2057
  flex-basis: 66%;
2058
  }
2059
+ .trackship_addon_section{
2060
+ background: #fff;
2061
+ border: 1px solid #e0e0e0;
2062
+ padding: 15px;
2063
+ margin: 20px 0 0;
2064
+ }
2065
+ .ast_ts_landing_banner{
2066
+ max-width: 400px;
2067
+ }
2068
+ .ast_ts_landing_banner img{
2069
+ width: 100%;
2070
+ }
2071
+ .ts_addon_logo_section img{
2072
+ max-width: 150px;
2073
+ }
2074
+ .paid_plugin_description p{
2075
+ display: -webkit-inline-box;
2076
+ -webkit-line-clamp: 4;
2077
+ -webkit-box-orient: vertical;
2078
+ overflow: hidden;
2079
+ text-overflow: ellipsis;
2080
+ }
2081
 
2082
  /*** RTL CSS ***/
2083
  .rtl .zorem-layout__header .zorem-layout__header-breadcrumbs{
assets/css/front.css CHANGED
@@ -39,6 +39,9 @@ form.order_track_form input {
39
  max-width: 600px;
40
  position: relative;
41
  }
 
 
 
42
  .trackship_branding {
43
  text-align: center;
44
  border-top: 1px solid #e0e0e0;
@@ -277,6 +280,51 @@ ul.timeline > li > p{
277
  .tracking_number_div ul li{
278
  margin: 0;
279
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  /*** RTL CSS ***/
281
 
282
  .rtl .track-order-section{
39
  max-width: 600px;
40
  position: relative;
41
  }
42
+ .ts_tracking_popup .col.tracking-detail{
43
+ margin: 0 auto;
44
+ }
45
  .trackship_branding {
46
  text-align: center;
47
  border-top: 1px solid #e0e0e0;
280
  .tracking_number_div ul li{
281
  margin: 0;
282
  }
283
+
284
+ /**** Tracking Lightbox CSS ***/
285
+ .popupwrapper {
286
+ position: fixed;
287
+ top: 0;
288
+ left: 0;
289
+ background: rgb(250 250 250 / 0.8);
290
+ border: 1px solid #e0e0e0;
291
+ z-index: 100000;
292
+ width: 100%;
293
+ height: 100%;
294
+ text-align: center;
295
+ }
296
+ .popupwrapper:after {
297
+ content: '';
298
+ display: inline-block;
299
+ vertical-align: middle;
300
+ height: 100%;
301
+ }
302
+ .popuprow {
303
+ display: inline-block;
304
+ vertical-align: middle;
305
+ max-width: 600px;
306
+ background: #fff;
307
+ padding: 0;
308
+ position: relative;
309
+ z-index: 10;
310
+ border-radius: 3px;
311
+ width: 97%;
312
+ width: calc(100% - 5px);
313
+ max-height: 90%;
314
+ overflow-y: overlay;
315
+ text-align: left;
316
+ border: 1px solid #e0e0e0;
317
+ }
318
+ .popupclose {
319
+ position: absolute;
320
+ width: 100%;
321
+ height: 100%;
322
+ z-index: 9;
323
+ top: 0;
324
+ left: 0;
325
+ }
326
+
327
+
328
  /*** RTL CSS ***/
329
 
330
  .rtl .track-order-section{
assets/css/trackship.css CHANGED
@@ -46,7 +46,7 @@
46
  border-top: 1px solid #ddd;
47
  }
48
  .woocommerce.zorem_admin_layout table.form-table th, .woocommerce.zorem_admin_layout table.form-table td{
49
- padding: 15px 24px 15px 15px;
50
  border-bottom: 1px solid #e0e0e0;
51
  vertical-align: middle;
52
  }
@@ -56,10 +56,6 @@
56
  cursor: auto;
57
  }
58
 
59
- .trackship_admin_content .get_shipment_status_tool .form-table th.titledesc {
60
- width: 70%;
61
- }
62
-
63
  .zorem_admin_layout table.form-table.late-shipments-email-content-table{
64
  background: #fff;
65
  display: none;
46
  border-top: 1px solid #ddd;
47
  }
48
  .woocommerce.zorem_admin_layout table.form-table th, .woocommerce.zorem_admin_layout table.form-table td{
49
+ padding: 15px 25px 15px;
50
  border-bottom: 1px solid #e0e0e0;
51
  vertical-align: middle;
52
  }
56
  cursor: auto;
57
  }
58
 
 
 
 
 
59
  .zorem_admin_layout table.form-table.late-shipments-email-content-table{
60
  background: #fff;
61
  display: none;
assets/images/alp-icon.png CHANGED
Binary file
assets/images/cev-icon.png CHANGED
Binary file
assets/images/smswoo-icon.png ADDED
Binary file
assets/images/sre-icon.png CHANGED
Binary file
assets/images/trackship-ast-banner.png ADDED
Binary file
assets/js/customizer-scripts.js CHANGED
@@ -9,6 +9,7 @@ jQuery(document).ready(function() {
9
  * Change description
10
  */
11
  jQuery('#customize-theme-controls #accordion-section-themes').hide();
 
12
  });
13
 
14
  // 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> TrackShip' );
13
  });
14
 
15
  // Handle mobile button click
assets/js/front.js CHANGED
@@ -98,4 +98,44 @@ function showerror(element){
98
  }
99
  function hideerror(element){
100
  element.css("border-color","");
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
  function hideerror(element){
100
  element.css("border-color","");
101
+ }
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",
109
+ opacity: .6
110
+ }
111
+ });
112
+
113
+
114
+ var order_id = jQuery(this).data('order');
115
+ var tracking_number = jQuery(this).data('tracking');
116
+
117
+ var ajax_data = {
118
+ action: 'ts_open_tracking_lightbox',
119
+ order_id: order_id,
120
+ tracking_number: tracking_number,
121
+ };
122
+
123
+ jQuery.ajax({
124
+ url: zorem_ajax_object.ajax_url,
125
+ data: ajax_data,
126
+ type: 'POST',
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
+
137
+ });
138
+
139
+ jQuery(document).on("click", ".popupclose", function(){
140
+ jQuery('.ts_tracking_popup').hide();
141
+ });
assets/js/shipping_row.js CHANGED
@@ -583,27 +583,8 @@ jQuery(document).on("click", ".close_synch_popup", function(){
583
  url: ajaxurl,
584
  data: form.serialize(),
585
  type: 'POST',
586
- success: function(response) {
587
- jQuery(".provider_list").replaceWith(response);
588
- form[0].reset();
589
- jQuery('.add_provider_popup').hide();
590
- jQuery(".add_provider_popup").unblock();
591
- jQuery(".woocommerce-help-tip").tipTip();
592
- jQuery('#shipping-provider-table').datatable({
593
- pageSize: 25,
594
- pagingDivClass: 'text-left',
595
- firstPage:'',
596
- prevPage:'',
597
- nextPage:'',
598
- lastPage:'',
599
- sort: [false, false, false, false, false, false],
600
- onChange: function(old_page, new_page){
601
- jQuery(".woocommerce-help-tip").tipTip();
602
- },
603
- counterText: function (currentPage, totalPage, firstRow, lastRow, totalRow) {
604
- return 'Showing ' + firstRow + ' to ' + lastRow + ' of ' + totalRow + ' entries' ;
605
- }
606
- });
607
  },
608
  error: function(response) {
609
  console.log(response);
@@ -725,7 +706,7 @@ jQuery(document).on("click", ".edit_provider", function(){
725
 
726
  if(response.api_provider_name == null){
727
  //jQuery('.edit_provider_popup .api_provider_name').val(response.api_provider_name);
728
- jQuery('.api_provider_name_container').hide();
729
  } else if( IsValidJSONString(response.api_provider_name) ){
730
  var api_provider_name = jQuery.parseJSON( response.api_provider_name );
731
  var api_length = api_provider_name.length;
@@ -735,7 +716,7 @@ jQuery(document).on("click", ".edit_provider", function(){
735
  if( index == 0){
736
  jQuery('.edit_provider_popup .api_provider_name').val(value);
737
  } else{
738
- jQuery('.api_provider_name_container').append('<div class="api_provider_new"><input type="text" name="api_provider_name[]" class="api_provider_name" value="'+value+'" placeholder="API Name" readonly="true"><!--span class="dashicons dashicons-remove remove_more_api_provider"></span--></div>');
739
  }
740
  });
741
  } else{
@@ -744,9 +725,9 @@ jQuery(document).on("click", ".edit_provider", function(){
744
  jQuery('.api_provider_name_container').show();
745
  } else{
746
  jQuery('.edit_provider_popup .api_provider_name').val(response.api_provider_name);
747
- jQuery('.api_provider_name_container').show();
748
  }
749
-
750
  jQuery('.edit_provider_popup .thumb_url').val(image);
751
  jQuery('.edit_provider_popup .thumb_id').val(custom_thumb_id);
752
  jQuery('.edit_provider_popup #provider_id').val(id);
@@ -832,7 +813,7 @@ jQuery(document).on("submit", "#edit_provider_form", function(){
832
  var error;
833
  var shipping_provider = jQuery("#edit_provider_form .shipping_provider");
834
  var shipping_country = jQuery("#edit_provider_form .shipping_country");
835
- //var api_provider_name = jQuery(".api_provider_new .api_provider_name");
836
  var thumb_url = jQuery("#edit_provider_form .thumb_url");
837
  var tracking_url = jQuery("#edit_provider_form .tracking_url");
838
  var provider_type = jQuery("#edit_provider_form #provider_type");
@@ -951,6 +932,21 @@ jQuery(document).on("click", "#reset_providers", function(){
951
  success: function(response) {
952
  jQuery(".provider_list").replaceWith(response);
953
  jQuery("#content1").unblock();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
954
  jQuery(".woocommerce-help-tip").tipTip();
955
  },
956
  error: function(response) {
@@ -1105,11 +1101,26 @@ jQuery(document).on("click", ".tab_input", function(){
1105
  var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab;
1106
  window.history.pushState({path:url},'',url);
1107
  });
1108
- /*jQuery(document).on("click", ".inner_tab_input", function(){
1109
- var tab = jQuery(this).data('tab');
1110
- var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  window.history.pushState({path:url},'',url);
1112
- });*/
1113
 
1114
  jQuery(document).on("click", ".open_video_popup", function(){
1115
  jQuery('.how_to_video_popup').show();
583
  url: ajaxurl,
584
  data: form.serialize(),
585
  type: 'POST',
586
+ success: function(response) {
587
+ location.reload();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  },
589
  error: function(response) {
590
  console.log(response);
706
 
707
  if(response.api_provider_name == null){
708
  //jQuery('.edit_provider_popup .api_provider_name').val(response.api_provider_name);
709
+ //jQuery('.api_provider_name_container').hide();
710
  } else if( IsValidJSONString(response.api_provider_name) ){
711
  var api_provider_name = jQuery.parseJSON( response.api_provider_name );
712
  var api_length = api_provider_name.length;
716
  if( index == 0){
717
  jQuery('.edit_provider_popup .api_provider_name').val(value);
718
  } else{
719
+ jQuery('.api_provider_name_container').append('<div class="api_provider_new"><input type="text" name="api_provider_name[]" class="api_provider_name" value="'+value+'" placeholder="API Name"><!--span class="dashicons dashicons-remove remove_more_api_provider"></span--></div>');
720
  }
721
  });
722
  } else{
725
  jQuery('.api_provider_name_container').show();
726
  } else{
727
  jQuery('.edit_provider_popup .api_provider_name').val(response.api_provider_name);
728
+
729
  }
730
+ jQuery('.api_provider_name_container').show();
731
  jQuery('.edit_provider_popup .thumb_url').val(image);
732
  jQuery('.edit_provider_popup .thumb_id').val(custom_thumb_id);
733
  jQuery('.edit_provider_popup #provider_id').val(id);
813
  var error;
814
  var shipping_provider = jQuery("#edit_provider_form .shipping_provider");
815
  var shipping_country = jQuery("#edit_provider_form .shipping_country");
816
+ var api_provider_name = jQuery(".api_provider_new .api_provider_name");
817
  var thumb_url = jQuery("#edit_provider_form .thumb_url");
818
  var tracking_url = jQuery("#edit_provider_form .tracking_url");
819
  var provider_type = jQuery("#edit_provider_form #provider_type");
932
  success: function(response) {
933
  jQuery(".provider_list").replaceWith(response);
934
  jQuery("#content1").unblock();
935
+ jQuery('#shipping-provider-table').datatable({
936
+ pageSize: 25,
937
+ pagingDivClass: 'text-left',
938
+ firstPage:'',
939
+ prevPage:'',
940
+ nextPage:'',
941
+ lastPage:'',
942
+ sort: [false, false, false, false, false, false],
943
+ onChange: function(old_page, new_page){
944
+ jQuery(".woocommerce-help-tip").tipTip();
945
+ },
946
+ counterText: function (currentPage, totalPage, firstRow, lastRow, totalRow) {
947
+ return 'Showing ' + firstRow + ' to ' + lastRow + ' of ' + totalRow + ' entries' ;
948
+ }
949
+ });
950
  jQuery(".woocommerce-help-tip").tipTip();
951
  },
952
  error: function(response) {
1101
  var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab;
1102
  window.history.pushState({path:url},'',url);
1103
  });
1104
+ jQuery(document).on("click", ".inner_tab_input", function(){
1105
+ var tab = jQuery('input[name="tabs"]:checked').data('tab');
1106
+ var subtab = jQuery(this).data('subtab');
1107
+ if( subtab !== undefined){
1108
+ var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab+"&subtab="+subtab;
1109
+ }
1110
+
1111
+ var addons = jQuery(this).data('addons');
1112
+ if( addons !== undefined){
1113
+ var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab+"&addons="+addons;
1114
+ }
1115
+
1116
+ var type = jQuery(this).data('type');
1117
+ if( type !== undefined){
1118
+ var subtab = jQuery('input[name="ts_inner_tabs"]:checked').data('subtab');
1119
+ var url = window.location.protocol + "//" + window.location.host + window.location.pathname+"?page=woocommerce-advanced-shipment-tracking&tab="+tab+"&subtab="+subtab+"&type="+type;
1120
+ }
1121
+
1122
  window.history.pushState({path:url},'',url);
1123
+ });
1124
 
1125
  jQuery(document).on("click", ".open_video_popup", function(){
1126
  jQuery('.how_to_video_popup').show();
includes/api/class-wc-advanced-shipment-tracking-rest-api-controller.php CHANGED
@@ -208,9 +208,11 @@ class WC_Advanced_Shipment_Tracking_REST_API_Controller extends WC_REST_Controll
208
  foreach( ( array )$tracking_items as $key => $tracking_item ){
209
  if( trim($tracking_item['tracking_number']) != trim($tracking_number) )continue;
210
 
211
- $shipment_status = get_post_meta( $order_id, "shipment_status", true);
 
212
 
213
- if( is_string($shipment_status) )$shipment_status = array();
 
214
 
215
  if(isset($shipment_status[$key]['status'])){
216
  $previous_status = $shipment_status[$key]['status'];
@@ -227,6 +229,9 @@ class WC_Advanced_Shipment_Tracking_REST_API_Controller extends WC_REST_Controll
227
  $shipment_status[$key]['est_delivery_date'] = date("Y-m-d", strtotime($tracking_est_delivery_date));
228
  }
229
 
 
 
 
230
  update_post_meta( $order_id, "shipment_status", $shipment_status);
231
 
232
  $trackship->trigger_tracking_email( $order_id, $previous_status, $tracking_event_status, $tracking_item, $shipment_status[$key] );
208
  foreach( ( array )$tracking_items as $key => $tracking_item ){
209
  if( trim($tracking_item['tracking_number']) != trim($tracking_number) )continue;
210
 
211
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
212
+ $ts_shipment_status = get_post_meta( $order_id, "ts_shipment_status", true);
213
 
214
+ if( is_string($shipment_status) )$shipment_status = array();
215
+ if( is_string($ts_shipment_status) )$ts_shipment_status = array();
216
 
217
  if(isset($shipment_status[$key]['status'])){
218
  $previous_status = $shipment_status[$key]['status'];
229
  $shipment_status[$key]['est_delivery_date'] = date("Y-m-d", strtotime($tracking_est_delivery_date));
230
  }
231
 
232
+ $ts_shipment_status[$key]['status'] = $tracking_event_status;
233
+
234
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
235
  update_post_meta( $order_id, "shipment_status", $shipment_status);
236
 
237
  $trackship->trigger_tracking_email( $order_id, $previous_status, $tracking_event_status, $tracking_item, $shipment_status[$key] );
includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -267,7 +267,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
267
 
268
  global $wpdb;
269
  $woo_shippment_table_name = $this->table;
270
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name ORDER BY display_in_order DESC, trackship_supported DESC, id ASC" );
271
 
272
  foreach($default_shippment_providers as $key => $value){
273
  $search = array('(US)', '(UK)');
@@ -292,7 +292,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
292
  <div class="zorem-layout__header">
293
  <h1 class="zorem-layout__header-breadcrumbs"><span><a href="<?php echo esc_url( admin_url( '/admin.php?page=wc-admin' ) ); ?>"><?php _e('WooCommerce', 'woocommerce'); ?></a></span><span><a href="<?php echo esc_url( admin_url( '/admin.php?page=woocommerce-advanced-shipment-tracking' ) ); ?>"><?php _e('Shipment Tracking', 'woo-advanced-shipment-tracking'); ?></a></span><span class="header-breadcrumbs-last"><?php _e('Settings', 'woocommerce'); ?></span></h1>
294
  <div class="zorem-layout__docs-panel">
295
- <a class="ast-docs-btn" target="blank" href="https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/?utm_source=wp-admin&utm_medium=ASTHeader&utm_campaign=header"><?php _e('Docs', 'woo-advanced-shipment-tracking'); ?><span class="dashicons dashicons-media-default"></span></a>
296
  </div>
297
  </div>
298
  <?php do_action('ast_settings_admin_notice');?>
@@ -368,15 +368,6 @@ class WC_Advanced_Shipment_Tracking_Admin {
368
  'name' => 'tabs',
369
  'position' => 3,
370
  ),
371
- /*'trackship' => array(
372
- 'title' => 'TrackShip',
373
- 'show' => true,
374
- 'class' => 'tab_label',
375
- 'data-tab' => 'trackship',
376
- 'data-label' => 'TrackShip',
377
- 'name' => 'tabs',
378
- 'position' => 4,
379
- ),*/
380
  'tab6' => array(
381
  'title' => __( 'Add-ons', 'woo-advanced-shipment-tracking' ),
382
  'show' => true,
@@ -394,13 +385,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
394
  public function get_html_menu_tab( $arrays ){
395
  $tab = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : 'settings';
396
  if( $tab == 'license')$tab = 'addons';
397
- foreach( (array)$arrays as $id => $array ){
398
- /*if($id == 'trackship'){
399
- $wc_ast_api_key = get_option('wc_ast_api_key');
400
- if($wc_ast_api_key){ ?>
401
- <a class="menu_trackship_link" href="<?php echo esc_url( admin_url( '/admin.php?page=trackship-for-woocommerce' ) ); ?>">TrackShip</a>
402
- <?php }
403
- } else{ */?>
404
  <input class="tab_input" id="<?php echo $id?>" name="<?php echo $array['name']; ?>" type="radio" data-tab="<?php echo $array['data-tab']; ?>" data-label="<?php echo $array['data-label']; ?>" <?php if($tab == $array['data-tab']){ echo 'checked'; } ?> />
405
  <label class="<?php echo $array['class']; ?>" for="<?php echo $id?>"><?php echo $array['title']; ?></label>
406
  <?php /*}*/ }
@@ -1471,7 +1456,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1471
  }
1472
  if($status == 'all'){
1473
  $status = '';
1474
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY display_in_order DESC, trackship_supported DESC, id ASC" );
1475
  }
1476
  $html = $this->get_provider_html($default_shippment_providers,$status);
1477
  echo $html;exit;
@@ -1742,17 +1727,17 @@ class WC_Advanced_Shipment_Tracking_Admin {
1742
 
1743
  global $wpdb;
1744
 
1745
- /*if (array_filter($_POST['api_provider_name']) == []) {
1746
  $api_provider_name = NULL;
1747
  } else{
1748
  $api_provider_name = wc_clean(json_encode($_POST['api_provider_name']));
1749
- }*/
1750
 
1751
  $provider_type = $_POST['provider_type'];
1752
  if($provider_type == 'default_provider'){
1753
  $data_array = array(
1754
  'custom_provider_name' => sanitize_text_field($_POST['shipping_display_name']),
1755
- //'api_provider_name' => $api_provider_name,
1756
  'custom_thumb_id' => sanitize_text_field($_POST['thumb_id']),
1757
  );
1758
  } else{
@@ -1771,7 +1756,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1771
  );
1772
  $wpdb->update( $this->table, $data_array, $where_array );
1773
  $status = 'active';
1774
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
1775
  $html = $this->get_provider_html($default_shippment_providers,$status);
1776
  echo $html;exit;
1777
  }
@@ -1792,7 +1777,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1792
  );
1793
  $wpdb->update( $this->table, $data_array, $where_array );
1794
  $status = 'active';
1795
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
1796
  $html = $this->get_provider_html($default_shippment_providers,$status);
1797
  echo $html;exit;
1798
  }
@@ -1819,7 +1804,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1819
 
1820
  $wpdb->update( $this->table, $data_array, $where_array );
1821
  $status = 'all';
1822
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table" );
1823
  $html = $this->get_provider_html($default_shippment_providers,$status);
1824
  exit;
1825
  }
@@ -1831,7 +1816,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1831
  */
1832
  public function filter_orders_by_shipping_provider(){
1833
  global $typenow, $wpdb;
1834
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
1835
 
1836
  if ( 'shop_order' === $typenow ) { ?>
1837
  <select name="_shop_order_shipping_provider" id="dropdown_shop_order_shipping_provider">
267
 
268
  global $wpdb;
269
  $woo_shippment_table_name = $this->table;
270
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
271
 
272
  foreach($default_shippment_providers as $key => $value){
273
  $search = array('(US)', '(UK)');
292
  <div class="zorem-layout__header">
293
  <h1 class="zorem-layout__header-breadcrumbs"><span><a href="<?php echo esc_url( admin_url( '/admin.php?page=wc-admin' ) ); ?>"><?php _e('WooCommerce', 'woocommerce'); ?></a></span><span><a href="<?php echo esc_url( admin_url( '/admin.php?page=woocommerce-advanced-shipment-tracking' ) ); ?>"><?php _e('Shipment Tracking', 'woo-advanced-shipment-tracking'); ?></a></span><span class="header-breadcrumbs-last"><?php _e('Settings', 'woocommerce'); ?></span></h1>
294
  <div class="zorem-layout__docs-panel">
295
+ <a class="ast-docs-btn" target="blank" href="https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/?utm_source=wp-admin&utm_medium=ASTHeader&utm_campaign=header"><?php _e('Documentation', 'woo-advanced-shipment-tracking'); ?><span class="dashicons dashicons-media-default"></span></a>
296
  </div>
297
  </div>
298
  <?php do_action('ast_settings_admin_notice');?>
368
  'name' => 'tabs',
369
  'position' => 3,
370
  ),
 
 
 
 
 
 
 
 
 
371
  'tab6' => array(
372
  'title' => __( 'Add-ons', 'woo-advanced-shipment-tracking' ),
373
  'show' => true,
385
  public function get_html_menu_tab( $arrays ){
386
  $tab = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : 'settings';
387
  if( $tab == 'license')$tab = 'addons';
388
+ foreach( (array)$arrays as $id => $array ){ ?>
 
 
 
 
 
 
389
  <input class="tab_input" id="<?php echo $id?>" name="<?php echo $array['name']; ?>" type="radio" data-tab="<?php echo $array['data-tab']; ?>" data-label="<?php echo $array['data-label']; ?>" <?php if($tab == $array['data-tab']){ echo 'checked'; } ?> />
390
  <label class="<?php echo $array['class']; ?>" for="<?php echo $id?>"><?php echo $array['title']; ?></label>
391
  <?php /*}*/ }
1456
  }
1457
  if($status == 'all'){
1458
  $status = '';
1459
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
1460
  }
1461
  $html = $this->get_provider_html($default_shippment_providers,$status);
1462
  echo $html;exit;
1727
 
1728
  global $wpdb;
1729
 
1730
+ if (array_filter($_POST['api_provider_name']) == []) {
1731
  $api_provider_name = NULL;
1732
  } else{
1733
  $api_provider_name = wc_clean(json_encode($_POST['api_provider_name']));
1734
+ }
1735
 
1736
  $provider_type = $_POST['provider_type'];
1737
  if($provider_type == 'default_provider'){
1738
  $data_array = array(
1739
  'custom_provider_name' => sanitize_text_field($_POST['shipping_display_name']),
1740
+ 'api_provider_name' => $api_provider_name,
1741
  'custom_thumb_id' => sanitize_text_field($_POST['thumb_id']),
1742
  );
1743
  } else{
1756
  );
1757
  $wpdb->update( $this->table, $data_array, $where_array );
1758
  $status = 'active';
1759
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
1760
  $html = $this->get_provider_html($default_shippment_providers,$status);
1761
  echo $html;exit;
1762
  }
1777
  );
1778
  $wpdb->update( $this->table, $data_array, $where_array );
1779
  $status = 'active';
1780
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
1781
  $html = $this->get_provider_html($default_shippment_providers,$status);
1782
  echo $html;exit;
1783
  }
1804
 
1805
  $wpdb->update( $this->table, $data_array, $where_array );
1806
  $status = 'all';
1807
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
1808
  $html = $this->get_provider_html($default_shippment_providers,$status);
1809
  exit;
1810
  }
1816
  */
1817
  public function filter_orders_by_shipping_provider(){
1818
  global $typenow, $wpdb;
1819
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
1820
 
1821
  if ( 'shop_order' === $typenow ) { ?>
1822
  <select name="_shop_order_shipping_provider" id="dropdown_shop_order_shipping_provider">
includes/class-wc-advanced-shipment-tracking-api-call.php CHANGED
@@ -56,10 +56,17 @@ class WC_Advanced_Shipment_Tracking_Api_Call {
56
  wp_schedule_single_event( $timestamp, $hook, $args );
57
 
58
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
 
 
59
  if( is_string($shipment_status) )$shipment_status = array();
 
 
60
  $shipment_status[$key]['status'] = "Something went wrong: {$error_message}";
61
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
62
 
 
 
 
63
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
64
 
65
  } else {
@@ -74,15 +81,19 @@ class WC_Advanced_Shipment_Tracking_Api_Call {
74
  $body = json_decode($response['body'], true);
75
 
76
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
 
77
 
78
  if( is_string($shipment_status) )$shipment_status = array();
 
79
 
80
  $shipment_status[$key]['pending_status'] = $body['status_msg'];
81
 
82
-
83
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
84
  $shipment_status[$key]['est_delivery_date'] = '';
85
 
 
 
 
86
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
87
 
88
  if(isset($body['trackers_balance'])){
@@ -91,11 +102,20 @@ class WC_Advanced_Shipment_Tracking_Api_Call {
91
  } else {
92
  //error like 400
93
  $body = json_decode($response['body'], true);
 
94
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
 
 
95
  if( is_string($shipment_status) )$shipment_status = array();
 
 
96
  $shipment_status[$key]['status'] = "Error message : ".$body['message'];
97
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
98
  $shipment_status[$key]['est_delivery_date'] = '';
 
 
 
 
99
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
100
 
101
  $logger = wc_get_logger();
56
  wp_schedule_single_event( $timestamp, $hook, $args );
57
 
58
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
59
+ $ts_shipment_status = get_post_meta( $order->get_id(), "ts_shipment_status", true);
60
+
61
  if( is_string($shipment_status) )$shipment_status = array();
62
+ if( is_string($ts_shipment_status) )$ts_shipment_status = array();
63
+
64
  $shipment_status[$key]['status'] = "Something went wrong: {$error_message}";
65
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
66
 
67
+ $ts_shipment_status[$key]['status'] = $shipment_status[$key]['status'];
68
+
69
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
70
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
71
 
72
  } else {
81
  $body = json_decode($response['body'], true);
82
 
83
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
84
+ $ts_shipment_status = get_post_meta( $order->get_id(), "ts_shipment_status", true);
85
 
86
  if( is_string($shipment_status) )$shipment_status = array();
87
+ if( is_string($ts_shipment_status) )$ts_shipment_status = array();
88
 
89
  $shipment_status[$key]['pending_status'] = $body['status_msg'];
90
 
 
91
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
92
  $shipment_status[$key]['est_delivery_date'] = '';
93
 
94
+ $ts_shipment_status[$key]['status'] = $shipment_status[$key]['pending_status'];
95
+
96
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
97
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
98
 
99
  if(isset($body['trackers_balance'])){
102
  } else {
103
  //error like 400
104
  $body = json_decode($response['body'], true);
105
+
106
  $shipment_status = get_post_meta( $order->get_id(), "shipment_status", true);
107
+ $ts_shipment_status = get_post_meta( $order->get_id(), "ts_shipment_status", true);
108
+
109
  if( is_string($shipment_status) )$shipment_status = array();
110
+ if( is_string($ts_shipment_status) )$ts_shipment_status = array();
111
+
112
  $shipment_status[$key]['status'] = "Error message : ".$body['message'];
113
  $shipment_status[$key]['status_date'] = date("Y-m-d H:i:s");
114
  $shipment_status[$key]['est_delivery_date'] = '';
115
+
116
+ $ts_shipment_status[$key]['status'] = $shipment_status[$key]['status'];
117
+
118
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
119
  update_post_meta( $order->get_id(), "shipment_status", $shipment_status);
120
 
121
  $logger = wc_get_logger();
includes/class-wc-advanced-shipment-tracking-front.php CHANGED
@@ -58,6 +58,9 @@ class WC_Advanced_Shipment_Tracking_Front {
58
  add_action( 'wp_enqueue_scripts', array( $this, 'front_styles' ));
59
  add_action( 'wp_ajax_nopriv_get_tracking_info', array( $this, 'get_tracking_info_fun') );
60
  add_action( 'wp_ajax_get_tracking_info', array( $this, 'get_tracking_info_fun') );
 
 
 
61
  }
62
 
63
  /**
@@ -191,6 +194,37 @@ class WC_Advanced_Shipment_Tracking_Front {
191
  echo json_encode( array('success' => 'true', 'message' => '', 'html' => $html ));die();
192
  }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  /*
195
  * retuern Tracking form HTML
196
  */
@@ -580,7 +614,7 @@ class WC_Advanced_Shipment_Tracking_Front {
580
  $action = (isset($_REQUEST["action"])?$_REQUEST["action"]:"");
581
  if($action != 'preview_tracking_page')return;
582
 
583
- get_header();
584
 
585
  $ts_tracking_page_customizer = new ts_tracking_page_customizer();
586
 
@@ -597,7 +631,7 @@ class WC_Advanced_Shipment_Tracking_Front {
597
  $ast_base_directory = $upload_dir['basedir'] . '/ast-shipping-providers/';
598
 
599
  include 'views/front/preview_tracking_page.php';
600
- get_footer();
601
  exit;
602
  }
603
  }
58
  add_action( 'wp_enqueue_scripts', array( $this, 'front_styles' ));
59
  add_action( 'wp_ajax_nopriv_get_tracking_info', array( $this, 'get_tracking_info_fun') );
60
  add_action( 'wp_ajax_get_tracking_info', array( $this, 'get_tracking_info_fun') );
61
+
62
+ add_action( 'wp_ajax_nopriv_ts_open_tracking_lightbox', array( $this, 'ts_open_tracking_lightbox') );
63
+ add_action( 'wp_ajax_ts_open_tracking_lightbox', array( $this, 'ts_open_tracking_lightbox') );
64
  }
65
 
66
  /**
194
  echo json_encode( array('success' => 'true', 'message' => '', 'html' => $html ));die();
195
  }
196
 
197
+ /**
198
+ * Ajax function for get tracking details lightbox
199
+ */
200
+ public function ts_open_tracking_lightbox(){
201
+ $wc_ast_api_key = get_option('wc_ast_api_key');
202
+
203
+ if(!$wc_ast_api_key)exit;
204
+
205
+ $order_id = wc_clean($_POST['order_id']);
206
+ $tracking_number = wc_clean($_POST['tracking_number']);
207
+
208
+ $order = wc_get_order( $order_id );
209
+
210
+ if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
211
+ $tracking_items = get_post_meta( $order_id, '_wc_shipment_tracking_items', true );
212
+ } else {
213
+ $tracking_items = $order->get_meta( '_wc_shipment_tracking_items', true );
214
+ }
215
+
216
+ foreach( $tracking_items as $key => $tracking_item ){
217
+ if( $tracking_item['tracking_number'] != $tracking_number )unset( $tracking_items[$key] );
218
+ }
219
+
220
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
221
+
222
+ ob_start();
223
+ $html = $this->display_tracking_page( $order_id, $tracking_items, $shipment_status );
224
+ $html = ob_get_clean();
225
+ echo $html; exit;
226
+ }
227
+
228
  /*
229
  * retuern Tracking form HTML
230
  */
614
  $action = (isset($_REQUEST["action"])?$_REQUEST["action"]:"");
615
  if($action != 'preview_tracking_page')return;
616
 
617
+ wp_head();
618
 
619
  $ts_tracking_page_customizer = new ts_tracking_page_customizer();
620
 
631
  $ast_base_directory = $upload_dir['basedir'] . '/ast-shipping-providers/';
632
 
633
  include 'views/front/preview_tracking_page.php';
634
+ wp_footer();
635
  exit;
636
  }
637
  }
includes/class-wc-advanced-shipment-tracking-install.php CHANGED
@@ -55,6 +55,8 @@ class WC_Advanced_Shipment_Tracking_Install {
55
  */
56
  public function init(){
57
  add_action( 'init', array( $this, 'update_database_check'));
 
 
58
  }
59
 
60
  /**
@@ -68,13 +70,39 @@ class WC_Advanced_Shipment_Tracking_Install {
68
  */
69
  public function woo_shippment_tracking_install(){
70
 
71
- global $wpdb;
72
  // Add transient to trigger redirect.
73
  set_transient( '_ast_activation_redirect', 1, 30 );
74
- $woo_shippment_table_name = $this->table;
75
- if(!$wpdb->query($wpdb->prepare("show tables like %s",$woo_shippment_table_name))){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  $charset_collate = $wpdb->get_charset_collate();
77
- $sql = "CREATE TABLE $woo_shippment_table_name (
78
  id mediumint(9) NOT NULL AUTO_INCREMENT,
79
  provider_name varchar(500) DEFAULT '' NOT NULL,
80
  api_provider_name text NULL DEFAULT NULL,
@@ -91,29 +119,8 @@ class WC_Advanced_Shipment_Tracking_Install {
91
  ) $charset_collate;";
92
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
93
  dbDelta( $sql );
94
-
95
- $this->update_shipping_providers();
96
-
97
- update_option( 'wc_advanced_shipment_tracking', '3.19');
98
- }
99
-
100
- $wc_ast_default_mark_shipped = get_option('wc_ast_default_mark_shipped');
101
- if($wc_ast_default_mark_shipped == ''){
102
- update_option('wc_ast_default_mark_shipped',1);
103
  }
104
-
105
- $wc_ast_unclude_tracking_info = get_option('wc_ast_unclude_tracking_info');
106
- if(empty($wc_ast_unclude_tracking_info)){
107
- $data_array = array('completed' => 1,'partial-shipped' => 1,'updated-tracking' => 1);
108
- update_option( 'wc_ast_unclude_tracking_info', $data_array );
109
- }
110
-
111
- $wc_ast_show_orders_actions = get_option('wc_ast_show_orders_actions');
112
- if(empty($wc_ast_show_orders_actions)){
113
- $data_array = array('processing' => 1,'completed' => 1,'partial-shipped' => 1,'updated-tracking' => 1);
114
- update_option( 'wc_ast_show_orders_actions', $data_array );
115
- }
116
- }
117
 
118
  /*
119
  * database update
@@ -269,10 +276,46 @@ class WC_Advanced_Shipment_Tracking_Install {
269
  $res = $wpdb->query( "ALTER TABLE $this->table ADD api_provider_name text NULL DEFAULT NULL AFTER provider_name" );
270
  }
271
  update_option( 'wc_advanced_shipment_tracking', '3.19');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  }
273
  }
274
  }
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  /**
277
  * function for add provider image in uploads directory under wp-content/uploads/ast-shipping-providers
278
  */
55
  */
56
  public function init(){
57
  add_action( 'init', array( $this, 'update_database_check'));
58
+ add_action( 'update_ts_shipment_status_order_mete', array( $this, 'update_ts_shipment_status_order_mete'));
59
+ add_action( 'wp_ajax_update_ts_shipment_status_order_mete', array( $this, 'update_ts_shipment_status_order_mete' ) );
60
  }
61
 
62
  /**
70
  */
71
  public function woo_shippment_tracking_install(){
72
 
 
73
  // Add transient to trigger redirect.
74
  set_transient( '_ast_activation_redirect', 1, 30 );
75
+
76
+ $this->create_shippment_tracking_table();
77
+ $this->update_shipping_providers();
78
+
79
+ update_option( 'wc_advanced_shipment_tracking', '3.19');
80
+
81
+ $wc_ast_default_mark_shipped = get_option('wc_ast_default_mark_shipped');
82
+ if($wc_ast_default_mark_shipped == ''){
83
+ update_option('wc_ast_default_mark_shipped',1);
84
+ }
85
+
86
+ $wc_ast_unclude_tracking_info = get_option('wc_ast_unclude_tracking_info');
87
+ if(empty($wc_ast_unclude_tracking_info)){
88
+ $data_array = array('completed' => 1,'partial-shipped' => 1,'updated-tracking' => 1);
89
+ update_option( 'wc_ast_unclude_tracking_info', $data_array );
90
+ }
91
+
92
+ $wc_ast_show_orders_actions = get_option('wc_ast_show_orders_actions');
93
+ if(empty($wc_ast_show_orders_actions)){
94
+ $data_array = array('processing' => 1,'completed' => 1,'partial-shipped' => 1,'updated-tracking' => 1);
95
+ update_option( 'wc_ast_show_orders_actions', $data_array );
96
+ }
97
+ }
98
+
99
+ public function create_shippment_tracking_table(){
100
+
101
+ global $wpdb;
102
+
103
+ if(!$wpdb->query($wpdb->prepare("show tables like %s",$this->table))){
104
  $charset_collate = $wpdb->get_charset_collate();
105
+ $sql = "CREATE TABLE $this->table (
106
  id mediumint(9) NOT NULL AUTO_INCREMENT,
107
  provider_name varchar(500) DEFAULT '' NOT NULL,
108
  api_provider_name text NULL DEFAULT NULL,
119
  ) $charset_collate;";
120
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
121
  dbDelta( $sql );
 
 
 
 
 
 
 
 
 
122
  }
123
+ }
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
  /*
126
  * database update
276
  $res = $wpdb->query( "ALTER TABLE $this->table ADD api_provider_name text NULL DEFAULT NULL AFTER provider_name" );
277
  }
278
  update_option( 'wc_advanced_shipment_tracking', '3.19');
279
+ }
280
+
281
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'3.20', '<') ){
282
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 1 ), '' );
283
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 2 ), '' );
284
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 3 ), '' );
285
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 4 ), '' );
286
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 5 ), '' );
287
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 6 ), '' );
288
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 7 ), '' );
289
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 8 ), '' );
290
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 9 ), '' );
291
+ as_schedule_single_action( time(), 'update_ts_shipment_status_order_mete' , array( 'order_page' => 10 ), '' );
292
+ update_option( 'wc_advanced_shipment_tracking', '3.20');
293
  }
294
  }
295
  }
296
 
297
+ public function update_ts_shipment_status_order_mete( $page ){
298
+ $wc_ast_api_key = get_option('wc_ast_api_key');
299
+ if( !$wc_ast_api_key )return;
300
+
301
+ $args = array(
302
+ 'limit' => 100,
303
+ 'paged' => $page,
304
+ 'return' => 'ids',
305
+ );
306
+
307
+ $orders = wc_get_orders( $args );
308
+
309
+ foreach( $orders as $order_id ){
310
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
311
+ if( !empty($shipment_status) ){
312
+ foreach( $shipment_status as $key => $shipment ){
313
+ $ts_shipment_status[$key]['status'] = $shipment['status'];
314
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
315
+ }
316
+ }
317
+ }
318
+ }
319
  /**
320
  * function for add provider image in uploads directory under wp-content/uploads/ast-shipping-providers
321
  */
includes/class-wc-advanced-shipment-tracking-settings.php CHANGED
@@ -57,8 +57,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
57
  add_filter( 'wc_order_statuses', array( $this, 'wc_renaming_order_status') );
58
  add_filter( 'woocommerce_register_shop_order_post_statuses', array( $this, 'filter_woocommerce_register_shop_order_post_statuses'), 10, 1 );
59
  add_filter( 'bulk_actions-edit-shop_order', array( $this, 'modify_bulk_actions'), 50, 1 );
60
-
61
- add_action( 'woocommerce_update_options_email_customer_delivered_order', array( $this, 'save_delivered_email' ) ,100, 1);
62
  add_action( 'woocommerce_update_options_email_customer_partial_shipped_order', array( $this, 'save_partial_shipped_email' ) ,100, 1);
63
  add_action( 'wp_ajax_sync_providers', array( $this, 'sync_providers_fun') );
64
 
@@ -117,13 +116,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
117
  add_filter( 'admin_body_class', array( $this, 'ahipment_tracking_admin_body_class' ) );
118
 
119
  // Ajax hook for open inline tracking form
120
- add_action( 'wp_ajax_ast_open_inline_tracking_form', array( $this, 'ast_open_inline_tracking_form_fun' ) );
121
-
122
- $wc_ast_status_delivered = get_option('wc_ast_status_delivered');
123
- if($wc_ast_status_delivered == 1){
124
- add_action( 'woocommerce_order_actions', array( $this, 'add_order_meta_box_actions' ) );
125
- add_action( 'woocommerce_order_action_resend_delivered_order_notification', array( $this, 'process_order_meta_box_actions' ) );
126
- }
127
  }
128
 
129
  /**
@@ -496,32 +489,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
496
  <?php
497
  $html = ob_get_clean();
498
  echo $html;exit;
499
- }
500
-
501
- /*
502
- * define the item in the meta box by adding an item to the $actions array
503
- */
504
- function add_order_meta_box_actions( $actions ) {
505
- $actions['resend_delivered_order_notification'] = __( 'Resend delivered order notification', 'woo-advanced-shipment-tracking' );
506
- return $actions;
507
- }
508
-
509
- /*
510
- * function call when resend delivered order email notification trigger
511
- */
512
- function process_order_meta_box_actions($order){
513
- require_once( 'email-manager.php' );
514
- $order_id = $order->get_id();
515
- WC()->mailer()->emails['WC_Email_Customer_Delivered_Order']->trigger( $order_id, $order );
516
- }
517
-
518
- /**
519
- * Update Delivered order email enable/disable in customizer
520
- */
521
- public function save_delivered_email($data){
522
- $woocommerce_customer_delivered_order_enabled = (isset($_POST["woocommerce_customer_delivered_order_enabled"])?wc_clean($_REQUEST["woocommerce_customer_delivered_order_enabled"]):"");
523
- update_option( 'customizer_delivered_order_settings_enabled',$woocommerce_customer_delivered_order_enabled);
524
- }
525
 
526
  /**
527
  * Update Partially Shipped order email enable/disable in customizer
@@ -551,8 +519,11 @@ class WC_Advanced_Shipment_Tracking_Settings {
551
  $providers = json_decode($resp['body'],true);
552
 
553
  if($reset_checked == 1){
554
- $where = array( 'shipping_default' => 1 );
555
- $wpdb->delete( $this->table, $where );
 
 
 
556
 
557
  foreach($providers as $provider){
558
  $provider_name = $provider['shipping_provider'];
@@ -592,7 +563,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
592
  $result = $wpdb->insert( $this->table, $data_array );
593
  }
594
  $status = 'active';
595
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY display_in_order DESC, trackship_supported DESC, id ASC" );
596
  ob_start();
597
  $admin = new WC_Advanced_Shipment_Tracking_Admin;
598
  $html = $admin->get_provider_html($default_shippment_providers,$status);
@@ -601,7 +572,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
601
  echo json_encode( array( 'html' => $html) );exit;
602
  } else{
603
 
604
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY display_in_order DESC, trackship_supported DESC, id ASC" );
605
 
606
  foreach ( $default_shippment_providers as $key => $val ){
607
  $shippment_providers[ $val->provider_name ] = $val;
@@ -723,7 +694,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
723
  }
724
 
725
  $status = 'active';
726
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY display_in_order DESC, trackship_supported DESC, id ASC" );
727
  ob_start();
728
  $admin = new WC_Advanced_Shipment_Tracking_Admin;
729
  $html = $admin->get_provider_html($default_shippment_providers,$status);
57
  add_filter( 'wc_order_statuses', array( $this, 'wc_renaming_order_status') );
58
  add_filter( 'woocommerce_register_shop_order_post_statuses', array( $this, 'filter_woocommerce_register_shop_order_post_statuses'), 10, 1 );
59
  add_filter( 'bulk_actions-edit-shop_order', array( $this, 'modify_bulk_actions'), 50, 1 );
60
+
 
61
  add_action( 'woocommerce_update_options_email_customer_partial_shipped_order', array( $this, 'save_partial_shipped_email' ) ,100, 1);
62
  add_action( 'wp_ajax_sync_providers', array( $this, 'sync_providers_fun') );
63
 
116
  add_filter( 'admin_body_class', array( $this, 'ahipment_tracking_admin_body_class' ) );
117
 
118
  // Ajax hook for open inline tracking form
119
+ add_action( 'wp_ajax_ast_open_inline_tracking_form', array( $this, 'ast_open_inline_tracking_form_fun' ) );
 
 
 
 
 
 
120
  }
121
 
122
  /**
489
  <?php
490
  $html = ob_get_clean();
491
  echo $html;exit;
492
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
 
494
  /**
495
  * Update Partially Shipped order email enable/disable in customizer
519
  $providers = json_decode($resp['body'],true);
520
 
521
  if($reset_checked == 1){
522
+
523
+ $wpdb->query( "DROP TABLE IF EXISTS $this->table" );
524
+
525
+ $install = WC_Advanced_Shipment_Tracking_Install::get_instance();
526
+ $install->create_shippment_tracking_table();
527
 
528
  foreach($providers as $provider){
529
  $provider_name = $provider['shipping_provider'];
563
  $result = $wpdb->insert( $this->table, $data_array );
564
  }
565
  $status = 'active';
566
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
567
  ob_start();
568
  $admin = new WC_Advanced_Shipment_Tracking_Admin;
569
  $html = $admin->get_provider_html($default_shippment_providers,$status);
572
  echo json_encode( array( 'html' => $html) );exit;
573
  } else{
574
 
575
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
576
 
577
  foreach ( $default_shippment_providers as $key => $val ){
578
  $shippment_providers[ $val->provider_name ] = $val;
694
  }
695
 
696
  $status = 'active';
697
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table ORDER BY shipping_default ASC, display_in_order DESC, trackship_supported DESC, id ASC" );
698
  ob_start();
699
  $admin = new WC_Advanced_Shipment_Tracking_Admin;
700
  $html = $admin->get_provider_html($default_shippment_providers,$status);
includes/class-wc-advanced-shipment-tracking-trackship.php CHANGED
@@ -813,7 +813,7 @@ class WC_Advanced_Shipment_Tracking_Trackship {
813
  public function filter_orders_by_shipment_status_query( $vars ){
814
  global $typenow;
815
  if ( 'shop_order' === $typenow && isset( $_GET['_shop_order_shipment_status'] ) && $_GET['_shop_order_shipment_status'] != '') {
816
- $vars['meta_key'] = 'shipment_status';
817
  $vars['meta_value'] = $_GET['_shop_order_shipment_status'];
818
  $vars['meta_compare'] = 'LIKE';
819
  }
@@ -1154,7 +1154,12 @@ class WC_Advanced_Shipment_Tracking_Trackship {
1154
  * Shipment tracking info html in orders details page
1155
  */
1156
  public function display_shipment_tracking_info( $order_id, $item ){
1157
- $shipment_status = get_post_meta( $order_id, "shipment_status", true);
 
 
 
 
 
1158
  $tracking_id = $item['tracking_id'];
1159
 
1160
  $ast = new WC_Advanced_Shipment_Tracking_Actions;
@@ -1226,7 +1231,13 @@ class WC_Advanced_Shipment_Tracking_Trackship {
1226
  $shipment_status = get_post_meta( $order_id, "shipment_status", true);
1227
  if( isset( $shipment_status[$key] ) ){
1228
  unset($shipment_status[$key]);
1229
- update_post_meta( $order_id, "shipment_status", $shipment_status);
 
 
 
 
 
 
1230
  }
1231
  }
1232
 
813
  public function filter_orders_by_shipment_status_query( $vars ){
814
  global $typenow;
815
  if ( 'shop_order' === $typenow && isset( $_GET['_shop_order_shipment_status'] ) && $_GET['_shop_order_shipment_status'] != '') {
816
+ $vars['meta_key'] = 'ts_shipment_status';
817
  $vars['meta_value'] = $_GET['_shop_order_shipment_status'];
818
  $vars['meta_compare'] = 'LIKE';
819
  }
1154
  * Shipment tracking info html in orders details page
1155
  */
1156
  public function display_shipment_tracking_info( $order_id, $item ){
1157
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
1158
+ $ts_shipment_status = get_post_meta( $order_id, "ts_shipment_status", true);
1159
+
1160
+ //echo '<pre>';print_r($shipment_status);echo '</pre>';
1161
+ //echo '<pre>';print_r($ts_shipment_status);echo '</pre>';
1162
+
1163
  $tracking_id = $item['tracking_id'];
1164
 
1165
  $ast = new WC_Advanced_Shipment_Tracking_Actions;
1231
  $shipment_status = get_post_meta( $order_id, "shipment_status", true);
1232
  if( isset( $shipment_status[$key] ) ){
1233
  unset($shipment_status[$key]);
1234
+ update_post_meta( $order_id, "shipment_status", $shipment_status);
1235
+ }
1236
+
1237
+ $ts_shipment_status = get_post_meta( $order_id, "ts_shipment_status", true);
1238
+ if( isset( $ts_shipment_status[$key] ) ){
1239
+ unset($ts_shipment_status[$key]);
1240
+ update_post_meta( $order_id, "ts_shipment_status", $ts_shipment_status);
1241
  }
1242
  }
1243
 
includes/class-wc-advanced-shipment-tracking.php CHANGED
@@ -726,6 +726,10 @@ class WC_Advanced_Shipment_Tracking_Actions {
726
  */
727
  public function show_tracking_info_order( $order_id ) {
728
 
 
 
 
 
729
  $local_template = get_stylesheet_directory().'/woocommerce/myaccount/tracking-info.php';
730
 
731
  if ( file_exists( $local_template ) && is_writable( $local_template )){
@@ -942,7 +946,9 @@ class WC_Advanced_Shipment_Tracking_Actions {
942
  $wc_ast_api_key = get_option('wc_ast_api_key');
943
  $use_tracking_page = get_option('wc_ast_use_tracking_page');
944
 
945
- if( $wc_ast_api_key && $use_tracking_page && $trackship_supported == 1 && $status != 'carrier_unsupported'){
 
 
946
  $order_key = $order->get_order_key();
947
  if($tracking_page == 'other'){
948
  $trackship_other_page = get_option('wc_ast_trackship_other_page');
@@ -1017,6 +1023,21 @@ class WC_Advanced_Shipment_Tracking_Actions {
1017
 
1018
  return $formatted;
1019
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1020
 
1021
  /**
1022
  * Deletes a tracking item from post_meta array
726
  */
727
  public function show_tracking_info_order( $order_id ) {
728
 
729
+ wp_enqueue_style( 'front_style' );
730
+ wp_enqueue_script( 'jquery-blockui' );
731
+ wp_enqueue_script( 'front-js' );
732
+
733
  $local_template = get_stylesheet_directory().'/woocommerce/myaccount/tracking-info.php';
734
 
735
  if ( file_exists( $local_template ) && is_writable( $local_template )){
946
  $wc_ast_api_key = get_option('wc_ast_api_key');
947
  $use_tracking_page = get_option('wc_ast_use_tracking_page');
948
 
949
+ $ts_tracking_page = $this->check_ts_tracking_page_for_tracking_item( $order_id, $tracking_item, $status );
950
+
951
+ if( $ts_tracking_page ){
952
  $order_key = $order->get_order_key();
953
  if($tracking_page == 'other'){
954
  $trackship_other_page = get_option('wc_ast_trackship_other_page');
1023
 
1024
  return $formatted;
1025
  }
1026
+
1027
+ public function check_ts_tracking_page_for_tracking_item( $order_id, $tracking_item, $status ){
1028
+ $wc_ast_api_key = get_option('wc_ast_api_key');
1029
+ $use_tracking_page = get_option('wc_ast_use_tracking_page');
1030
+
1031
+ foreach ( $this->get_providers() as $provider => $format ) {
1032
+ if ( $provider === $tracking_item['tracking_provider'] ) {
1033
+ $trackship_supported = $format['trackship_supported'];
1034
+ break;
1035
+ }
1036
+ }
1037
+
1038
+ if( $wc_ast_api_key && $use_tracking_page && $trackship_supported == 1 && $status != 'carrier_unsupported')return true;
1039
+ return false;
1040
+ }
1041
 
1042
  /**
1043
  * Deletes a tracking item from post_meta array
includes/customizer/class-wc-availableforpickup-email-customizer.php CHANGED
@@ -114,7 +114,7 @@ class wcast_availableforpickup_customizer_email {
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
118
  }
119
 
120
  /**
@@ -128,9 +128,9 @@ class wcast_availableforpickup_customizer_email {
128
  'wcast_enable_availableforpickup_email' => '',
129
  'wcast_availableforpickup_email_to' => '{customer_email}',
130
  'wcast_availableforpickup_show_tracking_details' => '',
131
- 'wcast_availableforpickup_show_order_details' => '',
132
- 'wcast_availableforpickup_show_billing_address' => '',
133
- 'wcast_availableforpickup_show_shipping_address' => '',
134
  'wcast_availableforpickup_email_code_block' => '',
135
  );
136
 
@@ -295,6 +295,25 @@ class wcast_availableforpickup_customizer_email {
295
  'type' => 'checkbox',
296
  'active_callback' => array( $this, 'active_callback' ),
297
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  );
299
 
300
  // Display Shipment Provider image/thumbnail
@@ -348,6 +367,18 @@ class wcast_availableforpickup_customizer_email {
348
  }
349
  }
350
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  /**
352
  * Set up preview
353
  *
@@ -382,7 +413,9 @@ class wcast_availableforpickup_customizer_email {
382
 
383
  $email_content = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_email_content',$this->defaults['wcast_availableforpickup_email_content']);
384
 
385
- $wcast_show_order_details = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_show_order_details',$this->defaults['wcast_availableforpickup_show_order_details']);
 
 
386
 
387
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_show_shipping_address',$this->defaults['wcast_availableforpickup_show_shipping_address']);
388
 
@@ -445,6 +478,7 @@ class wcast_availableforpickup_customizer_email {
445
  wc_get_template(
446
  'emails/wcast-email-order-details.php', array(
447
  'order' => $order,
 
448
  'sent_to_admin' => $sent_to_admin,
449
  'plain_text' => $plain_text,
450
  'email' => $email,
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
118
  }
119
 
120
  /**
128
  'wcast_enable_availableforpickup_email' => '',
129
  'wcast_availableforpickup_email_to' => '{customer_email}',
130
  'wcast_availableforpickup_show_tracking_details' => '',
131
+ 'wcast_availableforpickup_show_order_details' => 1,
132
+ 'wcast_availableforpickup_hide_shipping_item_price' => 1,
133
+ 'wcast_availableforpickup_show_shipping_address' => 1,
134
  'wcast_availableforpickup_email_code_block' => '',
135
  );
136
 
295
  'type' => 'checkbox',
296
  'active_callback' => array( $this, 'active_callback' ),
297
  )
298
+ );
299
+
300
+ // Display Shipment Provider image/thumbnail
301
+ $wp_customize->add_setting( 'wcast_availableforpickup_email_settings[wcast_availableforpickup_hide_shipping_item_price]',
302
+ array(
303
+ 'default' => $this->defaults['wcast_availableforpickup_hide_shipping_item_price'],
304
+ 'transport' => 'refresh',
305
+ 'type' => 'option',
306
+ 'sanitize_callback' => ''
307
+ )
308
+ );
309
+ $wp_customize->add_control( 'wcast_availableforpickup_email_settings[wcast_availableforpickup_hide_shipping_item_price]',
310
+ array(
311
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
312
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
313
+ 'section' => 'trackship_shipment_status_email',
314
+ 'type' => 'checkbox',
315
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
316
+ )
317
  );
318
 
319
  // Display Shipment Provider image/thumbnail
367
  }
368
  }
369
 
370
+ public function active_callback_only_show_order_details(){
371
+
372
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
373
+ $show_order_details = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_show_order_details',$this->defaults['wcast_availableforpickup_show_order_details']);
374
+
375
+ if ( wcast_availableforpickup_customizer_email::is_own_preview_request() && $show_order_details ) {
376
+ return true;
377
+ } else{
378
+ return false;
379
+ }
380
+ }
381
+
382
  /**
383
  * Set up preview
384
  *
413
 
414
  $email_content = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_email_content',$this->defaults['wcast_availableforpickup_email_content']);
415
 
416
+ $wcast_show_order_details = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_show_order_details',$this->defaults['wcast_availableforpickup_show_order_details']);
417
+
418
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_hide_shipping_item_price',$this->defaults['wcast_availableforpickup_hide_shipping_item_price']);
419
 
420
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_availableforpickup_show_shipping_address',$this->defaults['wcast_availableforpickup_show_shipping_address']);
421
 
478
  wc_get_template(
479
  'emails/wcast-email-order-details.php', array(
480
  'order' => $order,
481
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
482
  'sent_to_admin' => $sent_to_admin,
483
  'plain_text' => $plain_text,
484
  'email' => $email,
includes/customizer/class-wc-delivered-email-customizer.php CHANGED
@@ -114,7 +114,7 @@ class wcast_delivered_customizer_email {
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
118
  }
119
 
120
  /**
@@ -127,9 +127,9 @@ class wcast_delivered_customizer_email {
127
  'wcast_delivered_status_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} has been Delivered.", 'woo-advanced-shipment-tracking' ),'wcast_enable_delivered_status_email' => '',
128
  'wcast_delivered_status_email_to' => '{customer_email}',
129
  'wcast_delivered_status_show_tracking_details' => '',
130
- 'wcast_delivered_status_show_order_details' => '',
131
- 'wcast_delivered_status_show_billing_address' => '',
132
- 'wcast_delivered_status_show_shipping_address' => '',
133
  'wcast_delivered_status_email_code_block' => '',
134
  );
135
 
@@ -275,6 +275,25 @@ class wcast_delivered_customizer_email {
275
  'active_callback' => array( $this, 'active_callback' ),
276
  )
277
  ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
 
279
  // Display Shipment Provider image/thumbnail
280
  $wp_customize->add_setting( 'wcast_delivered_email_settings[wcast_delivered_status_show_order_details]',
@@ -293,6 +312,25 @@ class wcast_delivered_customizer_email {
293
  'type' => 'checkbox',
294
  'active_callback' => array( $this, 'active_callback' ),
295
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  );
297
 
298
  // Display Shipment Provider image/thumbnail
@@ -346,6 +384,18 @@ class wcast_delivered_customizer_email {
346
  }
347
  }
348
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  /**
350
  * Set up preview
351
  *
@@ -380,8 +430,12 @@ class wcast_delivered_customizer_email {
380
 
381
  $email_content = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_email_content',$this->defaults['wcast_delivered_status_email_content']);
382
 
 
 
383
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_order_details',$this->defaults['wcast_delivered_status_show_order_details']);
384
 
 
 
385
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_shipping_address',$this->defaults['wcast_delivered_status_show_shipping_address']);
386
 
387
  $sent_to_admin = false;
@@ -416,26 +470,26 @@ class wcast_delivered_customizer_email {
416
  $message = preg_replace_callback($regex, array( $this, '_appendCampaignToString'), $message);
417
  }
418
 
419
- $wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
420
-
421
- ob_start();
422
- $local_template = get_stylesheet_directory().'/woocommerce/emails/tracking-info.php';
423
- if ( file_exists( $local_template ) && is_writable( $local_template )){
424
- wc_get_template( 'emails/tracking-info.php', array(
425
- 'tracking_items' => $wast->get_tracking_items( $preview_id, true ),
426
- 'order_id' => $preview_id,
427
- 'show_shipment_status' => true,
428
- 'new_status' => 'delivered',
429
- ), 'woocommerce-advanced-shipment-tracking/', get_stylesheet_directory() . '/woocommerce/' );
430
- } else{
431
- wc_get_template( 'emails/tracking-info.php', array(
432
- 'tracking_items' => $wast->get_tracking_items( $preview_id, true ),
433
- 'order_id' => $preview_id,
434
- 'show_shipment_status' => true,
435
- 'new_status' => 'delivered',
436
- ), 'woocommerce-advanced-shipment-tracking/', wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/' );
437
- }
438
- $message .= ob_get_clean();
439
 
440
  if($wcast_show_order_details == 1){
441
 
@@ -443,6 +497,7 @@ class wcast_delivered_customizer_email {
443
  wc_get_template(
444
  'emails/wcast-email-order-details.php', array(
445
  'order' => $order,
 
446
  'sent_to_admin' => $sent_to_admin,
447
  'plain_text' => $plain_text,
448
  'email' => $email,
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
118
  }
119
 
120
  /**
127
  'wcast_delivered_status_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} has been Delivered.", 'woo-advanced-shipment-tracking' ),'wcast_enable_delivered_status_email' => '',
128
  'wcast_delivered_status_email_to' => '{customer_email}',
129
  'wcast_delivered_status_show_tracking_details' => '',
130
+ 'wcast_delivered_status_show_order_details' => 1,
131
+ 'wcast_delivered_status_hide_shipping_item_price' => 1,
132
+ 'wcast_delivered_status_show_shipping_address' => 1,
133
  'wcast_delivered_status_email_code_block' => '',
134
  );
135
 
275
  'active_callback' => array( $this, 'active_callback' ),
276
  )
277
  ) );
278
+
279
+ // Display Shipment Provider image/thumbnail
280
+ $wp_customize->add_setting( 'wcast_delivered_email_settings[wcast_delivered_status_show_tracking_details]',
281
+ array(
282
+ 'default' => $this->defaults['wcast_delivered_status_show_tracking_details'],
283
+ 'transport' => 'refresh',
284
+ 'type' => 'option',
285
+ 'sanitize_callback' => ''
286
+ )
287
+ );
288
+ $wp_customize->add_control( 'wcast_delivered_email_settings[wcast_delivered_status_show_tracking_details]',
289
+ array(
290
+ 'label' => __( 'Show tracking details', 'woo-advanced-shipment-tracking' ),
291
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
292
+ 'section' => 'trackship_shipment_status_email',
293
+ 'type' => 'checkbox',
294
+ 'active_callback' => array( $this, 'active_callback' ),
295
+ )
296
+ );
297
 
298
  // Display Shipment Provider image/thumbnail
299
  $wp_customize->add_setting( 'wcast_delivered_email_settings[wcast_delivered_status_show_order_details]',
312
  'type' => 'checkbox',
313
  'active_callback' => array( $this, 'active_callback' ),
314
  )
315
+ );
316
+
317
+ // Display Shipment Provider image/thumbnail
318
+ $wp_customize->add_setting( 'wcast_delivered_email_settings[wcast_delivered_status_hide_shipping_item_price]',
319
+ array(
320
+ 'default' => $this->defaults['wcast_delivered_status_hide_shipping_item_price'],
321
+ 'transport' => 'refresh',
322
+ 'type' => 'option',
323
+ 'sanitize_callback' => ''
324
+ )
325
+ );
326
+ $wp_customize->add_control( 'wcast_delivered_email_settings[wcast_delivered_status_hide_shipping_item_price]',
327
+ array(
328
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
329
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
330
+ 'section' => 'trackship_shipment_status_email',
331
+ 'type' => 'checkbox',
332
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
333
+ )
334
  );
335
 
336
  // Display Shipment Provider image/thumbnail
384
  }
385
  }
386
 
387
+ public function active_callback_only_show_order_details(){
388
+
389
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
390
+ $show_order_details = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_order_details',$this->defaults['wcast_delivered_status_show_order_details']);
391
+
392
+ if ( wcast_delivered_customizer_email::is_own_preview_request() && $show_order_details ) {
393
+ return true;
394
+ } else{
395
+ return false;
396
+ }
397
+ }
398
+
399
  /**
400
  * Set up preview
401
  *
430
 
431
  $email_content = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_email_content',$this->defaults['wcast_delivered_status_email_content']);
432
 
433
+ $wcast_show_tracking_details = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_tracking_details',$this->defaults['wcast_delivered_status_show_tracking_details']);
434
+
435
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_order_details',$this->defaults['wcast_delivered_status_show_order_details']);
436
 
437
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_hide_shipping_item_price',$this->defaults['wcast_delivered_status_hide_shipping_item_price']);
438
+
439
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_shipping_address',$this->defaults['wcast_delivered_status_show_shipping_address']);
440
 
441
  $sent_to_admin = false;
470
  $message = preg_replace_callback($regex, array( $this, '_appendCampaignToString'), $message);
471
  }
472
 
473
+ if($wcast_show_tracking_details == 1){
474
+ ob_start();
475
+ $local_template = get_stylesheet_directory().'/woocommerce/emails/tracking-info.php';
476
+ if ( file_exists( $local_template ) && is_writable( $local_template )){
477
+ wc_get_template( 'emails/tracking-info.php', array(
478
+ 'tracking_items' => $ast->get_tracking_items( $preview_id, true ),
479
+ 'order_id' => $preview_id,
480
+ 'show_shipment_status' => true,
481
+ 'new_status' => 'delivered',
482
+ ), 'woocommerce-advanced-shipment-tracking/', get_stylesheet_directory() . '/woocommerce/' );
483
+ } else{
484
+ wc_get_template( 'emails/tracking-info.php', array(
485
+ 'tracking_items' => $ast->get_tracking_items( $preview_id, true ),
486
+ 'order_id' => $preview_id,
487
+ 'show_shipment_status' => true,
488
+ 'new_status' => 'delivered',
489
+ ), 'woocommerce-advanced-shipment-tracking/', wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/' );
490
+ }
491
+ $message .= ob_get_clean();
492
+ }
493
 
494
  if($wcast_show_order_details == 1){
495
 
497
  wc_get_template(
498
  'emails/wcast-email-order-details.php', array(
499
  'order' => $order,
500
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
501
  'sent_to_admin' => $sent_to_admin,
502
  'plain_text' => $plain_text,
503
  'email' => $email,
includes/customizer/class-wc-failure-email-customizer.php CHANGED
@@ -114,7 +114,7 @@ class wcast_failure_customizer_email {
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
118
  }
119
 
120
  /**
@@ -128,9 +128,9 @@ class wcast_failure_customizer_email {
128
  'wcast_enable_failure_email' => '',
129
  'wcast_failure_email_to' => '{customer_email}',
130
  'wcast_failure_show_tracking_details' => '',
131
- 'wcast_failure_show_order_details' => '',
132
- 'wcast_failure_show_billing_address' => '',
133
- 'wcast_failure_show_shipping_address' => '',
134
  'wcast_failure_email_code_block' => '',
135
  );
136
 
@@ -294,7 +294,26 @@ class wcast_failure_customizer_email {
294
  'type' => 'checkbox',
295
  'active_callback' => array( $this, 'active_callback' ),
296
  )
297
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
  // Display Shipment Provider image/thumbnail
300
  $wp_customize->add_setting( 'wcast_failure_email_settings[wcast_failure_show_shipping_address]',
@@ -346,6 +365,19 @@ class wcast_failure_customizer_email {
346
  return false;
347
  }
348
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  /**
350
  * Set up preview
351
  *
@@ -383,6 +415,8 @@ class wcast_failure_customizer_email {
383
 
384
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_order_details',$this->defaults['wcast_failure_show_order_details']);
385
 
 
 
386
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_shipping_address',$this->defaults['wcast_failure_show_shipping_address']);
387
 
388
  $sent_to_admin = false;
@@ -445,6 +479,7 @@ class wcast_failure_customizer_email {
445
  wc_get_template(
446
  'emails/wcast-email-order-details.php', array(
447
  'order' => $order,
 
448
  'sent_to_admin' => $sent_to_admin,
449
  'plain_text' => $plain_text,
450
  'email' => $email,
114
  * @return string
115
  */
116
  public static function get_email_settings_page_url($return_tab) {
117
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
118
  }
119
 
120
  /**
128
  'wcast_enable_failure_email' => '',
129
  'wcast_failure_email_to' => '{customer_email}',
130
  'wcast_failure_show_tracking_details' => '',
131
+ 'wcast_failure_show_order_details' => 1,
132
+ 'wcast_failure_hide_shipping_item_price' => 1,
133
+ 'wcast_failure_show_shipping_address' => 1,
134
  'wcast_failure_email_code_block' => '',
135
  );
136
 
294
  'type' => 'checkbox',
295
  'active_callback' => array( $this, 'active_callback' ),
296
  )
297
+ );
298
+
299
+ // Display Shipment Provider image/thumbnail
300
+ $wp_customize->add_setting( 'wcast_failure_email_settings[wcast_failure_hide_shipping_item_price]',
301
+ array(
302
+ 'default' => $this->defaults['wcast_failure_hide_shipping_item_price'],
303
+ 'transport' => 'refresh',
304
+ 'type' => 'option',
305
+ 'sanitize_callback' => ''
306
+ )
307
+ );
308
+ $wp_customize->add_control( 'wcast_failure_email_settings[wcast_failure_hide_shipping_item_price]',
309
+ array(
310
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
311
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
312
+ 'section' => 'trackship_shipment_status_email',
313
+ 'type' => 'checkbox',
314
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
315
+ )
316
+ );
317
 
318
  // Display Shipment Provider image/thumbnail
319
  $wp_customize->add_setting( 'wcast_failure_email_settings[wcast_failure_show_shipping_address]',
365
  return false;
366
  }
367
  }
368
+
369
+ public function active_callback_only_show_order_details(){
370
+
371
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
372
+ $show_order_details = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_order_details',$this->defaults['wcast_failure_show_order_details']);
373
+
374
+ if ( wcast_failure_customizer_email::is_own_preview_request() && $show_order_details ) {
375
+ return true;
376
+ } else{
377
+ return false;
378
+ }
379
+ }
380
+
381
  /**
382
  * Set up preview
383
  *
415
 
416
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_order_details',$this->defaults['wcast_failure_show_order_details']);
417
 
418
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_order_details',$this->defaults['wcast_failure_show_order_details']);
419
+
420
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_failure_email_settings','wcast_failure_show_shipping_address',$this->defaults['wcast_failure_show_shipping_address']);
421
 
422
  $sent_to_admin = false;
479
  wc_get_template(
480
  'emails/wcast-email-order-details.php', array(
481
  'order' => $order,
482
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
483
  'sent_to_admin' => $sent_to_admin,
484
  'plain_text' => $plain_text,
485
  'email' => $email,
includes/customizer/class-wc-intransit-email-customizer.php CHANGED
@@ -117,7 +117,7 @@ class wcast_intransit_customizer_email {
117
  * @return string
118
  */
119
  public static function get_email_settings_page_url($return_tab) {
120
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
121
  }
122
 
123
  /**
@@ -130,8 +130,9 @@ class wcast_intransit_customizer_email {
130
  'wcast_intransit_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is in transit", 'woo-advanced-shipment-tracking' ),
131
  'wcast_enable_intransit_email' => '',
132
  'wcast_intransit_email_to' => '{customer_email}',
133
- 'wcast_intransit_show_order_details' => '',
134
- 'wcast_intransit_show_shipping_address' => '',
 
135
  'wcast_intransit_email_code_block' => '',
136
  );
137
 
@@ -346,7 +347,26 @@ class wcast_intransit_customizer_email {
346
  'type' => 'checkbox',
347
  'active_callback' => array( $this, 'active_callback' ),
348
  )
349
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
 
351
  // Display Shipment Provider image/thumbnail
352
  $wp_customize->add_setting( 'wcast_intransit_email_settings[wcast_intransit_show_shipping_address]',
@@ -398,6 +418,19 @@ class wcast_intransit_customizer_email {
398
  return false;
399
  }
400
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /**
402
  * Set up preview
403
  *
@@ -434,6 +467,8 @@ class wcast_intransit_customizer_email {
434
 
435
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_show_order_details',$this->defaults['wcast_intransit_show_order_details']);
436
 
 
 
437
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_show_shipping_address',$this->defaults['wcast_intransit_show_shipping_address']);
438
 
439
  $sent_to_admin = false;
@@ -495,6 +530,7 @@ class wcast_intransit_customizer_email {
495
  wc_get_template(
496
  'emails/wcast-email-order-details.php', array(
497
  'order' => $order,
 
498
  'sent_to_admin' => $sent_to_admin,
499
  'plain_text' => $plain_text,
500
  'email' => $email,
117
  * @return string
118
  */
119
  public static function get_email_settings_page_url($return_tab) {
120
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
121
  }
122
 
123
  /**
130
  'wcast_intransit_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is in transit", 'woo-advanced-shipment-tracking' ),
131
  'wcast_enable_intransit_email' => '',
132
  'wcast_intransit_email_to' => '{customer_email}',
133
+ 'wcast_intransit_show_order_details' => 1,
134
+ 'wcast_intransit_hide_shipping_item_price' => 1,
135
+ 'wcast_intransit_show_shipping_address' => 1,
136
  'wcast_intransit_email_code_block' => '',
137
  );
138
 
347
  'type' => 'checkbox',
348
  'active_callback' => array( $this, 'active_callback' ),
349
  )
350
+ );
351
+
352
+ // Display Shipment Provider image/thumbnail
353
+ $wp_customize->add_setting( 'wcast_intransit_email_settings[wcast_intransit_hide_shipping_item_price]',
354
+ array(
355
+ 'default' => $this->defaults['wcast_intransit_hide_shipping_item_price'],
356
+ 'transport' => 'refresh',
357
+ 'type' => 'option',
358
+ 'sanitize_callback' => ''
359
+ )
360
+ );
361
+ $wp_customize->add_control( 'wcast_intransit_email_settings[wcast_intransit_hide_shipping_item_price]',
362
+ array(
363
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
364
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
365
+ 'section' => 'trackship_shipment_status_email',
366
+ 'type' => 'checkbox',
367
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
368
+ )
369
+ );
370
 
371
  // Display Shipment Provider image/thumbnail
372
  $wp_customize->add_setting( 'wcast_intransit_email_settings[wcast_intransit_show_shipping_address]',
418
  return false;
419
  }
420
  }
421
+
422
+ public function active_callback_only_show_order_details(){
423
+
424
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
425
+ $show_order_details = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_show_order_details',$this->defaults['wcast_intransit_show_order_details']);
426
+
427
+ if ( wcast_intransit_customizer_email::is_own_preview_request() && $show_order_details ) {
428
+ return true;
429
+ } else{
430
+ return false;
431
+ }
432
+ }
433
+
434
  /**
435
  * Set up preview
436
  *
467
 
468
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_show_order_details',$this->defaults['wcast_intransit_show_order_details']);
469
 
470
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_hide_shipping_item_price',$this->defaults['wcast_intransit_hide_shipping_item_price']);
471
+
472
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_intransit_email_settings','wcast_intransit_show_shipping_address',$this->defaults['wcast_intransit_show_shipping_address']);
473
 
474
  $sent_to_admin = false;
530
  wc_get_template(
531
  'emails/wcast-email-order-details.php', array(
532
  'order' => $order,
533
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
534
  'sent_to_admin' => $sent_to_admin,
535
  'plain_text' => $plain_text,
536
  'email' => $email,
includes/customizer/class-wc-onhold-email-customizer.php CHANGED
@@ -116,7 +116,7 @@ class wcast_onhold_customizer_email {
116
  * @return string
117
  */
118
  public static function get_email_settings_page_url($return_tab) {
119
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
120
  }
121
 
122
  /**
@@ -130,9 +130,9 @@ class wcast_onhold_customizer_email {
130
  'wcast_enable_onhold_email' => '',
131
  'wcast_onhold_email_to' => '{customer_email}',
132
  'wcast_onhold_show_tracking_details' => '',
133
- 'wcast_onhold_show_order_details' => '',
134
- 'wcast_onhold_show_billing_address' => '',
135
- 'wcast_onhold_show_shipping_address' => '',
136
  'wcast_onhold_email_code_block' => '',
137
  );
138
 
@@ -296,6 +296,25 @@ class wcast_onhold_customizer_email {
296
  'type' => 'checkbox',
297
  'active_callback' => array( $this, 'active_callback' ),
298
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  );
300
 
301
  // Display Shipment Provider image/thumbnail
@@ -348,6 +367,18 @@ class wcast_onhold_customizer_email {
348
  return false;
349
  }
350
  }
 
 
 
 
 
 
 
 
 
 
 
 
351
  /**
352
  * Set up preview
353
  *
@@ -384,6 +415,8 @@ class wcast_onhold_customizer_email {
384
 
385
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_show_order_details',$this->defaults['wcast_onhold_show_order_details']);
386
 
 
 
387
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_show_shipping_address',$this->defaults['wcast_onhold_show_shipping_address']);
388
 
389
  $sent_to_admin = false;
@@ -445,9 +478,10 @@ class wcast_onhold_customizer_email {
445
  wc_get_template(
446
  'emails/wcast-email-order-details.php', array(
447
  'order' => $order,
448
- 'sent_to_admin' => $sent_to_admin,
449
- 'plain_text' => $plain_text,
450
- 'email' => $email,
 
451
  ),
452
  'woocommerce-advanced-shipment-tracking/',
453
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
116
  * @return string
117
  */
118
  public static function get_email_settings_page_url($return_tab) {
119
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
120
  }
121
 
122
  /**
130
  'wcast_enable_onhold_email' => '',
131
  'wcast_onhold_email_to' => '{customer_email}',
132
  'wcast_onhold_show_tracking_details' => '',
133
+ 'wcast_onhold_show_order_details' => 1,
134
+ 'wcast_onhold_hide_shipping_item_price' => 1,
135
+ 'wcast_onhold_show_shipping_address' => 1,
136
  'wcast_onhold_email_code_block' => '',
137
  );
138
 
296
  'type' => 'checkbox',
297
  'active_callback' => array( $this, 'active_callback' ),
298
  )
299
+ );
300
+
301
+ // Display Shipment Provider image/thumbnail
302
+ $wp_customize->add_setting( 'wcast_onhold_email_settings[wcast_onhold_hide_shipping_item_price]',
303
+ array(
304
+ 'default' => $this->defaults['wcast_onhold_hide_shipping_item_price'],
305
+ 'transport' => 'refresh',
306
+ 'type' => 'option',
307
+ 'sanitize_callback' => ''
308
+ )
309
+ );
310
+ $wp_customize->add_control( 'wcast_onhold_email_settings[wcast_onhold_hide_shipping_item_price]',
311
+ array(
312
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
313
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
314
+ 'section' => 'trackship_shipment_status_email',
315
+ 'type' => 'checkbox',
316
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
317
+ )
318
  );
319
 
320
  // Display Shipment Provider image/thumbnail
367
  return false;
368
  }
369
  }
370
+
371
+ public function active_callback_only_show_order_details(){
372
+
373
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
374
+ $show_order_details = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_show_order_details',$this->defaults['wcast_onhold_show_order_details']);
375
+
376
+ if ( wcast_onhold_customizer_email::is_own_preview_request() && $show_order_details ) {
377
+ return true;
378
+ } else{
379
+ return false;
380
+ }
381
+ }
382
  /**
383
  * Set up preview
384
  *
415
 
416
  $wcast_show_order_details = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_show_order_details',$this->defaults['wcast_onhold_show_order_details']);
417
 
418
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_hide_shipping_item_price',$this->defaults['wcast_onhold_hide_shipping_item_price']);
419
+
420
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_onhold_email_settings','wcast_onhold_show_shipping_address',$this->defaults['wcast_onhold_show_shipping_address']);
421
 
422
  $sent_to_admin = false;
478
  wc_get_template(
479
  'emails/wcast-email-order-details.php', array(
480
  'order' => $order,
481
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
482
+ 'sent_to_admin' => $sent_to_admin,
483
+ 'plain_text' => $plain_text,
484
+ 'email' => $email,
485
  ),
486
  'woocommerce-advanced-shipment-tracking/',
487
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
includes/customizer/class-wc-outfordelivery-email-customizer.php CHANGED
@@ -115,7 +115,7 @@ class wcast_outfordelivery_customizer_email {
115
  * @return string
116
  */
117
  public static function get_email_settings_page_url($return_tab) {
118
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
119
  }
120
 
121
  /**
@@ -125,13 +125,12 @@ class wcast_outfordelivery_customizer_email {
125
  $customizer_defaults = array(
126
  'wcast_outfordelivery_email_subject' => __( 'Your order #{order_number} is out for delivery', 'woo-advanced-shipment-tracking' ),
127
  'wcast_outfordelivery_email_heading' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ),
128
- 'wcast_outfordelivery_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is out for delivery.", 'woo-advanced-shipment-tracking' ),
129
- 'wcast_enable_outfordelivery_email' => '',
130
  'wcast_outfordelivery_email_to' => '{customer_email}',
131
  'wcast_outfordelivery_show_tracking_details' => '',
132
- 'wcast_outfordelivery_show_order_details' => '',
133
- 'wcast_outfordelivery_show_billing_address' => '',
134
- 'wcast_outfordelivery_show_shipping_address' => '',
135
  'wcast_outfordelivery_email_code_block' => '',
136
  );
137
 
@@ -295,6 +294,25 @@ class wcast_outfordelivery_customizer_email {
295
  'type' => 'checkbox',
296
  'active_callback' => array( $this, 'active_callback' ),
297
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  );
299
 
300
  // Display Shipment Provider image/thumbnail
@@ -348,6 +366,18 @@ class wcast_outfordelivery_customizer_email {
348
  }
349
  }
350
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  /**
352
  * Set up preview
353
  *
@@ -382,7 +412,9 @@ class wcast_outfordelivery_customizer_email {
382
 
383
  $email_content = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_email_content',$this->defaults['wcast_outfordelivery_email_content']);
384
 
385
- $wcast_show_order_details = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_show_order_details',$this->defaults['wcast_outfordelivery_show_order_details']);
 
 
386
 
387
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_show_shipping_address',$this->defaults['wcast_outfordelivery_show_shipping_address']);
388
 
@@ -446,6 +478,7 @@ class wcast_outfordelivery_customizer_email {
446
  wc_get_template(
447
  'emails/wcast-email-order-details.php', array(
448
  'order' => $order,
 
449
  'sent_to_admin' => $sent_to_admin,
450
  'plain_text' => $plain_text,
451
  'email' => $email,
115
  * @return string
116
  */
117
  public static function get_email_settings_page_url($return_tab) {
118
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
119
  }
120
 
121
  /**
125
  $customizer_defaults = array(
126
  'wcast_outfordelivery_email_subject' => __( 'Your order #{order_number} is out for delivery', 'woo-advanced-shipment-tracking' ),
127
  'wcast_outfordelivery_email_heading' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ),
128
+ 'wcast_outfordelivery_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is out for delivery.", 'woo-advanced-shipment-tracking' ),'wcast_enable_outfordelivery_email' => '',
 
129
  'wcast_outfordelivery_email_to' => '{customer_email}',
130
  'wcast_outfordelivery_show_tracking_details' => '',
131
+ 'wcast_outfordelivery_show_order_details' => 1,
132
+ 'wcast_outfordelivery_hide_shipping_item_price' => 1,
133
+ 'wcast_outfordelivery_show_shipping_address' => 1,
134
  'wcast_outfordelivery_email_code_block' => '',
135
  );
136
 
294
  'type' => 'checkbox',
295
  'active_callback' => array( $this, 'active_callback' ),
296
  )
297
+ );
298
+
299
+ // Display Shipment Provider image/thumbnail
300
+ $wp_customize->add_setting( 'wcast_outfordelivery_email_settings[wcast_outfordelivery_hide_shipping_item_price]',
301
+ array(
302
+ 'default' => $this->defaults['wcast_outfordelivery_hide_shipping_item_price'],
303
+ 'transport' => 'refresh',
304
+ 'type' => 'option',
305
+ 'sanitize_callback' => ''
306
+ )
307
+ );
308
+ $wp_customize->add_control( 'wcast_outfordelivery_email_settings[wcast_outfordelivery_hide_shipping_item_price]',
309
+ array(
310
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
311
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
312
+ 'section' => 'trackship_shipment_status_email',
313
+ 'type' => 'checkbox',
314
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
315
+ )
316
  );
317
 
318
  // Display Shipment Provider image/thumbnail
366
  }
367
  }
368
 
369
+ public function active_callback_only_show_order_details(){
370
+
371
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
372
+ $show_order_details = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_show_order_details',$this->defaults['wcast_outfordelivery_show_order_details']);
373
+
374
+ if ( wcast_outfordelivery_customizer_email::is_own_preview_request() && $show_order_details ) {
375
+ return true;
376
+ } else{
377
+ return false;
378
+ }
379
+ }
380
+
381
  /**
382
  * Set up preview
383
  *
412
 
413
  $email_content = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_email_content',$this->defaults['wcast_outfordelivery_email_content']);
414
 
415
+ $wcast_show_order_details = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_show_order_details',$this->defaults['wcast_outfordelivery_show_order_details']);
416
+
417
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_hide_shipping_item_price',$this->defaults['wcast_outfordelivery_hide_shipping_item_price']);
418
 
419
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_outfordelivery_email_settings','wcast_outfordelivery_show_shipping_address',$this->defaults['wcast_outfordelivery_show_shipping_address']);
420
 
478
  wc_get_template(
479
  'emails/wcast-email-order-details.php', array(
480
  'order' => $order,
481
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
482
  'sent_to_admin' => $sent_to_admin,
483
  'plain_text' => $plain_text,
484
  'email' => $email,
includes/customizer/class-wc-returntosender-email-customizer.php CHANGED
@@ -113,7 +113,7 @@ class wcast_returntosender_customizer_email {
113
  * @return string
114
  */
115
  public static function get_email_settings_page_url($return_tab) {
116
- return admin_url( 'admin.php?page=trackship-for-woocommerce&tab='.$return_tab );
117
  }
118
 
119
  /**
@@ -127,9 +127,9 @@ class wcast_returntosender_customizer_email {
127
  'wcast_enable_returntosender_email' => '',
128
  'wcast_returntosender_email_to' => '{customer_email}',
129
  'wcast_returntosender_show_tracking_details' => '',
130
- 'wcast_returntosender_show_order_details' => '',
131
- 'wcast_returntosender_show_billing_address' => '',
132
- 'wcast_returntosender_show_shipping_address' => '',
133
  'wcast_returntosender_email_code_block' => '',
134
  );
135
 
@@ -292,6 +292,25 @@ class wcast_returntosender_customizer_email {
292
  'type' => 'checkbox',
293
  'active_callback' => array( $this, 'active_callback' ),
294
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  );
296
 
297
  // Display Shipment Provider image/thumbnail
@@ -343,6 +362,18 @@ class wcast_returntosender_customizer_email {
343
  } else{
344
  return false;
345
  }
 
 
 
 
 
 
 
 
 
 
 
 
346
  }
347
  /**
348
  * Set up preview
@@ -380,9 +411,9 @@ class wcast_returntosender_customizer_email {
380
 
381
  $wcast_show_tracking_details = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_tracking_details',$this->defaults['wcast_returntosender_show_tracking_details']);
382
 
383
- $wcast_show_order_details = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_order_details',$this->defaults['wcast_returntosender_show_order_details']);
384
-
385
- $wcast_show_billing_address = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_billing_address',$this->defaults['wcast_returntosender_show_billing_address']);
386
 
387
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_shipping_address',$this->defaults['wcast_returntosender_show_shipping_address']);
388
 
@@ -446,6 +477,7 @@ class wcast_returntosender_customizer_email {
446
  wc_get_template(
447
  'emails/wcast-email-order-details.php', array(
448
  'order' => $order,
 
449
  'sent_to_admin' => $sent_to_admin,
450
  'plain_text' => $plain_text,
451
  'email' => $email,
@@ -454,20 +486,7 @@ class wcast_returntosender_customizer_email {
454
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
455
  );
456
  $message .= ob_get_clean();
457
- }
458
-
459
- if($wcast_show_billing_address == 1){
460
- ob_start();
461
- wc_get_template(
462
- 'emails/wcast-billing-email-addresses.php', array(
463
- 'order' => $order,
464
- 'sent_to_admin' => $sent_to_admin,
465
- ),
466
- 'woocommerce-advanced-shipment-tracking/',
467
- wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
468
- );
469
- $message .= ob_get_clean();
470
- }
471
 
472
  if($wcast_show_shipping_address == 1){
473
  ob_start();
113
  * @return string
114
  */
115
  public static function get_email_settings_page_url($return_tab) {
116
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
117
  }
118
 
119
  /**
127
  'wcast_enable_returntosender_email' => '',
128
  'wcast_returntosender_email_to' => '{customer_email}',
129
  'wcast_returntosender_show_tracking_details' => '',
130
+ 'wcast_returntosender_show_order_details' => 1,
131
+ 'wcast_returntosender_hide_shipping_item_price' => 1,
132
+ 'wcast_returntosender_show_shipping_address' => 1,
133
  'wcast_returntosender_email_code_block' => '',
134
  );
135
 
292
  'type' => 'checkbox',
293
  'active_callback' => array( $this, 'active_callback' ),
294
  )
295
+ );
296
+
297
+ // Display Shipment Provider image/thumbnail
298
+ $wp_customize->add_setting( 'wcast_returntosender_email_settings[wcast_returntosender_hide_shipping_item_price]',
299
+ array(
300
+ 'default' => $this->defaults['wcast_returntosender_hide_shipping_item_price'],
301
+ 'transport' => 'refresh',
302
+ 'type' => 'option',
303
+ 'sanitize_callback' => ''
304
+ )
305
+ );
306
+ $wp_customize->add_control( 'wcast_returntosender_email_settings[wcast_returntosender_hide_shipping_item_price]',
307
+ array(
308
+ 'label' => __( 'Hide Shipping Items Price', 'woo-advanced-shipment-tracking' ),
309
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
310
+ 'section' => 'trackship_shipment_status_email',
311
+ 'type' => 'checkbox',
312
+ 'active_callback' => array( $this, 'active_callback_only_show_order_details' ),
313
+ )
314
  );
315
 
316
  // Display Shipment Provider image/thumbnail
362
  } else{
363
  return false;
364
  }
365
+ }
366
+
367
+ public function active_callback_only_show_order_details(){
368
+
369
+ $ast = new WC_Advanced_Shipment_Tracking_Actions;
370
+ $show_order_details = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_order_details',$this->defaults['wcast_returntosender_show_order_details']);
371
+
372
+ if ( wcast_returntosender_customizer_email::is_own_preview_request() && $show_order_details ) {
373
+ return true;
374
+ } else{
375
+ return false;
376
+ }
377
  }
378
  /**
379
  * Set up preview
411
 
412
  $wcast_show_tracking_details = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_tracking_details',$this->defaults['wcast_returntosender_show_tracking_details']);
413
 
414
+ $wcast_show_order_details = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_order_details',$this->defaults['wcast_returntosender_show_order_details']);
415
+
416
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_hide_shipping_item_price',$this->defaults['wcast_returntosender_hide_shipping_item_price']);
417
 
418
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_returntosender_email_settings','wcast_returntosender_show_shipping_address',$this->defaults['wcast_returntosender_show_shipping_address']);
419
 
477
  wc_get_template(
478
  'emails/wcast-email-order-details.php', array(
479
  'order' => $order,
480
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
481
  'sent_to_admin' => $sent_to_admin,
482
  'plain_text' => $plain_text,
483
  'email' => $email,
486
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
487
  );
488
  $message .= ob_get_clean();
489
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
490
 
491
  if($wcast_show_shipping_address == 1){
492
  ob_start();
includes/customizer/class-wcast-customizer.php CHANGED
@@ -50,7 +50,7 @@ class WC_Advanced_Shipment_Tracking_Customizer {
50
 
51
  $wp_customize->add_section( 'trackship_shipment_status_email',
52
  array(
53
- 'title' => __( 'TrackShip Email Notifications', 'woo-advanced-shipment-tracking' ),
54
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
55
  )
56
  );
50
 
51
  $wp_customize->add_section( 'trackship_shipment_status_email',
52
  array(
53
+ 'title' => __( 'Shipping and Delivery Emails', 'woo-advanced-shipment-tracking' ),
54
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
55
  )
56
  );
includes/trackship-email-manager.php CHANGED
@@ -38,7 +38,9 @@ class WC_TrackShip_Email_Manager {
38
 
39
  $email_content = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_email_content',$wcast_status_customizer_email->defaults['wcast_'.$status.'_email_content']);
40
 
41
- $wcast_show_order_details = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_show_order_details','');
 
 
42
 
43
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_show_shipping_address','');
44
 
@@ -90,6 +92,7 @@ class WC_TrackShip_Email_Manager {
90
  wc_get_template(
91
  'emails/wcast-email-order-details.php', array(
92
  'order' => $order,
 
93
  'sent_to_admin' => $sent_to_admin,
94
  'plain_text' => $plain_text,
95
  'email' => '',
@@ -97,7 +100,7 @@ class WC_TrackShip_Email_Manager {
97
  'woocommerce-advanced-shipment-tracking/',
98
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
99
  );
100
- $message .= ob_get_clean();
101
  }
102
 
103
  if($wcast_show_shipping_address == 1){
@@ -161,6 +164,8 @@ class WC_TrackShip_Email_Manager {
161
 
162
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_shipping_address',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_shipping_address']);
163
 
 
 
164
  $sent_to_admin = false;
165
  $plain_text = false;
166
 
@@ -211,8 +216,9 @@ class WC_TrackShip_Email_Manager {
211
  wc_get_template(
212
  'emails/wcast-email-order-details.php', array(
213
  'order' => $order,
 
214
  'sent_to_admin' => $sent_to_admin,
215
- 'plain_text' => $plain_text,
216
  'email' => '',
217
  ),
218
  'woocommerce-advanced-shipment-tracking/',
38
 
39
  $email_content = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_email_content',$wcast_status_customizer_email->defaults['wcast_'.$status.'_email_content']);
40
 
41
+ $wcast_show_order_details = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_show_order_details',$wcast_status_customizer_email->defaults['wcast_'.$status.'_show_order_details']);
42
+
43
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_hide_shipping_item_price',$wcast_status_customizer_email->defaults['wcast_'.$status.'_hide_shipping_item_price']);
44
 
45
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_'.$status.'_email_settings','wcast_'.$status.'_show_shipping_address','');
46
 
92
  wc_get_template(
93
  'emails/wcast-email-order-details.php', array(
94
  'order' => $order,
95
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
96
  'sent_to_admin' => $sent_to_admin,
97
  'plain_text' => $plain_text,
98
  'email' => '',
100
  'woocommerce-advanced-shipment-tracking/',
101
  wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
102
  );
103
+ $message .= ob_get_clean();
104
  }
105
 
106
  if($wcast_show_shipping_address == 1){
164
 
165
  $wcast_show_shipping_address = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_show_shipping_address',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_shipping_address']);
166
 
167
+ $hide_shipping_item_price = $ast->get_option_value_from_array('wcast_delivered_email_settings','wcast_delivered_status_hide_shipping_item_price',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_hide_shipping_item_price']);
168
+
169
  $sent_to_admin = false;
170
  $plain_text = false;
171
 
216
  wc_get_template(
217
  'emails/wcast-email-order-details.php', array(
218
  'order' => $order,
219
+ 'hide_shipping_item_price' => $hide_shipping_item_price,
220
  'sent_to_admin' => $sent_to_admin,
221
+ 'plain_text' => $plain_text,
222
  'email' => '',
223
  ),
224
  'woocommerce-advanced-shipment-tracking/',
includes/views/admin_options_addons.php CHANGED
@@ -4,6 +4,14 @@
4
  */
5
  $more_plugins = array(
6
  0 => array(
 
 
 
 
 
 
 
 
7
  'title' => 'Advanced Local Pickup Pro',
8
  'description' => 'The Advanced Local Pickup (ALP) helps you manage the local pickup orders workflow more conveniently by extending the WooCommerce Local Pickup shipping method. The Pro you set up multiple pickup locations, , split the business hours, apply discounts by pickup location, display local pickup message on the products pages, allow customers to choose pickup location per product, force products to be local pickup only and more…',
9
  'image' => 'alp-icon.png',
@@ -11,23 +19,23 @@ $more_plugins = array(
11
  'file' => 'advanced-local-pickup-pro/advanced-local-pickup-pro.php',
12
  'price' => 79,
13
  ),
14
- 1 => array(
15
  'title' => 'SMS for WooCommerce',
16
  'description' => 'Keep your customers informed by sending them automated SMS text messages with order & delivery updates. You can send SMS notifications to customers when the order status is updated or when the shipment is out for delivery and more…',
17
- 'image' => 'smswoo-addons-icon.jpg',
18
  'url' => 'https://www.zorem.com/product/sms-for-woocommerce/',
19
  'file' => 'sms-for-woocommerce/sms-for-woocommerce.php',
20
- 'price' => 59,
21
- ),
22
- 2 => array(
23
- 'title' => 'Country Based Restrictions Pro',
24
- 'description' => 'The country-based restrictions plugin by zorem works by the WooCommerce Geolocation or the shipping country added by the customer and allows you to restrict products on your store to sell or not to sell to specific countries.',
25
- 'image' => 'cbr-icon.png',
26
- 'url' => 'https://www.zorem.com/product/country-based-restriction-pro/',
27
- 'file' => 'country-base-restrictions-pro-addon/country-base-restrictions-pro-addon.php',
28
- 'price' => 59,
29
  ),
30
  3 => array(
 
 
 
 
 
 
 
 
31
  'title' => 'Advanced Order Status Manager',
32
  'description' => 'The Advanced Order Status Manager allows store owners to manage the WooCommerce orders statuses, create, edit, and delete custom Custom Order Statuses and integrate them into the WooCommerce orders flow.',
33
  'image' => 'AOSM-addons-icon.jpg',
@@ -35,22 +43,14 @@ $more_plugins = array(
35
  'file' => 'advanced-order-status-manager/advanced-order-status-manager.php',
36
  'price' => 49,
37
  ),
38
- 4 => array(
39
  'title' => 'Sales Report Email Pro',
40
  'description' => 'The Sales Report Email Pro will help know how well your store is performing and how your products are selling by sending you a daily, weekly, or monthly sales report by email, directly from your WooCommerce store.',
41
  'image' => 'sre-icon.png',
42
  'url' => 'https://www.zorem.com/product/sales-report-email-for-woocommerce/',
43
  'file' => 'sales-report-email-pro-addon/sales-report-email-pro-addon.php',
44
  'price' => 59,
45
- ),
46
- 5 => array(
47
- 'title' => 'Sales Report By Country',
48
- 'description' => 'This plugin simply adds a report tab to display sales report by country WooCommerce Reports. The plugin adds an additional report tab which display sales report by country. You’ll find this report available in WooCommerce reports section.',
49
- 'image' => 'src-icon.png',
50
- 'url' => 'https://www.zorem.com/product/woocommerce-sales-report-by-country/',
51
- 'file' => 'woo-sales-by-country-reports/woocommerce-sales-by-country-report.php',
52
- 'price' => '',
53
- ),
54
  );
55
 
56
  $ast_paid_addons = array(
@@ -118,20 +118,43 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
118
  } elseif ( class_exists( 'paypal_tracking_add_on' ) ) {
119
  $show_addons_tab = true;
120
  }
121
-
122
  if ( $show_addons_tab) { ?>
123
- <input id="tab_addons" type="radio" name="inner_tabs" class="inner_tab_input" data-tab="addons" checked="">
124
  <label for="tab_addons" class="inner_tab_label"><?php _e( 'Add-ons', 'woo-advanced-shipment-tracking' ); ?></label>
125
 
126
- <input id="tab_license" type="radio" name="inner_tabs" class="inner_tab_input" data-tab="license">
127
  <label for="tab_license" class="inner_tab_label"><?php _e( 'License', 'woo-advanced-shipment-tracking' ); ?></label>
128
  <?php } ?>
129
 
130
  <section id="content_tab_addons" class="<?php if ( $show_addons_tab ) { ?>inner_tab_section<?php } ?>">
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  <div class="plugins_section free_plugin_section">
133
  <?php foreach($ast_paid_addons as $plugin){ ?>
134
- <div class="single_plugin">
135
  <div class="free_plugin_inner">
136
  <div class="paid_plugin_image">
137
  <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/<?php echo $plugin['image']; ?>">
@@ -143,7 +166,7 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
143
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
144
  <button type="button" class="button button button-primary btn_green2">Active</button>
145
  <?php } else{ ?>
146
- <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php _e('From', 'woo-advanced-shipment-tracking'); ?> $<?php echo $plugin['price']; ?></a>
147
  <?php } ?>
148
  </div>
149
  </div>
@@ -152,29 +175,28 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
152
  </div>
153
 
154
  <div class="plugins_section free_plugin_section">
155
- <?php foreach($ast_addons as $plugin){ ?>
156
- <div class="single_plugin">
157
  <div class="free_plugin_inner">
158
- <div class="plugin_image">
159
  <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/<?php echo $plugin['image']; ?>">
160
  </div>
161
- <div class="plugin_description">
162
  <h3 class="plugin_title"><?php echo $plugin['title']; ?></h3>
163
  <p><?php echo $plugin['description']; ?></p>
164
  <?php
165
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
166
  <button type="button" class="button button button-primary btn_green2">Active</button>
167
  <?php } else{ ?>
168
- <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php _e('From', 'woo-advanced-shipment-tracking'); ?> $<?php echo $plugin['price']; ?></a>
169
- <?php } ?>
170
  </div>
171
- </div>
172
  </div>
173
- <?php } ?>
174
- </div>
175
-
176
 
177
- <div class="plugins_section zorem_plugin_section">
178
  <div class="addons_page_header">
179
  <h2 class="addons_page_title">WooCommerce plugins by zorem</h2>
180
  <p>Improve your store, automate your workflow and save time managing your store</p>
@@ -193,14 +215,14 @@ $wc_ast_api_key = get_option('wc_ast_api_key');
193
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
194
  <button type="button" class="button button button-primary btn_green2">Active</button>
195
  <?php } else{ ?>
196
- <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php if($plugin['price'] == ''){ echo 'Free'; } else{ _e('From', 'woo-advanced-shipment-tracking'); ?> $<?php echo $plugin['price']; } ?></a>
197
  <?php } ?>
198
  </div>
199
  </div>
200
  </div>
201
  <?php } ?>
202
  </div>
203
- </div>
204
  </section>
205
 
206
  <section id="content_tab_license" class="inner_tab_section">
4
  */
5
  $more_plugins = array(
6
  0 => array(
7
+ 'title' => 'Country Based Restrictions Pro',
8
+ 'description' => 'The country-based restrictions plugin by zorem works by the WooCommerce Geolocation or the shipping country added by the customer and allows you to restrict products on your store to sell or not to sell to specific countries.',
9
+ 'image' => 'cbr-icon.png',
10
+ 'url' => 'https://www.zorem.com/product/country-based-restriction-pro/',
11
+ 'file' => 'country-base-restrictions-pro-addon/country-base-restrictions-pro-addon.php',
12
+ 'price' => 79,
13
+ ),
14
+ 1 => array(
15
  'title' => 'Advanced Local Pickup Pro',
16
  'description' => 'The Advanced Local Pickup (ALP) helps you manage the local pickup orders workflow more conveniently by extending the WooCommerce Local Pickup shipping method. The Pro you set up multiple pickup locations, , split the business hours, apply discounts by pickup location, display local pickup message on the products pages, allow customers to choose pickup location per product, force products to be local pickup only and more…',
17
  'image' => 'alp-icon.png',
19
  'file' => 'advanced-local-pickup-pro/advanced-local-pickup-pro.php',
20
  'price' => 79,
21
  ),
22
+ 2 => array(
23
  'title' => 'SMS for WooCommerce',
24
  'description' => 'Keep your customers informed by sending them automated SMS text messages with order & delivery updates. You can send SMS notifications to customers when the order status is updated or when the shipment is out for delivery and more…',
25
+ 'image' => 'smswoo-icon.png',
26
  'url' => 'https://www.zorem.com/product/sms-for-woocommerce/',
27
  'file' => 'sms-for-woocommerce/sms-for-woocommerce.php',
28
+ 'price' => 79,
 
 
 
 
 
 
 
 
29
  ),
30
  3 => array(
31
+ 'title' => 'Customer Email Verification Pro',
32
+ 'description' => 'The Customer Email Verification helps WooCommerce store owners to reduce registration and spam orders by requiring customers to verify their email address when they register an account or before they can place an order on your store.',
33
+ 'image' => 'cev-icon.png',
34
+ 'url' => 'https://www.zorem.com/product/customer-verification-for-woocommerce/',
35
+ 'file' => 'customer-email-verification-pro/customer-email-verification-pro.php',
36
+ 'price' => 79,
37
+ ),
38
+ 4 => array(
39
  'title' => 'Advanced Order Status Manager',
40
  'description' => 'The Advanced Order Status Manager allows store owners to manage the WooCommerce orders statuses, create, edit, and delete custom Custom Order Statuses and integrate them into the WooCommerce orders flow.',
41
  'image' => 'AOSM-addons-icon.jpg',
43
  'file' => 'advanced-order-status-manager/advanced-order-status-manager.php',
44
  'price' => 49,
45
  ),
46
+ 5 => array(
47
  'title' => 'Sales Report Email Pro',
48
  'description' => 'The Sales Report Email Pro will help know how well your store is performing and how your products are selling by sending you a daily, weekly, or monthly sales report by email, directly from your WooCommerce store.',
49
  'image' => 'sre-icon.png',
50
  'url' => 'https://www.zorem.com/product/sales-report-email-for-woocommerce/',
51
  'file' => 'sales-report-email-pro-addon/sales-report-email-pro-addon.php',
52
  'price' => 59,
53
+ ),
 
 
 
 
 
 
 
 
54
  );
55
 
56
  $ast_paid_addons = array(
118
  } elseif ( class_exists( 'paypal_tracking_add_on' ) ) {
119
  $show_addons_tab = true;
120
  }
121
+ $addons = isset( $_GET['addons'] ) ? sanitize_text_field($_GET['addons']) : 'addons';
122
  if ( $show_addons_tab) { ?>
123
+ <input id="tab_addons" type="radio" name="inner_tabs" class="inner_tab_input" data-addons="addons" <?php if($addons == 'addons'){ echo 'checked'; } ?>>
124
  <label for="tab_addons" class="inner_tab_label"><?php _e( 'Add-ons', 'woo-advanced-shipment-tracking' ); ?></label>
125
 
126
+ <input id="tab_license" type="radio" name="inner_tabs" class="inner_tab_input" data-addons="license" <?php if($addons == 'license'){ echo 'checked'; } ?>>
127
  <label for="tab_license" class="inner_tab_label"><?php _e( 'License', 'woo-advanced-shipment-tracking' ); ?></label>
128
  <?php } ?>
129
 
130
  <section id="content_tab_addons" class="<?php if ( $show_addons_tab ) { ?>inner_tab_section<?php } ?>">
131
 
132
+ <div class="section-content trackship_addon_section">
133
+ <div class="ast-row">
134
+ <div class="as-col-6">
135
+ <div class="ts_col_inner ast_ts_landing_banner">
136
+ <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/trackship-ast-banner.png">
137
+ </div>
138
+ </div>
139
+ <div class="as-col-6">
140
+ <div class="ts_col_inner">
141
+ <div class="ts_addon_logo_section">
142
+ <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/trackship-logo.png">
143
+ </div>
144
+ <h1 class="ts_landing_header">Your Post-Shipping & Delivery Autopilot</h1>
145
+ <p class="ts_landing_description">Trackship is a Multi-Carrier Shipment Tracking API that seamlessly integrates into your WooCommerce store and auto-tracks your shipments, automates your orders workflow, reduces the time spent on customer service and lets you provide a superior post-purchase experience to your customers.</p>
146
+ <?php if($wc_ast_api_key){ ?>
147
+ <a href="https://trackship.info/my-account/?utm_source=wpadmin&utm_medium=sidebar&utm_campaign=upgrade" class="button-primary btn_green2 btn_large" target="_blank" ><?php _e( 'Account Dashboard', 'woo-advanced-shipment-tracking' ); ?></a>
148
+ <?php } else{ ?>
149
+ <a href="https://trackship.info/?utm_source=wpadmin&utm_campaign=tspage" target="_blank" class="button-primary btn_green2 btn_large"><span><?php _e('Start your free trial', 'woo-advanced-shipment-tracking'); ?></span></a>
150
+ <?php } ?>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
  <div class="plugins_section free_plugin_section">
156
  <?php foreach($ast_paid_addons as $plugin){ ?>
157
+ <div class="single_plugin as-col-6">
158
  <div class="free_plugin_inner">
159
  <div class="paid_plugin_image">
160
  <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/<?php echo $plugin['image']; ?>">
166
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
167
  <button type="button" class="button button button-primary btn_green2">Active</button>
168
  <?php } else{ ?>
169
+ <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php _e('More Info', 'woo-advanced-shipment-tracking'); ?></a>
170
  <?php } ?>
171
  </div>
172
  </div>
175
  </div>
176
 
177
  <div class="plugins_section free_plugin_section">
178
+ <?php foreach($more_plugins as $plugin){ ?>
179
+ <div class="single_plugin as-col-4">
180
  <div class="free_plugin_inner">
181
+ <div class="paid_plugin_image">
182
  <img src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/images/<?php echo $plugin['image']; ?>">
183
  </div>
184
+ <div class="paid_plugin_description">
185
  <h3 class="plugin_title"><?php echo $plugin['title']; ?></h3>
186
  <p><?php echo $plugin['description']; ?></p>
187
  <?php
188
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
189
  <button type="button" class="button button button-primary btn_green2">Active</button>
190
  <?php } else{ ?>
191
+ <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php _e('More Info', 'woo-advanced-shipment-tracking'); ?></a>
192
+ <?php } ?>
193
  </div>
194
+ </div>
195
  </div>
196
+ <?php } ?>
197
+ </div>
 
198
 
199
+ <!--div class="plugins_section zorem_plugin_section">
200
  <div class="addons_page_header">
201
  <h2 class="addons_page_title">WooCommerce plugins by zorem</h2>
202
  <p>Improve your store, automate your workflow and save time managing your store</p>
215
  if ( is_plugin_active( $plugin['file'] ) ) { ?>
216
  <button type="button" class="button button button-primary btn_green2">Active</button>
217
  <?php } else{ ?>
218
+ <a href="<?php echo $plugin['url']; ?>" class="button button-primary btn_ast2" target="blank"><?php _e('More Info', 'woo-advanced-shipment-tracking'); ?></a>
219
  <?php } ?>
220
  </div>
221
  </div>
222
  </div>
223
  <?php } ?>
224
  </div>
225
+ </div-->
226
  </section>
227
 
228
  <section id="content_tab_license" class="inner_tab_section">
includes/views/admin_options_settings.php CHANGED
@@ -15,9 +15,9 @@
15
  <h3 style=""><?php _e( 'General Settings', 'woo-advanced-shipment-tracking' ); ?></h3>
16
  </td>
17
  <td>
18
- <div class="settings_ul_submit">
19
- <button name="save" class="button-primary woocommerce-save-button btn_ast2" type="submit" value="Save changes"><?php _e( 'Save Changes', 'woo-advanced-shipment-tracking' ); ?></button>
20
- <div class="spinner"></div>
21
  <?php wp_nonce_field( 'wc_ast_settings_form', 'wc_ast_settings_form_nonce' );?>
22
  <input type="hidden" name="action" value="wc_ast_settings_form_update">
23
  </div>
15
  <h3 style=""><?php _e( 'General Settings', 'woo-advanced-shipment-tracking' ); ?></h3>
16
  </td>
17
  <td>
18
+ <div class="settings_ul_submit">
19
+ <div class="spinner"></div>
20
+ <button name="save" class="button-primary woocommerce-save-button btn_ast2" type="submit" value="Save changes"><?php _e( 'Save Changes', 'woo-advanced-shipment-tracking' ); ?></button>
21
  <?php wp_nonce_field( 'wc_ast_settings_form', 'wc_ast_settings_form_nonce' );?>
22
  <input type="hidden" name="action" value="wc_ast_settings_form_update">
23
  </div>
includes/views/admin_options_shipping_provider.php CHANGED
@@ -103,7 +103,7 @@ if(isset($_GET['open']) && $_GET['open'] == 'synch_providers'){ ?>
103
  <div class="form-field api_provider_name_container">
104
  <label><?php _e( 'Custom API name', 'woo-advanced-shipment-tracking' ); ?> <span class="woocommerce-help-tip tipTip" title="<?php _e( "Add API name aliases to map Shipping providers names with the provider names that are updated in the shipment tracking API by external shipping services", 'woo-advanced-shipment-tracking' ); ?>"></span></label>
105
  <div class="api_provider_div">
106
- <input type="text" name="api_provider_name[]" class="api_provider_name" value="" placeholder="<?php _e( 'API Name', 'woo-advanced-shipment-tracking' ); ?>" readonly="true">
107
  <!--span class="dashicons dashicons-insert woocommerce-help-tip tipTip add_more_api_provider" title="<?php _e( "Add API Name alias", 'woo-advanced-shipment-tracking' ); ?>"></span-->
108
  </div>
109
  </div>
103
  <div class="form-field api_provider_name_container">
104
  <label><?php _e( 'Custom API name', 'woo-advanced-shipment-tracking' ); ?> <span class="woocommerce-help-tip tipTip" title="<?php _e( "Add API name aliases to map Shipping providers names with the provider names that are updated in the shipment tracking API by external shipping services", 'woo-advanced-shipment-tracking' ); ?>"></span></label>
105
  <div class="api_provider_div">
106
+ <input type="text" name="api_provider_name[]" class="api_provider_name" value="" placeholder="<?php _e( 'API Name', 'woo-advanced-shipment-tracking' ); ?>">
107
  <!--span class="dashicons dashicons-insert woocommerce-help-tip tipTip add_more_api_provider" title="<?php _e( "Add API Name alias", 'woo-advanced-shipment-tracking' ); ?>"></span-->
108
  </div>
109
  </div>
includes/views/admin_status_notifications.php CHANGED
@@ -19,11 +19,14 @@
19
  $wcast_enable_availableforpickup_email = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_enable_availableforpickup_email','');
20
 
21
  $wcast_enable_late_shipments_admin_email = $ast->get_option_value_from_array('late_shipments_email_settings','wcast_enable_late_shipments_admin_email','');
 
 
22
  ?>
23
- <input id="tab_email_notifications" type="radio" name="ts_notification_tabs" class="inner_tab_input" checked="">
 
24
  <label for="tab_email_notifications" class="inner_tab_label ts_tabs_label"><?php _e( 'Email Notifications', 'woo-advanced-shipment-tracking' ); ?></label>
25
 
26
- <input id="tab_sms_notifications" type="radio" name="ts_notification_tabs" class="inner_tab_input">
27
  <label for="tab_sms_notifications" class="inner_tab_label ts_tabs_label"><?php _e( 'SMS Notifications', 'woo-advanced-shipment-tracking' ); ?></label>
28
 
29
  <section class="inner_tab_section shipment-status-email-section">
@@ -39,7 +42,7 @@
39
  <button class="button button-primary shipment-status-label in-transit"><?php _e('In Transit', 'woo-advanced-shipment-tracking'); ?></button>
40
  </td>
41
  <td class="forminp">
42
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_intransit_customizer_email::get_customizer_url('trackship_shipment_status_email','in_transit','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
43
  </td>
44
  </tr>
45
  <tr class="<?php if($wcast_enable_onhold_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -52,7 +55,7 @@
52
  <button class="button button-primary shipment-status-label on-hold"><?php _e('On Hold', 'woo-advanced-shipment-tracking'); ?></button>
53
  </td>
54
  <td class="forminp">
55
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_onhold_customizer_email::get_customizer_url('trackship_shipment_status_email','on_hold','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
56
  </td>
57
  </tr>
58
  <tr class="<?php if($wcast_enable_returntosender_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -65,7 +68,7 @@
65
  <button class="button button-primary shipment-status-label return-to-sender"><?php _e('Return To Sender', 'woo-advanced-shipment-tracking'); ?></button>
66
  </td>
67
  <td class="forminp">
68
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('trackship_shipment_status_email','return_to_sender','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
69
  </td>
70
  </tr>
71
  <tr class="<?php if($wcast_enable_availableforpickup_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -78,7 +81,7 @@
78
  <button class="button button-primary shipment-status-label available-for-pickup"><?php _e('Available For Pickup', 'woo-advanced-shipment-tracking'); ?></button>
79
  </td>
80
  <td class="forminp">
81
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('trackship_shipment_status_email','available_for_pickup','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
82
  </td>
83
  </tr>
84
  <tr class="<?php if($wcast_enable_outfordelivery_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -91,7 +94,7 @@
91
  <button class="button button-primary shipment-status-label out-for-delivery"><?php _e('Out For Delivery', 'woo-advanced-shipment-tracking'); ?></button>
92
  </td>
93
  <td class="forminp">
94
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('trackship_shipment_status_email','out_for_delivery','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
95
  </td>
96
  </tr>
97
  <tr class="<?php if( $wcast_enable_delivered_status_email == 1 ){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -104,7 +107,7 @@
104
  <button class="button button-primary shipment-status-label delivered-status"><?php _e('Delivered', 'woo-advanced-shipment-tracking'); ?></button>
105
  </td>
106
  <td class="forminp">
107
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_delivered_customizer_email::get_customizer_url('trackship_shipment_status_email','delivered','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
108
  </td>
109
  </tr>
110
  <tr class="<?php if($wcast_enable_failure_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -117,11 +120,128 @@
117
  <button class="button button-primary shipment-status-label failed-attempt"><?php _e('Failed Attempt', 'woo-advanced-shipment-tracking'); ?></button>
118
  </td>
119
  <td class="forminp">
120
- <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_failure_customizer_email::get_customizer_url('trackship_shipment_status_email','failure','notifications') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
121
  </td>
122
  </tr>
123
  </tbody>
124
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </section>
126
  <section class="inner_tab_section shipment-status-sms-section">
127
  <?php
@@ -142,127 +262,6 @@
142
  do_action( 'shipment_status_sms_section' );
143
  ?>
144
  </section>
145
- </div>
146
-
147
- <?php do_action( 'after_shipment_status_email_notifications' ); ?>
148
- <form method="post" id="trackship_late_shipments_form" action="" enctype="multipart/form-data">
149
- <div class="outer_form_table">
150
- <table class="form-table heading-table">
151
- <tbody>
152
- <tr valign="top">
153
- <td>
154
- <h3 style=""><?php _e( 'Admin Notifications', 'woo-advanced-shipment-tracking' ); ?></h3>
155
- </td>
156
- </tr>
157
- </tbody>
158
- </table>
159
- <table class="form-table shipment-status-email-table">
160
- <tbody>
161
- <tr class="<?php if($wcast_enable_late_shipments_admin_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
162
- <td class="forminp status-label-column">
163
- <span class="shipment_status_toggle">
164
- <input type="hidden" name="wcast_enable_late_shipments_admin_email" value="0"/>
165
- <input class="ast-tgl ast-tgl-flat" id="wcast_enable_late_shipments_admin_email" name="wcast_enable_late_shipments_admin_email" data-settings="late_shipments_email_settings" type="checkbox" <?php if($wcast_enable_late_shipments_admin_email == 1) { echo 'checked'; } ?> value="1"/>
166
- <label class="ast-tgl-btn ast-tgl-btn-green" for="wcast_enable_late_shipments_admin_email"></label>
167
- </span>
168
- <button class="button button-primary shipment-status-label late-shipments"><?php _e('Late Shipments', 'woo-advanced-shipment-tracking'); ?></button>
169
- </td>
170
- <td class="forminp">
171
- <a class="edit_customizer_a late_shipments_a button-primary btn_ts_transparent" href="javascript:void(0);"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
172
- </td>
173
- </tr>
174
- </tbody>
175
- </table>
176
- <?php
177
- $late_shipments_email_settings = get_option('late_shipments_email_settings');
178
- $wcast_late_shipments_days = isset( $late_shipments_email_settings['wcast_late_shipments_days'] ) ? $late_shipments_email_settings['wcast_late_shipments_days'] : '';
179
- $wcast_late_shipments_email_to = isset( $late_shipments_email_settings['wcast_late_shipments_email_to'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_to'] : '';
180
- $wcast_late_shipments_email_subject = isset( $late_shipments_email_settings['wcast_late_shipments_email_subject'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_subject'] : '';
181
- $wcast_late_shipments_email_content = isset( $late_shipments_email_settings['wcast_late_shipments_email_content'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_content'] : '';
182
- $wcast_late_shipments_trigger_alert = isset( $late_shipments_email_settings['wcast_late_shipments_trigger_alert'] ) ? $late_shipments_email_settings['wcast_late_shipments_trigger_alert'] : '';
183
- $wcast_late_shipments_daily_digest_time = isset( $late_shipments_email_settings['wcast_late_shipments_daily_digest_time'] ) ? $late_shipments_email_settings['wcast_late_shipments_daily_digest_time'] : ''; ?>
184
-
185
-
186
- <table class="form-table late-shipments-email-content-table hide_table">
187
- <tr class="">
188
- <th scope="row" class="titledesc">
189
- <label for=""><?php _e('Late Shipment Days', 'woo-advanced-shipment-tracking'); ?></label>
190
- </th>
191
- <td class="forminp">
192
- <fieldset>
193
- <input class="input-text" type="number" name="wcast_late_shipments_days" id="wcast_late_shipments_days" min="1" value="<?php echo $wcast_late_shipments_days; ?>">
194
- </fieldset>
195
- </td>
196
- </tr>
197
- <tr class="">
198
- <th scope="row" class="titledesc">
199
- <label for=""><?php _e('Recipient(s)', 'woocommerce'); ?></label>
200
- </th>
201
- <td class="forminp">
202
- <fieldset>
203
- <input class="input-text regular-input " type="text" name="wcast_late_shipments_email_to" id="wcast_late_shipments_email_to" placeholder="<?php _e('E.g. {admin_email}, admin@example.org', 'woo-advanced-shipment-tracking'); ?>" value="<?php echo $wcast_late_shipments_email_to; ?>">
204
- </fieldset>
205
- </td>
206
- </tr>
207
- <tr class="">
208
- <th scope="row" class="titledesc">
209
- <label for=""><?php _e('Subject', 'woocommerce'); ?></label>
210
- </th>
211
- <td class="forminp">
212
- <fieldset>
213
- <input class="input-text regular-input " type="text" name="wcast_late_shipments_email_subject" id="wcast_late_shipments_email_subject" placeholder="<?php _e('Late shipment for order #{order_number}', 'woo-advanced-shipment-tracking'); ?>" value="<?php echo $wcast_late_shipments_email_subject; ?>">
214
- </fieldset>
215
- </td>
216
- </tr>
217
- <tr class="">
218
- <th scope="row" class="titledesc">
219
- <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
220
- </th>
221
- <td class="forminp">
222
- <fieldset>
223
- <textarea name="wcast_late_shipments_email_content" id="wcast_late_shipments_email_content" placeholder="<?php _e('This order was shipped {shipment_length} days ago, the shipment status is {shipment_status} and its est. delivery date is {est_delivery_date}.', 'woo-advanced-shipment-tracking'); ?>"><?php echo $wcast_late_shipments_email_content; ?></textarea>
224
- </fieldset>
225
- <span><?php _e('Available variables:', 'woo-advanced-shipment-tracking'); ?> {site_title} {admin_email} {customer_first_name} {customer_last_name} {customer_company_name} {customer_username} {order_number} {shipment_length} {shipment_status} {est_delivery_date}</span>
226
- </td>
227
- </tr>
228
- <?php
229
- $send_time_array = array();
230
- for ( $hour = 0; $hour < 24; $hour++ ) {
231
- for ( $min = 0; $min < 60; $min = $min + 30 ) {
232
- $this_time = date( 'H:i', strtotime( "$hour:$min" ) );
233
- $send_time_array[ $this_time ] = $this_time;
234
- }
235
- } ?>
236
- <tr class="">
237
- <th scope="row" class="titledesc">
238
- <label for=""><?php _e('Trigger Alert', 'woo-advanced-shipment-tracking'); ?></label>
239
- </th>
240
- <td class="forminp">
241
- <label class="" for="trigger_alert_as_it_happens">
242
- <input type="radio" id="trigger_alert_as_it_happens" name="wcast_late_shipments_trigger_alert" value="as_it_happens" <?php if($wcast_late_shipments_trigger_alert == 'as_it_happens')echo 'checked'; ?>>
243
- <span class=""><?php _e('As it Happens', 'woo-advanced-shipment-tracking'); ?></span>
244
- </label>
245
- <label class="" for="trigger_alert_daily_digest_on">
246
- <input type="radio" id="trigger_alert_daily_digest_on" name="wcast_late_shipments_trigger_alert" value="daily_digest_on" <?php if($wcast_late_shipments_trigger_alert == 'daily_digest_on')echo 'checked'; ?>>
247
- <span class=""><?php _e('Daily Digest on', 'woo-advanced-shipment-tracking'); ?></span>
248
- </label>
249
- <select class="select daily_digest_time" name="wcast_late_shipments_daily_digest_time">
250
- <?php foreach((array)$send_time_array as $key1 => $val1 ){ ?>
251
- <option <?php if($wcast_late_shipments_daily_digest_time == $key1)echo 'selected'; ?> value="<?php echo $key1?>" ><?php echo $val1; ?></option>
252
- <?php } ?>
253
- </select>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td colspan="2">
258
- <button name="save" class="button-primary woocommerce-save-button btn_green2 btn_large" type="submit" value="Save changes"><?php _e( 'Save Changes', 'woo-advanced-shipment-tracking' ); ?></button>
259
- <div class="spinner"></div>
260
- <?php wp_nonce_field( 'ts_late_shipments_email_form', 'ts_late_shipments_email_form_nonce' );?>
261
- <input type="hidden" name="action" value="ts_late_shipments_email_form_update">
262
- </td>
263
- </tr>
264
- </table>
265
- </div>
266
- </form>
267
  </div>
268
  </section>
19
  $wcast_enable_availableforpickup_email = $ast->get_option_value_from_array('wcast_availableforpickup_email_settings','wcast_enable_availableforpickup_email','');
20
 
21
  $wcast_enable_late_shipments_admin_email = $ast->get_option_value_from_array('late_shipments_email_settings','wcast_enable_late_shipments_admin_email','');
22
+
23
+ $type = isset( $_GET['type'] ) ? sanitize_text_field($_GET['type']) : 'email';
24
  ?>
25
+
26
+ <input id="tab_email_notifications" type="radio" name="ts_notification_tabs" class="inner_tab_input" data-type="email" <?php if($type == 'email'){ echo 'checked'; } ?>>
27
  <label for="tab_email_notifications" class="inner_tab_label ts_tabs_label"><?php _e( 'Email Notifications', 'woo-advanced-shipment-tracking' ); ?></label>
28
 
29
+ <input id="tab_sms_notifications" type="radio" name="ts_notification_tabs" class="inner_tab_input" data-type="sms" <?php if($type == 'sms'){ echo 'checked'; } ?>>
30
  <label for="tab_sms_notifications" class="inner_tab_label ts_tabs_label"><?php _e( 'SMS Notifications', 'woo-advanced-shipment-tracking' ); ?></label>
31
 
32
  <section class="inner_tab_section shipment-status-email-section">
42
  <button class="button button-primary shipment-status-label in-transit"><?php _e('In Transit', 'woo-advanced-shipment-tracking'); ?></button>
43
  </td>
44
  <td class="forminp">
45
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_intransit_customizer_email::get_customizer_url('trackship_shipment_status_email','in_transit','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
46
  </td>
47
  </tr>
48
  <tr class="<?php if($wcast_enable_onhold_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
55
  <button class="button button-primary shipment-status-label on-hold"><?php _e('On Hold', 'woo-advanced-shipment-tracking'); ?></button>
56
  </td>
57
  <td class="forminp">
58
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_onhold_customizer_email::get_customizer_url('trackship_shipment_status_email','on_hold','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
59
  </td>
60
  </tr>
61
  <tr class="<?php if($wcast_enable_returntosender_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
68
  <button class="button button-primary shipment-status-label return-to-sender"><?php _e('Return To Sender', 'woo-advanced-shipment-tracking'); ?></button>
69
  </td>
70
  <td class="forminp">
71
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('trackship_shipment_status_email','return_to_sender','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
72
  </td>
73
  </tr>
74
  <tr class="<?php if($wcast_enable_availableforpickup_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
81
  <button class="button button-primary shipment-status-label available-for-pickup"><?php _e('Available For Pickup', 'woo-advanced-shipment-tracking'); ?></button>
82
  </td>
83
  <td class="forminp">
84
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('trackship_shipment_status_email','available_for_pickup','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
85
  </td>
86
  </tr>
87
  <tr class="<?php if($wcast_enable_outfordelivery_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
94
  <button class="button button-primary shipment-status-label out-for-delivery"><?php _e('Out For Delivery', 'woo-advanced-shipment-tracking'); ?></button>
95
  </td>
96
  <td class="forminp">
97
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('trackship_shipment_status_email','out_for_delivery','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
98
  </td>
99
  </tr>
100
  <tr class="<?php if( $wcast_enable_delivered_status_email == 1 ){ echo 'enable'; } else{ echo 'disable'; }?>">
107
  <button class="button button-primary shipment-status-label delivered-status"><?php _e('Delivered', 'woo-advanced-shipment-tracking'); ?></button>
108
  </td>
109
  <td class="forminp">
110
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_delivered_customizer_email::get_customizer_url('trackship_shipment_status_email','delivered','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
111
  </td>
112
  </tr>
113
  <tr class="<?php if($wcast_enable_failure_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
120
  <button class="button button-primary shipment-status-label failed-attempt"><?php _e('Failed Attempt', 'woo-advanced-shipment-tracking'); ?></button>
121
  </td>
122
  <td class="forminp">
123
+ <a class="button-primary btn_ts_transparent edit_customizer_a" href="<?php echo wcast_failure_customizer_email::get_customizer_url('trackship_shipment_status_email','failure','trackship') ?>"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
124
  </td>
125
  </tr>
126
  </tbody>
127
  </table>
128
+ <?php do_action( 'after_shipment_status_email_notifications' ); ?>
129
+ <form method="post" id="trackship_late_shipments_form" action="" enctype="multipart/form-data">
130
+ <table class="form-table heading-table">
131
+ <tbody>
132
+ <tr valign="top">
133
+ <td>
134
+ <h3 style=""><?php _e( 'Admin Notifications', 'woo-advanced-shipment-tracking' ); ?></h3>
135
+ </td>
136
+ </tr>
137
+ </tbody>
138
+ </table>
139
+ <table class="form-table shipment-status-email-table">
140
+ <tbody>
141
+ <tr class="<?php if($wcast_enable_late_shipments_admin_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
142
+ <td class="forminp status-label-column">
143
+ <span class="shipment_status_toggle">
144
+ <input type="hidden" name="wcast_enable_late_shipments_admin_email" value="0"/>
145
+ <input class="ast-tgl ast-tgl-flat" id="wcast_enable_late_shipments_admin_email" name="wcast_enable_late_shipments_admin_email" data-settings="late_shipments_email_settings" type="checkbox" <?php if($wcast_enable_late_shipments_admin_email == 1) { echo 'checked'; } ?> value="1"/>
146
+ <label class="ast-tgl-btn ast-tgl-btn-green" for="wcast_enable_late_shipments_admin_email"></label>
147
+ </span>
148
+ <button class="button button-primary shipment-status-label late-shipments"><?php _e('Late Shipments', 'woo-advanced-shipment-tracking'); ?></button>
149
+ </td>
150
+ <td class="forminp">
151
+ <a class="edit_customizer_a late_shipments_a button-primary btn_ts_transparent" href="javascript:void(0);"><?php _e('Customize', 'woo-advanced-shipment-tracking'); ?></a>
152
+ </td>
153
+ </tr>
154
+ </tbody>
155
+ </table>
156
+ <?php
157
+ $late_shipments_email_settings = get_option('late_shipments_email_settings');
158
+ $wcast_late_shipments_days = isset( $late_shipments_email_settings['wcast_late_shipments_days'] ) ? $late_shipments_email_settings['wcast_late_shipments_days'] : '';
159
+ $wcast_late_shipments_email_to = isset( $late_shipments_email_settings['wcast_late_shipments_email_to'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_to'] : '';
160
+ $wcast_late_shipments_email_subject = isset( $late_shipments_email_settings['wcast_late_shipments_email_subject'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_subject'] : '';
161
+ $wcast_late_shipments_email_content = isset( $late_shipments_email_settings['wcast_late_shipments_email_content'] ) ? $late_shipments_email_settings['wcast_late_shipments_email_content'] : '';
162
+ $wcast_late_shipments_trigger_alert = isset( $late_shipments_email_settings['wcast_late_shipments_trigger_alert'] ) ? $late_shipments_email_settings['wcast_late_shipments_trigger_alert'] : '';
163
+ $wcast_late_shipments_daily_digest_time = isset( $late_shipments_email_settings['wcast_late_shipments_daily_digest_time'] ) ? $late_shipments_email_settings['wcast_late_shipments_daily_digest_time'] : ''; ?>
164
+
165
+ <table class="form-table late-shipments-email-content-table hide_table">
166
+ <tr class="">
167
+ <th scope="row" class="titledesc">
168
+ <label for=""><?php _e('Late Shipment Days', 'woo-advanced-shipment-tracking'); ?></label>
169
+ </th>
170
+ <td class="forminp">
171
+ <fieldset>
172
+ <input class="input-text" type="number" name="wcast_late_shipments_days" id="wcast_late_shipments_days" min="1" value="<?php echo $wcast_late_shipments_days; ?>">
173
+ </fieldset>
174
+ </td>
175
+ </tr>
176
+ <tr class="">
177
+ <th scope="row" class="titledesc">
178
+ <label for=""><?php _e('Recipient(s)', 'woocommerce'); ?></label>
179
+ </th>
180
+ <td class="forminp">
181
+ <fieldset>
182
+ <input class="input-text regular-input " type="text" name="wcast_late_shipments_email_to" id="wcast_late_shipments_email_to" placeholder="<?php _e('E.g. {admin_email}, admin@example.org', 'woo-advanced-shipment-tracking'); ?>" value="<?php echo $wcast_late_shipments_email_to; ?>">
183
+ </fieldset>
184
+ </td>
185
+ </tr>
186
+ <tr class="">
187
+ <th scope="row" class="titledesc">
188
+ <label for=""><?php _e('Subject', 'woocommerce'); ?></label>
189
+ </th>
190
+ <td class="forminp">
191
+ <fieldset>
192
+ <input class="input-text regular-input " type="text" name="wcast_late_shipments_email_subject" id="wcast_late_shipments_email_subject" placeholder="<?php _e('Late shipment for order #{order_number}', 'woo-advanced-shipment-tracking'); ?>" value="<?php echo $wcast_late_shipments_email_subject; ?>">
193
+ </fieldset>
194
+ </td>
195
+ </tr>
196
+ <tr class="">
197
+ <th scope="row" class="titledesc">
198
+ <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
199
+ </th>
200
+ <td class="forminp">
201
+ <fieldset>
202
+ <textarea name="wcast_late_shipments_email_content" id="wcast_late_shipments_email_content" placeholder="<?php _e('This order was shipped {shipment_length} days ago, the shipment status is {shipment_status} and its est. delivery date is {est_delivery_date}.', 'woo-advanced-shipment-tracking'); ?>"><?php echo $wcast_late_shipments_email_content; ?></textarea>
203
+ </fieldset>
204
+ <span><?php _e('Available variables:', 'woo-advanced-shipment-tracking'); ?> {site_title} {admin_email} {customer_first_name} {customer_last_name} {customer_company_name} {customer_username} {order_number} {shipment_length} {shipment_status} {est_delivery_date}</span>
205
+ </td>
206
+ </tr>
207
+ <?php
208
+ $send_time_array = array();
209
+ for ( $hour = 0; $hour < 24; $hour++ ) {
210
+ for ( $min = 0; $min < 60; $min = $min + 30 ) {
211
+ $this_time = date( 'H:i', strtotime( "$hour:$min" ) );
212
+ $send_time_array[ $this_time ] = $this_time;
213
+ }
214
+ } ?>
215
+ <tr class="">
216
+ <th scope="row" class="titledesc">
217
+ <label for=""><?php _e('Trigger Alert', 'woo-advanced-shipment-tracking'); ?></label>
218
+ </th>
219
+ <td class="forminp">
220
+ <label class="" for="trigger_alert_as_it_happens">
221
+ <input type="radio" id="trigger_alert_as_it_happens" name="wcast_late_shipments_trigger_alert" value="as_it_happens" <?php if($wcast_late_shipments_trigger_alert == 'as_it_happens')echo 'checked'; ?>>
222
+ <span class=""><?php _e('As it Happens', 'woo-advanced-shipment-tracking'); ?></span>
223
+ </label>
224
+ <label class="" for="trigger_alert_daily_digest_on">
225
+ <input type="radio" id="trigger_alert_daily_digest_on" name="wcast_late_shipments_trigger_alert" value="daily_digest_on" <?php if($wcast_late_shipments_trigger_alert == 'daily_digest_on')echo 'checked'; ?>>
226
+ <span class=""><?php _e('Daily Digest on', 'woo-advanced-shipment-tracking'); ?></span>
227
+ </label>
228
+ <select class="select daily_digest_time" name="wcast_late_shipments_daily_digest_time">
229
+ <?php foreach((array)$send_time_array as $key1 => $val1 ){ ?>
230
+ <option <?php if($wcast_late_shipments_daily_digest_time == $key1)echo 'selected'; ?> value="<?php echo $key1?>" ><?php echo $val1; ?></option>
231
+ <?php } ?>
232
+ </select>
233
+ </td>
234
+ </tr>
235
+ <tr>
236
+ <td colspan="2">
237
+ <button name="save" class="button-primary woocommerce-save-button btn_green2 btn_large" type="submit" value="Save changes"><?php _e( 'Save Changes', 'woo-advanced-shipment-tracking' ); ?></button>
238
+ <div class="spinner"></div>
239
+ <?php wp_nonce_field( 'ts_late_shipments_email_form', 'ts_late_shipments_email_form_nonce' );?>
240
+ <input type="hidden" name="action" value="ts_late_shipments_email_form_update">
241
+ </td>
242
+ </tr>
243
+ </table>
244
+ </form>
245
  </section>
246
  <section class="inner_tab_section shipment-status-sms-section">
247
  <?php
262
  do_action( 'shipment_status_sms_section' );
263
  ?>
264
  </section>
265
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  </div>
267
  </section>
includes/views/admin_trackship_dashboard.php CHANGED
@@ -1,4 +1,4 @@
1
- <section id="content_trackship_dashboard" class="inner_tab_section">
2
  <div class="tab_inner_container">
3
  <?php
4
  $wc_ast_api_key = get_option('wc_ast_api_key');
@@ -22,15 +22,16 @@
22
  <div class="trackship-notice">
23
  <p><?php echo sprintf(__('You have %s Shipped Orders from the last 30 days that you can bulk send to <a href="javascript:void(0);" class="tool_link">Get Shipment Status</a>', 'woo-advanced-shipment-tracking'),$total_orders ); ?></p>
24
  </div>
25
- <?php } ?>
 
26
 
27
- <input id="tab_trackship_settings" type="radio" name="ts_inner_tabs" class="inner_tab_input" checked>
28
  <label for="tab_trackship_settings" class="inner_tab_label ts_tabs_label"><?php _e('Settings', 'woocommerce'); ?></label>
29
 
30
- <input id="tab_status_notifications" type="radio" name="ts_inner_tabs" class="inner_tab_input">
31
  <label for="tab_status_notifications" class="inner_tab_label ts_tabs_label"><?php _e('Notifications', 'woo-advanced-shipment-tracking'); ?></label>
32
 
33
- <input id="tab_tools" type="radio" name="ts_inner_tabs" class="inner_tab_input">
34
  <label for="tab_tools" class="inner_tab_label ts_tabs_label"><?php _e('Tools', 'woo-advanced-shipment-tracking'); ?></label>
35
 
36
  <?php include 'trackship_settings.php'; ?>
1
+ <section id="content_trackship_dashboard" class="tab_section">
2
  <div class="tab_inner_container">
3
  <?php
4
  $wc_ast_api_key = get_option('wc_ast_api_key');
22
  <div class="trackship-notice">
23
  <p><?php echo sprintf(__('You have %s Shipped Orders from the last 30 days that you can bulk send to <a href="javascript:void(0);" class="tool_link">Get Shipment Status</a>', 'woo-advanced-shipment-tracking'),$total_orders ); ?></p>
24
  </div>
25
+ <?php }
26
+ $subtab = isset( $_GET['subtab'] ) ? sanitize_text_field($_GET['subtab']) : 'ts-settings'; ?>
27
 
28
+ <input id="tab_trackship_settings" type="radio" name="ts_inner_tabs" class="inner_tab_input" data-subtab="ts-settings" <?php if($subtab == 'ts-settings'){ echo 'checked'; } ?>>
29
  <label for="tab_trackship_settings" class="inner_tab_label ts_tabs_label"><?php _e('Settings', 'woocommerce'); ?></label>
30
 
31
+ <input id="tab_status_notifications" type="radio" name="ts_inner_tabs" class="inner_tab_input" data-subtab="notifications" <?php if($subtab == 'notifications'){ echo 'checked'; } ?>>
32
  <label for="tab_status_notifications" class="inner_tab_label ts_tabs_label"><?php _e('Notifications', 'woo-advanced-shipment-tracking'); ?></label>
33
 
34
+ <input id="tab_tools" type="radio" name="ts_inner_tabs" class="inner_tab_input" data-subtab="tools" <?php if($subtab == 'tools'){ echo 'checked'; } ?>>
35
  <label for="tab_tools" class="inner_tab_label ts_tabs_label"><?php _e('Tools', 'woo-advanced-shipment-tracking'); ?></label>
36
 
37
  <?php include 'trackship_settings.php'; ?>
readme.txt CHANGED
@@ -142,6 +142,20 @@ Yes, if you use external shipping services that work with the WooCommerce REST A
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 3.2.1.3 =
146
  * Fix - Fixed issue with custom order status is not show in Order Email Display Add Tracking action settings
147
 
142
 
143
  == Changelog ==
144
 
145
+ = 3.2.1.4 =
146
+ * Enhancement - Improved the TrackShip tools page design
147
+ * Enhancement - Set pagination in shipping provider list when bulk Activate/Deactivate all providers
148
+ * Enhancement - Improved the design of Shipping Providers list search bar
149
+ * Enhancement - After adding custom shipping provider reload the page and sort the shipping providers list by custom provider
150
+ * Enhancement - Add sub tab and notification type in settings page URL parameter
151
+ * Enhancement - Improved the design of Documentation button in header of settings page
152
+ * Enhancement - Improved the TrackShip shipment status email customizer and tracking page customizer
153
+ * Enhancement - On Shipping provider sync with check "Reset providers database, it will reset all your shipping provider database" option delete the Shipping provider table and create again
154
+ * Enhancement - Added back functionality for add only one API name in shipping providers list
155
+ * Enhancement - On My account order details page if TrackShip tracking page is enable open tracking page in lightbox
156
+ * Enhancement - Updated design of Addons page
157
+ * Fix - Fixed shipment status filter bug in orders list page
158
+
159
  = 3.2.1.3 =
160
  * Fix - Fixed issue with custom order status is not show in Order Email Display Add Tracking action settings
161
 
templates/emails/wcast-email-order-details.php CHANGED
@@ -24,7 +24,12 @@ $responsive_check = false;
24
  if (class_exists('Kadence_Woomail_Customizer')) {
25
  $responsive_check = Kadence_Woomail_Customizer::opt( 'responsive_mode' );
26
  }
 
27
  do_action( 'wcast_email_before_order_table', $order, $sent_to_admin, $plain_text, $email );
 
 
 
 
28
  ?>
29
  <br>
30
  <h2 style="text-align:<?php echo $text_align; ?>">
@@ -61,36 +66,56 @@ do_action( 'wcast_email_before_order_table', $order, $sent_to_admin, $plain_text
61
  <?php
62
  if ( true == $responsive_check ) { ?>
63
  <div style="margin-bottom: 40px;">
64
- <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
65
  <thead>
66
  <tr>
67
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
68
- <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
 
 
69
  </tr>
70
  </thead>
71
  <tbody>
72
  <?php
73
  $args = array(
74
- 'show_sku' => $sent_to_admin,
75
- 'show_image' => false,
76
- 'image_size' => array( 32, 32 ),
77
- 'plain_text' => $plain_text,
78
- 'sent_to_admin' => $sent_to_admin,
79
- );
80
  $args = apply_filters( 'ast_email_order_items_args', $args);
81
- echo wc_get_email_order_items( $order, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ?>
83
  </tbody>
84
  </table>
85
  </div>
86
  <?php } else{ ?>
87
  <div style="margin-bottom: 40px;">
88
- <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
89
  <thead>
90
  <tr>
91
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
92
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
93
- <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
 
 
94
  </tr>
95
  </thead>
96
  <tbody>
@@ -103,7 +128,23 @@ if ( true == $responsive_check ) { ?>
103
  'sent_to_admin' => $sent_to_admin,
104
  );
105
  $args = apply_filters( 'ast_email_order_items_args', $args);
106
- echo wc_get_email_order_items( $order, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  ?>
108
  </tbody>
109
  </table>
24
  if (class_exists('Kadence_Woomail_Customizer')) {
25
  $responsive_check = Kadence_Woomail_Customizer::opt( 'responsive_mode' );
26
  }
27
+
28
  do_action( 'wcast_email_before_order_table', $order, $sent_to_admin, $plain_text, $email );
29
+
30
+ $table_font_size = '';
31
+ $kt_woomail = get_option( 'kt_woomail' );
32
+ if( !empty($kt_woomail) && isset( $kt_woomail['font_size'] ) )$table_font_size = 'font-size:'.$kt_woomail['font_size'].'px';
33
  ?>
34
  <br>
35
  <h2 style="text-align:<?php echo $text_align; ?>">
66
  <?php
67
  if ( true == $responsive_check ) { ?>
68
  <div style="margin-bottom: 40px;">
69
+ <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;<?php echo $table_font_size; ?>" border="1">
70
  <thead>
71
  <tr>
72
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
73
+ <?php if(!$hide_shipping_item_price){ ?>
74
+ <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
75
+ <?php } ?>
76
  </tr>
77
  </thead>
78
  <tbody>
79
  <?php
80
  $args = array(
81
+ 'show_sku' => $sent_to_admin,
82
+ 'show_image' => false,
83
+ 'image_size' => array( 32, 32 ),
84
+ 'plain_text' => $plain_text,
85
+ 'sent_to_admin' => $sent_to_admin,
86
+ );
87
  $args = apply_filters( 'ast_email_order_items_args', $args);
88
+ //echo wc_get_email_order_items( $order, $args );
89
+
90
+ echo wc_get_template(
91
+ 'emails/wcast-email-order-items.php', array(
92
+ 'order' => $order,
93
+ 'items' => $order->get_items(),
94
+ 'show_download_links' => $order->is_download_permitted() && ! $args['sent_to_admin'],
95
+ 'show_sku' => $args['show_sku'],
96
+ 'show_purchase_note' => $order->is_paid() && ! $args['sent_to_admin'],
97
+ 'show_image' => $args['show_image'],
98
+ 'image_size' => $args['image_size'],
99
+ 'plain_text' => $args['plain_text'],
100
+ 'sent_to_admin' => $args['sent_to_admin']
101
+ ),
102
+ 'woocommerce-advanced-shipment-tracking/',
103
+ wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
104
+ );
105
  ?>
106
  </tbody>
107
  </table>
108
  </div>
109
  <?php } else{ ?>
110
  <div style="margin-bottom: 40px;">
111
+ <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;<?php echo $table_font_size; ?>" border="1">
112
  <thead>
113
  <tr>
114
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
115
  <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
116
+ <?php if(!$hide_shipping_item_price){ ?>
117
+ <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
118
+ <?php } ?>
119
  </tr>
120
  </thead>
121
  <tbody>
128
  'sent_to_admin' => $sent_to_admin,
129
  );
130
  $args = apply_filters( 'ast_email_order_items_args', $args);
131
+ //echo wc_get_email_order_items( $order, $args );
132
+ echo wc_get_template(
133
+ 'emails/wcast-email-order-items.php', array(
134
+ 'order' => $order,
135
+ 'items' => $order->get_items(),
136
+ 'show_download_links' => $order->is_download_permitted() && ! $args['sent_to_admin'],
137
+ 'show_sku' => $args['show_sku'],
138
+ 'show_purchase_note' => $order->is_paid() && ! $args['sent_to_admin'],
139
+ 'show_image' => $args['show_image'],
140
+ 'image_size' => $args['image_size'],
141
+ 'plain_text' => $args['plain_text'],
142
+ 'sent_to_admin' => $args['sent_to_admin'],
143
+ 'hide_shipping_item_price' => $hide_shipping_item_price
144
+ ),
145
+ 'woocommerce-advanced-shipment-tracking/',
146
+ wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
147
+ );
148
  ?>
149
  </tbody>
150
  </table>
templates/emails/wcast-email-order-items.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Email Order Items
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce\Templates\Emails
15
+ * @version 3.7.0
16
+ */
17
+
18
+ defined( 'ABSPATH' ) || exit;
19
+
20
+ $text_align = is_rtl() ? 'right' : 'left';
21
+ $margin_side = is_rtl() ? 'left' : 'right';
22
+
23
+ foreach ( $items as $item_id => $item ) :
24
+ $product = $item->get_product();
25
+ $sku = '';
26
+ $purchase_note = '';
27
+ $image = '';
28
+
29
+ if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
30
+ continue;
31
+ }
32
+
33
+ if ( is_object( $product ) ) {
34
+ $sku = $product->get_sku();
35
+ $purchase_note = $product->get_purchase_note();
36
+ $image = $product->get_image( $image_size );
37
+ }
38
+
39
+ ?>
40
+ <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
41
+ <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;">
42
+ <?php
43
+
44
+ // Show title/image etc.
45
+ if ( $show_image ) {
46
+ echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
47
+ }
48
+
49
+ // Product name.
50
+ echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
51
+
52
+ // SKU.
53
+ if ( $show_sku && $sku ) {
54
+ echo wp_kses_post( ' (#' . $sku . ')' );
55
+ }
56
+
57
+ // allow other plugins to add additional product information here.
58
+ do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
59
+
60
+ wc_display_item_meta(
61
+ $item,
62
+ array(
63
+ 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr( $text_align ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
64
+ )
65
+ );
66
+
67
+ // allow other plugins to add additional product information here.
68
+ do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
69
+
70
+ ?>
71
+ </td>
72
+ <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
73
+ <?php
74
+ $qty = $item->get_quantity();
75
+ $refunded_qty = $order->get_qty_refunded_for_item( $item_id );
76
+
77
+ if ( $refunded_qty ) {
78
+ $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
79
+ } else {
80
+ $qty_display = esc_html( $qty );
81
+ }
82
+ echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) );
83
+ ?>
84
+ </td>
85
+ <?php if(!$hide_shipping_item_price){ ?>
86
+ <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
87
+ <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
88
+ </td>
89
+ <?php }?>
90
+ </tr>
91
+ <?php
92
+
93
+ if ( $show_purchase_note && $purchase_note ) {
94
+ ?>
95
+ <tr>
96
+ <td colspan="3" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
97
+ <?php
98
+ echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );
99
+ ?>
100
+ </td>
101
+ </tr>
102
+ <?php
103
+ }
104
+ ?>
105
+
106
+ <?php endforeach; ?>
templates/emails/wcast-shipping-email-addresses.php CHANGED
@@ -27,8 +27,9 @@ $shipping = $order->get_formatted_shipping_address();
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="text-align:<?php echo $text_align; ?>"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
30
-
31
- <address class="address"><?php echo wp_kses_post( $shipping ); ?></address>
 
32
  </td>
33
  </tr>
34
  </table>
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="text-align:<?php echo $text_align; ?>"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
30
+ <?php if( !empty($shipping) ){ ?>
31
+ <address class="address"><?php echo wp_kses_post( $shipping ); ?></address>
32
+ <?php } ?>
33
  </td>
34
  </tr>
35
  </table>
templates/myaccount/tracking-info.php CHANGED
@@ -101,7 +101,7 @@ if ( $tracking_items ) :
101
 
102
  $td_column_style = "text-align: ".$header_content_text_align."; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size:".$table_content_font_size."px;font-weight:".$table_content_font_weight."; color: ".$table_content_font_color." ; border: ".$email_border_size."px solid ".$email_border_color."; padding: 12px;line-height: ".$table_content_line_height."px;";
103
 
104
- $tracking_link_style = "color: ".$tracking_link_font_color." ;background:".$tracking_link_bg_color.";padding: 10px;";
105
 
106
  $hide_table_header = $ast->get_option_value_from_array('tracking_info_settings','hide_table_header','');
107
 
@@ -125,7 +125,7 @@ if ( $tracking_items ) :
125
 
126
  $show_provider_border = $ast->get_option_value_from_array('tracking_info_settings','show_provider_border',$wcast_customizer_settings->defaults['show_provider_border']);
127
 
128
- $provider_border_color = $ast->get_option_value_from_array('tracking_info_settings','provider_border_color',$wcast_customizer_settings->defaults['provider_border_color']);
129
  ?>
130
 
131
  <?php if($hide_trackig_header != 1){ ?>
@@ -137,7 +137,19 @@ if ( $tracking_items ) :
137
  <?php if($select_tracking_template == 'simple_list'){ ?>
138
  <div class="tracking_info">
139
  <ul class="tracking_list">
140
- <?php foreach ( $tracking_items as $tracking_item ) {
 
 
 
 
 
 
 
 
 
 
 
 
141
  $date_shipped = date("Y-m-d");
142
  if(isset($tracking_item['date_shipped'])){
143
  $date_shipped = $tracking_item['date_shipped'];
@@ -163,7 +175,11 @@ if ( $tracking_items ) :
163
 
164
  $simple_layout_content_updated = str_replace('{shipping_provider}',$formatted_tracking_provider,$simple_layout_content_updated);
165
 
166
- $tracking_number_link = '<a target="_blank" href="'.esc_url( $url ).'">'.$tracking_item['tracking_number'].'</a>';
 
 
 
 
167
 
168
  $simple_layout_content_updated = str_replace('{tracking_number_link}',$tracking_number_link,$simple_layout_content_updated);
169
 
@@ -197,7 +213,19 @@ if ( $tracking_items ) :
197
  </thead>
198
  <?php } ?>
199
  <tbody><?php
200
- foreach ( $tracking_items as $tracking_item ) {
 
 
 
 
 
 
 
 
 
 
 
 
201
  global $wpdb;
202
 
203
  $tracking_provider = isset( $tracking_item['tracking_provider'] ) ? $tracking_item['tracking_provider'] : $tracking_item['custom_tracking_provider'];
@@ -221,9 +249,11 @@ if ( $tracking_items ) :
221
  <td class="tracking-number" style="<?php echo $td_column_style; ?>" data-title="<?php _e( 'Tracking Number', 'woo-advanced-shipment-tracking' ); ?>">
222
  <?php if('' !== $tracking_item['formatted_tracking_link'] && $tracking_number_link){
223
  $url = str_replace('%number%',$tracking_item['tracking_number'],$tracking_item['formatted_tracking_link']);
224
- ?>
225
- <a href="<?php echo esc_url( $url ); ?>" target="_blank" style="<?php echo $tracking_link_style; ?>"><?php echo esc_html( $tracking_item['tracking_number'] ); ?></a>
226
- <?php
 
 
227
  } else{
228
  echo esc_html( $tracking_item['tracking_number'] );
229
  }
@@ -236,10 +266,13 @@ if ( $tracking_items ) :
236
  <?php } if(!$tracking_number_link){ ?>
237
  <td class="order-actions" style="<?php echo $td_column_style; ?>;text-align:center;">
238
  <?php if ( '' !== $tracking_item['formatted_tracking_link'] ) {
239
- $url = str_replace('%number%',$tracking_item['tracking_number'],$tracking_item['formatted_tracking_link']);
240
- ?>
241
- <a href="<?php echo esc_url( $url ); ?>" target="_blank" class="button" style="<?php echo $tracking_link_style; ?>"><?php _e( 'Track', 'woo-advanced-shipment-tracking' ); ?></a>
242
- <?php } ?>
 
 
 
243
  </td>
244
  <?php } ?>
245
  </tr><?php
@@ -247,5 +280,12 @@ if ( $tracking_items ) :
247
  ?></tbody>
248
  </table>
249
  <?php
250
- }
 
 
 
 
 
 
 
251
  endif;
101
 
102
  $td_column_style = "text-align: ".$header_content_text_align."; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size:".$table_content_font_size."px;font-weight:".$table_content_font_weight."; color: ".$table_content_font_color." ; border: ".$email_border_size."px solid ".$email_border_color."; padding: 12px;line-height: ".$table_content_line_height."px;";
103
 
104
+ $tracking_link_style = "color: ".$tracking_link_font_color." ;background:".$tracking_link_bg_color.";margin-bottom: 0;";
105
 
106
  $hide_table_header = $ast->get_option_value_from_array('tracking_info_settings','hide_table_header','');
107
 
125
 
126
  $show_provider_border = $ast->get_option_value_from_array('tracking_info_settings','show_provider_border',$wcast_customizer_settings->defaults['show_provider_border']);
127
 
128
+ $provider_border_color = $ast->get_option_value_from_array('tracking_info_settings','provider_border_color',$wcast_customizer_settings->defaults['provider_border_color']);
129
  ?>
130
 
131
  <?php if($hide_trackig_header != 1){ ?>
137
  <?php if($select_tracking_template == 'simple_list'){ ?>
138
  <div class="tracking_info">
139
  <ul class="tracking_list">
140
+ <?php foreach ( $tracking_items as $key => $tracking_item ) {
141
+
142
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
143
+ $status = '';
144
+
145
+ if(isset($shipment_status[$key])){
146
+ if(isset($shipment_status[$key]['status'])){
147
+ $status = $shipment_status[$key]['status'];
148
+ }
149
+ }
150
+
151
+ $ts_tracking_page = $ast->check_ts_tracking_page_for_tracking_item( $order_id, $tracking_item, $status );
152
+
153
  $date_shipped = date("Y-m-d");
154
  if(isset($tracking_item['date_shipped'])){
155
  $date_shipped = $tracking_item['date_shipped'];
175
 
176
  $simple_layout_content_updated = str_replace('{shipping_provider}',$formatted_tracking_provider,$simple_layout_content_updated);
177
 
178
+ if($ts_tracking_page){
179
+ $tracking_number_link = '<a href="javascript:void(0)" class="open_tracking_lightbox" data-order="'.$order_id.'" data-tracking="'.$tracking_item['tracking_number'].'">'.$tracking_item['tracking_number'].'</a>';
180
+ } else{
181
+ $tracking_number_link = '<a target="_blank" href="'.esc_url( $url ).'">'.$tracking_item['tracking_number'].'</a>';
182
+ }
183
 
184
  $simple_layout_content_updated = str_replace('{tracking_number_link}',$tracking_number_link,$simple_layout_content_updated);
185
 
213
  </thead>
214
  <?php } ?>
215
  <tbody><?php
216
+ foreach ( $tracking_items as $key => $tracking_item ) {
217
+
218
+ $shipment_status = get_post_meta( $order_id, "shipment_status", true);
219
+ $status = '';
220
+
221
+ if(isset($shipment_status[$key])){
222
+ if(isset($shipment_status[$key]['status'])){
223
+ $status = $shipment_status[$key]['status'];
224
+ }
225
+ }
226
+
227
+ $ts_tracking_page = $ast->check_ts_tracking_page_for_tracking_item( $order_id, $tracking_item, $status );
228
+
229
  global $wpdb;
230
 
231
  $tracking_provider = isset( $tracking_item['tracking_provider'] ) ? $tracking_item['tracking_provider'] : $tracking_item['custom_tracking_provider'];
249
  <td class="tracking-number" style="<?php echo $td_column_style; ?>" data-title="<?php _e( 'Tracking Number', 'woo-advanced-shipment-tracking' ); ?>">
250
  <?php if('' !== $tracking_item['formatted_tracking_link'] && $tracking_number_link){
251
  $url = str_replace('%number%',$tracking_item['tracking_number'],$tracking_item['formatted_tracking_link']);
252
+ if($ts_tracking_page){ ?>
253
+ <a href="javascript:void(0)" class="open_tracking_lightbox" data-order="<?php echo $order_id; ?>" data-tracking="<?php echo esc_html( $tracking_item['tracking_number'] ); ?>" style="<?php echo $tracking_link_style; ?>"><?php echo esc_html( $tracking_item['tracking_number'] ); ?></a>
254
+ <?php } else{ ?>
255
+ <a href="<?php echo esc_url( $url ); ?>" target="_blank" style="<?php echo $tracking_link_style; ?>"><?php echo esc_html( $tracking_item['tracking_number'] ); ?></a>
256
+ <?php }
257
  } else{
258
  echo esc_html( $tracking_item['tracking_number'] );
259
  }
266
  <?php } if(!$tracking_number_link){ ?>
267
  <td class="order-actions" style="<?php echo $td_column_style; ?>;text-align:center;">
268
  <?php if ( '' !== $tracking_item['formatted_tracking_link'] ) {
269
+ $url = str_replace('%number%',$tracking_item['tracking_number'],$tracking_item['formatted_tracking_link']);
270
+
271
+ if($ts_tracking_page){ ?>
272
+ <a href="javascript:void(0)" class="button open_tracking_lightbox" data-order="<?php echo $order_id; ?>" data-tracking="<?php echo esc_html( $tracking_item['tracking_number'] ); ?>" style="<?php echo $tracking_link_style; ?>"><?php _e( 'Track', 'woo-advanced-shipment-tracking' ); ?></a>
273
+ <?php } else{ ?>
274
+ <a href="<?php echo esc_url( $url ); ?>" target="_blank" class="button" style="<?php echo $tracking_link_style; ?>"><?php _e( 'Track', 'woo-advanced-shipment-tracking' ); ?></a>
275
+ <?php } } ?>
276
  </td>
277
  <?php } ?>
278
  </tr><?php
280
  ?></tbody>
281
  </table>
282
  <?php
283
+ } ?>
284
+ <div id="" class="popupwrapper ts_tracking_popup" style="display:none;">
285
+ <div class="popuprow">
286
+
287
+ </div>
288
+ <div class="popupclose"></div>
289
+ </div>
290
+ <?php
291
  endif;
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.1.3
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
@@ -21,7 +21,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
21
  *
22
  * @var string
23
  */
24
- public $version = '3.2.1.3';
25
 
26
  /**
27
  * Initialize the main plugin function
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.1.4
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
21
  *
22
  * @var string
23
  */
24
+ public $version = '3.2.1.4';
25
 
26
  /**
27
  * Initialize the main plugin function