Advanced Shipment Tracking for WooCommerce - Version 1.9.5.2

Version Description

  • Added DTDC Shipping provider as a default shipping provider
Download this release

Release Info

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

Code changes from version 1.9.4.1 to 1.9.5.2

assets/css/admin.css CHANGED
@@ -139,7 +139,7 @@ input.tab_input:checked + label {
139
  padding-right: 20px;
140
  }
141
  .zorem_admin_sidebar {
142
- width: 280px;
143
  padding-right: 20px;
144
  display: table-cell;
145
  vertical-align: top;
@@ -285,18 +285,12 @@ input.tab_input:checked + label {
285
  .zorem_admin_layout .form-table th.titledesc {
286
  width: 50%;
287
  }
288
- .zorem_admin_layout .form-table .th_80 {
289
  width: 80%;
290
  }
291
- .zorem_admin_layout .form-table .th_20 {
292
  width: 20%;
293
  }
294
- .woocommerce table.form-table.upload_csv_table{
295
- table-layout: unset;
296
- }
297
- .upload_csv_section{
298
- border-right: 1px solid #ccc;
299
- }
300
  .bulk_instruction_ul{
301
  display: block;
302
  list-style-type: disc;
@@ -431,6 +425,15 @@ td.column-columnname.url-column {
431
  line-height: 30px;
432
  height: 32px;
433
  }
 
 
 
 
 
 
 
 
 
434
  .wp-core-ui .btn_red {
435
  background: red;
436
  text-shadow: none;
@@ -454,6 +457,13 @@ td.column-columnname.url-column {
454
  text-shadow: none;
455
  box-shadow: inset 0 0 0 100px rgba(0,0,0,0.2);
456
  }
 
 
 
 
 
 
 
457
  .on_edit_show.custom_provider_name{
458
  margin: 10px 0;
459
  }
@@ -470,9 +480,6 @@ td.column-columnname.url-column {
470
  .woocommerce .tracking_info_design table.form-table input.regular-input,.woocommerce .tracking_info_design table.form-table input[type=text], .woocommerce .tracking_info_design table.form-table textarea{
471
  width: 65%;
472
  }
473
- .woocommerce table.form-table.upload_csv_table tr td:first-child{
474
- width:30%;
475
- }
476
  #wc_ast_upload_csv_form .mdl-progress{
477
  width: 100%;
478
  }
@@ -582,7 +589,7 @@ td.column-columnname.url-column {
582
  box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
583
  }
584
  .ac-container input:checked ~ article.ac-small{
585
- height: 825px;
586
  overflow: auto;
587
  }
588
  .ac-container table.form-table td input[type=text]{
@@ -684,7 +691,7 @@ form#add_new_status_email_form:after {
684
  clear: both;
685
  }
686
  #add_new_status_email_form .form-table .wp-editor-wrap,.ac-small .form-table .wp-editor-wrap{
687
- width: 500px;
688
  }
689
  #add_new_status_email_form .form-table .wp-editor-wrap iframe,#add_new_status_email_form .form-table .wp-editor-wrap textarea{
690
  height: 200px !important;
@@ -708,6 +715,48 @@ span.email_status_span i{
708
  span.email_status_span i.enable{
709
  color: #83bd31;
710
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711
  @media screen and (max-width: 1150px) {
712
  .zorem_admin_layout {
713
  display: block;
@@ -716,6 +765,23 @@ span.email_status_span i.enable{
716
  width: auto;
717
  display: block;
718
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  }
720
 
721
  @media screen and (max-width: 650px) {
139
  padding-right: 20px;
140
  }
141
  .zorem_admin_sidebar {
142
+ width: 260px;
143
  padding-right: 20px;
144
  display: table-cell;
145
  vertical-align: top;
285
  .zorem_admin_layout .form-table th.titledesc {
286
  width: 50%;
287
  }
288
+ .woocommerce .zorem_admin_layout table.form-table th.th_80 {
289
  width: 80%;
290
  }
291
+ .woocommerce .zorem_admin_layout table.form-table th.th_20 {
292
  width: 20%;
293
  }
 
 
 
 
 
 
294
  .bulk_instruction_ul{
295
  display: block;
296
  list-style-type: disc;
425
  line-height: 30px;
426
  height: 32px;
427
  }
428
+ .wp-core-ui .btn_green2 {
429
+ background: #83bd31;
430
+ text-shadow: none;
431
+ border-color: #83bd31;
432
+ box-shadow: none;
433
+ font-size: 14px;
434
+ line-height: 30px;
435
+ height: 32px;
436
+ }
437
  .wp-core-ui .btn_red {
438
  background: red;
439
  text-shadow: none;
457
  text-shadow: none;
458
  box-shadow: inset 0 0 0 100px rgba(0,0,0,0.2);
459
  }
460
+ .wp-core-ui .btn_green2:hover,.wp-core-ui .btn_green2:focus{
461
+ background: rgba(131, 189, 49, 0.8);
462
+ border-color: rgba(131, 189, 49, 0.8);
463
+ color: #fff;
464
+ text-shadow: none;
465
+ box-shadow: inset 0 0 0 100px rgba(0,0,0,0.2);
466
+ }
467
  .on_edit_show.custom_provider_name{
468
  margin: 10px 0;
469
  }
480
  .woocommerce .tracking_info_design table.form-table input.regular-input,.woocommerce .tracking_info_design table.form-table input[type=text], .woocommerce .tracking_info_design table.form-table textarea{
481
  width: 65%;
482
  }
 
 
 
483
  #wc_ast_upload_csv_form .mdl-progress{
484
  width: 100%;
485
  }
589
  box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
590
  }
591
  .ac-container input:checked ~ article.ac-small{
592
+ height: 880px;
593
  overflow: auto;
594
  }
595
  .ac-container table.form-table td input[type=text]{
691
  clear: both;
692
  }
693
  #add_new_status_email_form .form-table .wp-editor-wrap,.ac-small .form-table .wp-editor-wrap{
694
+ width: 100%;
695
  }
696
  #add_new_status_email_form .form-table .wp-editor-wrap iframe,#add_new_status_email_form .form-table .wp-editor-wrap textarea{
697
  height: 200px !important;
715
  span.email_status_span i.enable{
716
  color: #83bd31;
717
  }
718
+ .woocommerce .zorem_admin_layout table.form-table th{
719
+ width: 30%;
720
+ }
721
+ .label_content{
722
+ font-weight: 600;
723
+ padding: 12px;
724
+ }
725
+ .ac-container article .variable_div.variable_before_content{
726
+ display:none;
727
+ }
728
+ #add_new_status_email_form .variable_div.variable_before_content{
729
+ display:none;
730
+ }
731
+ @media screen and (max-width: 1260px) and (min-width: 1151px){
732
+ .ac-container article .variable_div{
733
+ display:none;
734
+ }
735
+ #add_new_status_email_form .variable_div{
736
+ display:none !important;
737
+ }
738
+ .ac-container article .variable_div.variable_before_content{
739
+ display:block;
740
+ }
741
+ #add_new_status_email_form .variable_div.variable_before_content{
742
+ display:block !important;
743
+ }
744
+ .ac-container article .variable_div.variable_before_content{
745
+ width: 625px;
746
+ float: none;
747
+ padding: 12px;
748
+ }
749
+ #add_new_status_email_form .variable_div.variable_before_content{
750
+ width: 625px;
751
+ float: none;
752
+ }
753
+ .ac-small .form-table .wp-editor-wrap,#add_new_status_email_form .form-table .wp-editor-wrap{
754
+ width: 625px;
755
+ }
756
+ .ac-container input:checked ~ article.ac-small{
757
+ height: 990px;
758
+ }
759
+ }
760
  @media screen and (max-width: 1150px) {
761
  .zorem_admin_layout {
762
  display: block;
765
  width: auto;
766
  display: block;
767
  }
768
+ #add_new_status_email_form .variable_div{
769
+ display:none !important;
770
+ }
771
+ #add_new_status_email_form .variable_div.variable_before_content{
772
+ display:block !important;
773
+ }
774
+ .ac-container article .variable_div.variable_before_content{
775
+ display:block;
776
+ }
777
+ .ac-container article .variable_div.variable_before_content,#add_new_status_email_form .variable_div.variable_before_content{
778
+ width: 625px;
779
+ float: none;
780
+ padding: 12px;
781
+ }
782
+ .ac-small .form-table .wp-editor-wrap,#add_new_status_email_form .form-table .wp-editor-wrap{
783
+ width: 625px;
784
+ }
785
  }
786
 
787
  @media screen and (max-width: 650px) {
assets/images/Advanced-Shipment-Tracking-for-WooCommerce-Shop-thumbnail.jpg ADDED
Binary file
assets/js/shipping_row.js CHANGED
@@ -590,18 +590,19 @@ jQuery(document).on("submit", "#wc_ast_upload_csv_form", function(){
590
  reader.onload = function (e) {
591
  var trackings = new Array();
592
  var rows = e.target.result.split("\r\n");
 
593
  for (var i = 1; i < rows.length; i++) {
594
  var cells = rows[i].split(",");
595
  if (cells.length > 1) {
596
  var tracking = {};
597
- tracking.order_id = cells[0];
598
  tracking.tracking_provider = cells[1];
599
  tracking.tracking_number = cells[2];
600
  tracking.date_shipped = cells[3];
601
  tracking.status_shipped = cells[4];
602
- trackings.push(tracking);
603
-
604
-
605
  }
606
  }
607
  var csv_length = trackings.length;
@@ -618,6 +619,7 @@ jQuery(document).on("submit", "#wc_ast_upload_csv_form", function(){
618
  var date_shipped = trackings[index]['date_shipped'];
619
  var status_shipped = trackings[index]['status_shipped'];
620
  //console.log(order_id);
 
621
  var data = {
622
  action: 'wc_ast_upload_csv_form_update',
623
  order_id: order_id,
@@ -654,7 +656,7 @@ jQuery(document).on("submit", "#wc_ast_upload_csv_form", function(){
654
 
655
  jQuery.ajaxQueue.addRequest(option);
656
 
657
- jQuery.ajaxQueue.run();
658
 
659
  });
660
  }
590
  reader.onload = function (e) {
591
  var trackings = new Array();
592
  var rows = e.target.result.split("\r\n");
593
+
594
  for (var i = 1; i < rows.length; i++) {
595
  var cells = rows[i].split(",");
596
  if (cells.length > 1) {
597
  var tracking = {};
598
+ tracking.order_id = cells[0];
599
  tracking.tracking_provider = cells[1];
600
  tracking.tracking_number = cells[2];
601
  tracking.date_shipped = cells[3];
602
  tracking.status_shipped = cells[4];
603
+ if(tracking.order_id){
604
+ trackings.push(tracking);
605
+ }
606
  }
607
  }
608
  var csv_length = trackings.length;
619
  var date_shipped = trackings[index]['date_shipped'];
620
  var status_shipped = trackings[index]['status_shipped'];
621
  //console.log(order_id);
622
+
623
  var data = {
624
  action: 'wc_ast_upload_csv_form_update',
625
  order_id: order_id,
656
 
657
  jQuery.ajaxQueue.addRequest(option);
658
 
659
+ jQuery.ajaxQueue.run();
660
 
661
  });
662
  }
includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -567,8 +567,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
567
  ) );
568
  if (isset($_GET['page']) && $_GET['page'] == 'woocommerce-advanced-shipment-tracking') {
569
  wp_enqueue_media();
570
- } ?>
571
- <div style="display: none"><?php wp_editor( '', 'automatewoo_editor' ); ?></div>
572
  <?php
573
  }
574
 
@@ -661,7 +660,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
661
  //echo '<pre>';print_r($site_list);echo '</pre>';
662
  wp_enqueue_script( 'shipment_tracking_table_rows' );
663
  ?>
664
- <h3><?php _e('WooCommerce Advanced Shipment Tracking', 'woo-advanced-shipment-tracking'); ?></h3>
665
  <div class="wrap woocommerce zorem_admin_layout">
666
  <div class="zorem_admin_content" >
667
 
@@ -710,6 +709,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
710
  <span class="sorting-indicator"></span>
711
  </a>
712
  </th>
 
713
  <th class="manage-column column-status">
714
  <span><?php _e('Status', 'woo-advanced-shipment-tracking'); ?></span>
715
  <span class="mdl-list__item-secondary-action" style="display: inline-block;">
@@ -718,8 +718,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
718
  <input type="checkbox" name="select_custom_provider[]" id="list-switch" class="mdl-switch__input bulk_status_change" value="" />
719
  </label>
720
  </span>
721
- </th>
722
- <th class="manage-column column-tracking-url" ></th>
723
  <th class="manage-column column-action" scope="col"></th>
724
  </tr>
725
  </thead>
@@ -773,6 +772,13 @@ class WC_Advanced_Shipment_Tracking_Admin {
773
  <?php } ?>
774
  </select>
775
  <?php } ?>
 
 
 
 
 
 
 
776
  </td>
777
  <td class="column-columnname status-column">
778
  <span class="mdl-list__item-secondary-action">
@@ -780,13 +786,6 @@ class WC_Advanced_Shipment_Tracking_Admin {
780
  <input type="checkbox" name="select_custom_provider[]" id="list-switch-<?php echo $d_s_p->id; ?>" class="mdl-switch__input status_slide" value="<?php echo $d_s_p->id; ?>" <?php if($d_s_p->display_in_order == 1) { echo 'checked'; } ?> />
781
  </label>
782
  </span>
783
- </td>
784
- <td class="column-columnname url-column">
785
- <a href="<?php echo $d_s_p->provider_url; ?>" title="<?php echo $d_s_p->provider_url; ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
786
- </a>
787
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
788
- <input type="text" class="text on_edit_show custom_provider_url" name="data[<?php echo $d_s_p->id?>][provider_url]" value="<?php echo $d_s_p->provider_url;?>" placeholder="<?php _e( 'Shipping URL', 'woo-advanced-shipment-tracking' ); ?>">
789
- <?php }?>
790
  </td>
791
  <td class="column-columnname">
792
  <?php if( $d_s_p->shipping_default == 0 ){ ?>
@@ -900,7 +899,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
900
  </section>
901
  <section id="content4" class="tab_section">
902
  <div class="mdl-grid">
903
- <div class="mdl-cell mdl-cell--6-col upload_csv_section">
904
  <form method="post" id="wc_ast_upload_csv_form" action="" enctype="multipart/form-data">
905
  <h3><?php _e('Upload CSV', 'woo-advanced-shipment-tracking'); ?></h3>
906
  <table class="form-table upload_csv_table">
@@ -909,13 +908,10 @@ class WC_Advanced_Shipment_Tracking_Admin {
909
  <td scope="row" class="input_file_cl">
910
  <input type="file" name="trcking_csv_file" id="trcking_csv_file">
911
  </td>
912
- <td scope="row" class="">
913
-
914
- </td>
915
  </tr>
916
  <tr valign="top" class="">
917
  <th scope="row" class="th_80">
918
- <label for="replace_tracking_info"><?php _e('Replace tracking info if exists? (if not checked, the tracking info will be added)', 'woo-advanced-shipment-tracking'); ?></label>
919
  </th>
920
  <td scope="row" class="th_20">
921
  <input type="checkbox" id="replace_tracking_info" name="replace_tracking_info" class="" value="1"/>
@@ -933,6 +929,10 @@ class WC_Advanced_Shipment_Tracking_Admin {
933
  <?php wp_nonce_field( 'wc_ast_upload_csv_form', 'wc_ast_upload_csv_form' );?>
934
  <input type="hidden" name="action" value="wc_ast_upload_csv_form_update">
935
  </div>
 
 
 
 
936
  <div id="p1" class="mdl-progress mdl-js-progress" style="display:none;"></div>
937
  <h3 class="progress_title" style="display:none;"><?php _e('Upload Progress - ', 'woo-advanced-shipment-tracking'); ?><span class="progress_number"></span></h3>
938
  <ol class="csv_upload_status">
@@ -940,7 +940,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
940
  </ol>
941
  </form>
942
  </div>
943
- <div class="mdl-cell mdl-cell--6-col">
944
  <h3><?php _e('Bulk import tracking info', 'woo-advanced-shipment-tracking'); ?></h3>
945
  <p><?php _e('Upload multiple tracking # to orders from CSV file. Option to download a CSV file with example with the fields format:', 'woo-advanced-shipment-tracking'); ?></p>
946
  <ul class="bulk_instruction_ul">
@@ -950,8 +950,8 @@ class WC_Advanced_Shipment_Tracking_Admin {
950
  <li><?php _e('date_shipped (Optional) Shipping date - Date format DD/MM/YYYY - if not added, we set the upload date.', 'woo-advanced-shipment-tracking'); ?></li>
951
  <li><?php _e('status_shipped (1=yes, 0=no) (Optional) Change order status to “Shipped” (completed) - if this field in null, we will treat it as 0', 'woo-advanced-shipment-tracking'); ?></li>
952
  </ul>
953
- <a class="button-primary btn_green" href="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>/tracking.csv" download><?php _e('Download sample csv file', 'woo-advanced-shipment-tracking'); ?></a>
954
- </div>
955
  </div>
956
  </section>
957
  <section id="content5" class="tab_section">
@@ -1045,10 +1045,25 @@ class WC_Advanced_Shipment_Tracking_Admin {
1045
  </td>
1046
  </tr>
1047
  <tr valign="top" class="hide_default show_if_any">
1048
- <th scope="row" class="">
1049
  <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
1050
- </th>
1051
- <td scope="row" class="">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1052
  <?php
1053
  $content = '';
1054
  $editor_id = 'email_content';
@@ -1062,10 +1077,9 @@ class WC_Advanced_Shipment_Tracking_Admin {
1062
  'quicktags' => true,
1063
  'editor_height' => 200,
1064
  ]);
1065
- //wp_editor( $content, $editor_id, $settings );?>
1066
- <!--textarea id="email_content" name="<?php echo $editor_id; ?>"></textarea-->
1067
- </td>
1068
- </tr>
1069
  </tbody>
1070
  </table>
1071
  <div class="variable_div hide_default show_if_any">
@@ -1097,37 +1111,37 @@ class WC_Advanced_Shipment_Tracking_Admin {
1097
  <?php
1098
  $plugin_array = array(
1099
  0 => array(
1100
- 'name' => 'WooCommerce Product Country Base Restrictions',
1101
  'url' => 'https://wordpress.org/plugins/woo-product-country-base-restrictions/',
1102
  'img' => 'WooCommerce-Country-Based-Restrictions-thumbnail.jpg',
1103
  ),
1104
  1 => array(
1105
- 'name' => 'WooCommerce Shop Manager Admin Bar',
1106
  'url' => 'https://wordpress.org/plugins/woo-shop-manager-admin-bar/',
1107
  'img' => 'woocommerce-shop-manager-admin-bar-thumbnail.jpg',
1108
  ),
1109
  2 => array(
1110
- 'name' => 'WooCommerce Advanced Sales Report Email',
1111
  'url' => 'https://wordpress.org/plugins/woo-advanced-sales-report-email/',
1112
  'img' => 'woocommerce-advanced-sales-report-email-thumbnail.jpg',
1113
  ),
1114
  3 => array(
1115
- 'name' => 'WooCommerce Ajax Login/Register',
1116
  'url' => 'https://wordpress.org/plugins/woo-ajax-loginregister/',
1117
  'img' => 'WooCommerce-Ajax-Login-Register-thumbnail.jpg',
1118
  ),
1119
  4 => array(
1120
- 'name' => 'WooCommerce Sales Report By Country',
1121
  'url' => 'https://wordpress.org/plugins/woo-sales-by-country-reports/',
1122
  'img' => 'country-based-report-banner-thumbnail.jpg',
1123
  ),
1124
  5 => array(
1125
- 'name' => 'WooCommerce Sales Report for WP-Lister',
1126
  'url' => 'https://wordpress.org/plugins/woo-sales-report-for-wp-lister/',
1127
  'img' => 'WooCommerce-Sales-Report-for-WP-Lister-thumbnail.jpg',
1128
  ),
1129
  6 => array(
1130
- 'name' => 'WooCommerce Bit Payment Gateway',
1131
  'url' => 'https://wordpress.org/plugins/woo-bit-payment-gateway/',
1132
  'img' => 'WooCommerce-Bit-payment-thumbnail.jpg',
1133
  ),
@@ -1213,10 +1227,12 @@ class WC_Advanced_Shipment_Tracking_Admin {
1213
  <fieldset>
1214
  <textarea name="<?php echo $id?>" id="<?php echo $id?>"><?php echo get_option($id)?></textarea>
1215
  </fieldset>
1216
- <?php } else { ?>
 
 
1217
 
1218
  <fieldset>
1219
- <input class="input-text regular-input " type="text" name="<?php echo $id?>" id="<?php echo $id?>" style="" value="<?php echo get_option($id)?>" placeholder="<?php echo $array['placeholder'];?>">
1220
  </fieldset>
1221
  <?php } ?>
1222
  <!--p class="description"><?php echo (isset($array['desc']))? $array['desc']: ''?></p-->
@@ -1665,6 +1681,13 @@ class WC_Advanced_Shipment_Tracking_Admin {
1665
  <?php } ?>
1666
  </select>
1667
  <?php } ?>
 
 
 
 
 
 
 
1668
  </td>
1669
  <td class="column-columnname">
1670
  <span class="mdl-list__item-secondary-action">
@@ -1672,13 +1695,6 @@ class WC_Advanced_Shipment_Tracking_Admin {
1672
  <input type="checkbox" name="select_custom_provider[]" id="list-switch-<?php echo $d_s_p->id; ?>" class="mdl-switch__input status_slide" value="<?php echo $d_s_p->id; ?>" <?php if($d_s_p->display_in_order == 1) { echo 'checked'; } ?> />
1673
  </label>
1674
  </span>
1675
- </td>
1676
- <td class="column-columnname url-column">
1677
- <a href="<?php echo $d_s_p->provider_url; ?>" title="<?php echo $d_s_p->provider_url; ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page', 'woo-advanced-shipment-tracking' ); ?>
1678
- </a>
1679
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
1680
- <input type="text" class="text on_edit_show custom_provider_url" name="data[<?php echo $d_s_p->id?>][provider_url]" value="<?php echo $d_s_p->provider_url;?>" placeholder="<?php _e( 'Shipping URL', 'woo-advanced-shipment-tracking' ); ?>">
1681
- <?php }?>
1682
  </td>
1683
  <td class="column-columnname">
1684
  <?php if( $d_s_p->shipping_default == 0 ){ ?>
@@ -1766,9 +1782,75 @@ class WC_Advanced_Shipment_Tracking_Admin {
1766
  $wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
1767
 
1768
  $replace_tracking_info = $_POST['replace_tracking_info'];
1769
- $order_id = $_POST['order_id'];
1770
-
1771
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1772
 
1773
  $tracking_provider = $_POST['tracking_provider'];
1774
  $tracking_number = $_POST['tracking_number'];
@@ -1793,7 +1875,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1793
  }
1794
 
1795
  if($replace_tracking_info == 1){
1796
- $order = wc_get_order($_POST['order_id']);
1797
 
1798
  if($order){
1799
  $tracking_items = $wast->get_tracking_items( $order_id );
@@ -1814,13 +1896,13 @@ class WC_Advanced_Shipment_Tracking_Admin {
1814
  'date_shipped' => wc_clean( $_POST['date_shipped'] ),
1815
  'status_shipped' => wc_clean( $_POST['status_shipped'] ),
1816
  );
1817
- $order = wc_get_order($_POST['order_id']);
1818
  //echo '<pre>';print_r($order);echo '</pre>';exit;
1819
  if ( $order === false ) {
1820
- echo '<li class="error">Failed - Invalid Order Id</li>';exit;
1821
  } else{
1822
- $wast->add_tracking_item( $_POST['order_id'], $args );
1823
- echo '<li class="success">Success - Successfully added</li>';
1824
  exit;
1825
  }
1826
 
@@ -2044,10 +2126,25 @@ class WC_Advanced_Shipment_Tracking_Admin {
2044
  </td>
2045
  </tr>
2046
  <tr valign="top" class="">
2047
- <th scope="row" class="">
2048
  <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
2049
- </th>
2050
- <td scope="row" class="">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2051
  <?php
2052
  add_filter( 'wp_default_editor', create_function('', 'return "visual";') );
2053
  $content = $email_list->email_content;
@@ -2065,7 +2162,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
2065
  ]);
2066
  ?>
2067
  <!--textarea name="<?php echo $editor_id; ?>"><?php echo $content; ?></textarea-->
2068
- </td>
2069
  </tr>
2070
  <tr valign="top" class="">
2071
  <th scope="row" class="" colspan="2">
567
  ) );
568
  if (isset($_GET['page']) && $_GET['page'] == 'woocommerce-advanced-shipment-tracking') {
569
  wp_enqueue_media();
570
+ } ?>
 
571
  <?php
572
  }
573
 
660
  //echo '<pre>';print_r($site_list);echo '</pre>';
661
  wp_enqueue_script( 'shipment_tracking_table_rows' );
662
  ?>
663
+ <h3><?php _e('Advanced Shipment Tracking for WooCommerce', 'woo-advanced-shipment-tracking'); ?></h3>
664
  <div class="wrap woocommerce zorem_admin_layout">
665
  <div class="zorem_admin_content" >
666
 
709
  <span class="sorting-indicator"></span>
710
  </a>
711
  </th>
712
+ <th class="manage-column column-tracking-url" ></th>
713
  <th class="manage-column column-status">
714
  <span><?php _e('Status', 'woo-advanced-shipment-tracking'); ?></span>
715
  <span class="mdl-list__item-secondary-action" style="display: inline-block;">
718
  <input type="checkbox" name="select_custom_provider[]" id="list-switch" class="mdl-switch__input bulk_status_change" value="" />
719
  </label>
720
  </span>
721
+ </th>
 
722
  <th class="manage-column column-action" scope="col"></th>
723
  </tr>
724
  </thead>
772
  <?php } ?>
773
  </select>
774
  <?php } ?>
775
+ </td>
776
+ <td class="column-columnname url-column">
777
+ <a href="<?php echo $d_s_p->provider_url; ?>" title="<?php echo $d_s_p->provider_url; ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
778
+ </a>
779
+ <?php if( $d_s_p->shipping_default == 0 ){ ?>
780
+ <input type="text" class="text on_edit_show custom_provider_url" name="data[<?php echo $d_s_p->id?>][provider_url]" value="<?php echo $d_s_p->provider_url;?>" placeholder="<?php _e( 'Shipping URL', 'woo-advanced-shipment-tracking' ); ?>">
781
+ <?php }?>
782
  </td>
783
  <td class="column-columnname status-column">
784
  <span class="mdl-list__item-secondary-action">
786
  <input type="checkbox" name="select_custom_provider[]" id="list-switch-<?php echo $d_s_p->id; ?>" class="mdl-switch__input status_slide" value="<?php echo $d_s_p->id; ?>" <?php if($d_s_p->display_in_order == 1) { echo 'checked'; } ?> />
787
  </label>
788
  </span>
 
 
 
 
 
 
 
789
  </td>
790
  <td class="column-columnname">
791
  <?php if( $d_s_p->shipping_default == 0 ){ ?>
899
  </section>
900
  <section id="content4" class="tab_section">
901
  <div class="mdl-grid">
902
+ <div class="mdl-cell mdl-cell--12-col">
903
  <form method="post" id="wc_ast_upload_csv_form" action="" enctype="multipart/form-data">
904
  <h3><?php _e('Upload CSV', 'woo-advanced-shipment-tracking'); ?></h3>
905
  <table class="form-table upload_csv_table">
908
  <td scope="row" class="input_file_cl">
909
  <input type="file" name="trcking_csv_file" id="trcking_csv_file">
910
  </td>
 
 
 
911
  </tr>
912
  <tr valign="top" class="">
913
  <th scope="row" class="th_80">
914
+ <label for="replace_tracking_info"><?php _e('Replace tracking info if exists? (if not checked, the tracking info will be added)', 'woo-advanced-shipment-tracking'); ?></label>
915
  </th>
916
  <td scope="row" class="th_20">
917
  <input type="checkbox" id="replace_tracking_info" name="replace_tracking_info" class="" value="1"/>
929
  <?php wp_nonce_field( 'wc_ast_upload_csv_form', 'wc_ast_upload_csv_form' );?>
930
  <input type="hidden" name="action" value="wc_ast_upload_csv_form_update">
931
  </div>
932
+ <hr>
933
+ <p>You can download an example of the csv file:</p>
934
+ <a class="button-primary btn_green2" href="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>/tracking.csv"><?php _e('Download sample csv file', 'woo-advanced-shipment-tracking'); ?></a>
935
+ <p>For detailed instructions on how to upload tracking info in bulk, see our <a class="" href="https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/bulk-import-shipment-tracking/" target="blank">documantation</a>.</p>
936
  <div id="p1" class="mdl-progress mdl-js-progress" style="display:none;"></div>
937
  <h3 class="progress_title" style="display:none;"><?php _e('Upload Progress - ', 'woo-advanced-shipment-tracking'); ?><span class="progress_number"></span></h3>
938
  <ol class="csv_upload_status">
940
  </ol>
941
  </form>
942
  </div>
943
+ <!--div class="mdl-cell mdl-cell--6-col">
944
  <h3><?php _e('Bulk import tracking info', 'woo-advanced-shipment-tracking'); ?></h3>
945
  <p><?php _e('Upload multiple tracking # to orders from CSV file. Option to download a CSV file with example with the fields format:', 'woo-advanced-shipment-tracking'); ?></p>
946
  <ul class="bulk_instruction_ul">
950
  <li><?php _e('date_shipped (Optional) Shipping date - Date format DD/MM/YYYY - if not added, we set the upload date.', 'woo-advanced-shipment-tracking'); ?></li>
951
  <li><?php _e('status_shipped (1=yes, 0=no) (Optional) Change order status to “Shipped” (completed) - if this field in null, we will treat it as 0', 'woo-advanced-shipment-tracking'); ?></li>
952
  </ul>
953
+
954
+ </div-->
955
  </div>
956
  </section>
957
  <section id="content5" class="tab_section">
1045
  </td>
1046
  </tr>
1047
  <tr valign="top" class="hide_default show_if_any">
1048
+ <th scope="row" class="" colspan="2">
1049
  <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
1050
+ </th>
1051
+ </tr>
1052
+ <tr valign="top" class="hide_default show_if_any" colspan="2">
1053
+ <th scope="row" class="" colspan="2">
1054
+ <div class="variable_div variable_before_content">
1055
+ <h4 style="margin:0;"><?php _e('Variables', 'woo-advanced-shipment-tracking'); ?></h4>
1056
+ <div class="variable_tag" id="variable_tag" ><input type="text" id="var_input" value="{site_title}" style="width: 90px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1057
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_email}" style="width: 115px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1058
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_first_name}"style="width: 150px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1059
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_last_name}" style="width: 145px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1060
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_username}" style="width: 135px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1061
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{order_number}" style="width: 103px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1062
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{order_details}" style="width: 110px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1063
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{tracking_details}" style="width: 130px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1064
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{shipping_address}" style="width: 130px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1065
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{billing_address}"style="width: 125px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
1066
+ </div>
1067
  <?php
1068
  $content = '';
1069
  $editor_id = 'email_content';
1077
  'quicktags' => true,
1078
  'editor_height' => 200,
1079
  ]);
1080
+ //wp_editor( $content, $editor_id, $settings );?>
1081
+ </th>
1082
+ </tr>
 
1083
  </tbody>
1084
  </table>
1085
  <div class="variable_div hide_default show_if_any">
1111
  <?php
1112
  $plugin_array = array(
1113
  0 => array(
1114
+ 'name' => 'Country Based Restrictions for WooCommerce',
1115
  'url' => 'https://wordpress.org/plugins/woo-product-country-base-restrictions/',
1116
  'img' => 'WooCommerce-Country-Based-Restrictions-thumbnail.jpg',
1117
  ),
1118
  1 => array(
1119
+ 'name' => 'Shop Manager Admin Bar for WooCommerce',
1120
  'url' => 'https://wordpress.org/plugins/woo-shop-manager-admin-bar/',
1121
  'img' => 'woocommerce-shop-manager-admin-bar-thumbnail.jpg',
1122
  ),
1123
  2 => array(
1124
+ 'name' => 'Sales Report Email for WooCommerce',
1125
  'url' => 'https://wordpress.org/plugins/woo-advanced-sales-report-email/',
1126
  'img' => 'woocommerce-advanced-sales-report-email-thumbnail.jpg',
1127
  ),
1128
  3 => array(
1129
+ 'name' => 'Ajax Login/Register for WooCommerce',
1130
  'url' => 'https://wordpress.org/plugins/woo-ajax-loginregister/',
1131
  'img' => 'WooCommerce-Ajax-Login-Register-thumbnail.jpg',
1132
  ),
1133
  4 => array(
1134
+ 'name' => 'Sales Report By Country for WooCommerce',
1135
  'url' => 'https://wordpress.org/plugins/woo-sales-by-country-reports/',
1136
  'img' => 'country-based-report-banner-thumbnail.jpg',
1137
  ),
1138
  5 => array(
1139
+ 'name' => 'Sales Report for WooCommerce & WP-Lister',
1140
  'url' => 'https://wordpress.org/plugins/woo-sales-report-for-wp-lister/',
1141
  'img' => 'WooCommerce-Sales-Report-for-WP-Lister-thumbnail.jpg',
1142
  ),
1143
  6 => array(
1144
+ 'name' => 'Bit Payment Gateway for WooCommerce',
1145
  'url' => 'https://wordpress.org/plugins/woo-bit-payment-gateway/',
1146
  'img' => 'WooCommerce-Bit-payment-thumbnail.jpg',
1147
  ),
1227
  <fieldset>
1228
  <textarea name="<?php echo $id?>" id="<?php echo $id?>"><?php echo get_option($id)?></textarea>
1229
  </fieldset>
1230
+ <?php } else {
1231
+
1232
+ ?>
1233
 
1234
  <fieldset>
1235
+ <input class="input-text regular-input " type="text" name="<?php echo $id?>" id="<?php echo $id?>" style="" value="<?php echo get_option($id)?>" placeholder="<?php if(!empty($array['placeholder'])){echo $array['placeholder'];} ?>">
1236
  </fieldset>
1237
  <?php } ?>
1238
  <!--p class="description"><?php echo (isset($array['desc']))? $array['desc']: ''?></p-->
1681
  <?php } ?>
1682
  </select>
1683
  <?php } ?>
1684
+ </td>
1685
+ <td class="column-columnname url-column">
1686
+ <a href="<?php echo $d_s_p->provider_url; ?>" title="<?php echo $d_s_p->provider_url; ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page', 'woo-advanced-shipment-tracking' ); ?>
1687
+ </a>
1688
+ <?php if( $d_s_p->shipping_default == 0 ){ ?>
1689
+ <input type="text" class="text on_edit_show custom_provider_url" name="data[<?php echo $d_s_p->id?>][provider_url]" value="<?php echo $d_s_p->provider_url;?>" placeholder="<?php _e( 'Shipping URL', 'woo-advanced-shipment-tracking' ); ?>">
1690
+ <?php }?>
1691
  </td>
1692
  <td class="column-columnname">
1693
  <span class="mdl-list__item-secondary-action">
1695
  <input type="checkbox" name="select_custom_provider[]" id="list-switch-<?php echo $d_s_p->id; ?>" class="mdl-switch__input status_slide" value="<?php echo $d_s_p->id; ?>" <?php if($d_s_p->display_in_order == 1) { echo 'checked'; } ?> />
1696
  </label>
1697
  </span>
 
 
 
 
 
 
 
1698
  </td>
1699
  <td class="column-columnname">
1700
  <?php if( $d_s_p->shipping_default == 0 ){ ?>
1782
  $wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
1783
 
1784
  $replace_tracking_info = $_POST['replace_tracking_info'];
1785
+ $order_id = $_POST['order_id'];
1786
+
1787
+ if ( is_plugin_active( 'custom-order-numbers-for-woocommerce/custom-order-numbers-for-woocommerce.php' ) ) {
1788
+ $alg_wc_custom_order_numbers_enabled = get_option('alg_wc_custom_order_numbers_enabled');
1789
+ if($alg_wc_custom_order_numbers_enabled == 'yes'){
1790
+ $args = array(
1791
+ 'post_type' => 'shop_order',
1792
+ 'posts_per_page' => '1',
1793
+ 'meta_query' => array(
1794
+ 'relation' => 'AND',
1795
+ array(
1796
+ 'key' => '_alg_wc_custom_order_number',
1797
+ 'value' => $order_id
1798
+ ),
1799
+ ),
1800
+ 'post_status' => array('wc-pending', 'wc-processing', 'wc-on-hold', 'wc-completed', 'wc-delivered', 'wc-cancelled', 'wc-refunded', 'wc-failed','wc-bit-payment') ,
1801
+ );
1802
+ $posts = get_posts( $args );
1803
+ $my_query = new WP_Query( $args );
1804
+
1805
+ if( $my_query->have_posts() ) {
1806
+ while( $my_query->have_posts()) {
1807
+ $my_query->the_post();
1808
+ if(get_the_ID()){
1809
+ $order_id = get_the_ID();
1810
+ }
1811
+ } // end while
1812
+ } // end if
1813
+ wp_reset_postdata();
1814
+ }
1815
+ }
1816
+
1817
+ if ( is_plugin_active( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php' ) ) {
1818
+
1819
+ $s_order_id = wc_sequential_order_numbers()->find_order_by_order_number( $order_id );
1820
+ if($s_order_id){
1821
+ $order_id = $s_order_id;
1822
+ }
1823
+ }
1824
+
1825
+ if ( is_plugin_active( 'wp-lister-amazon/wp-lister-amazon.php' ) ) {
1826
+ $wpla_use_amazon_order_number = get_option( 'wpla_use_amazon_order_number' );
1827
+ if($wpla_use_amazon_order_number == 1){
1828
+ $args = array(
1829
+ 'post_type' => 'shop_order',
1830
+ 'posts_per_page' => '1',
1831
+ 'meta_query' => array(
1832
+ 'relation' => 'AND',
1833
+ array(
1834
+ 'key' => '_wpla_amazon_order_id',
1835
+ 'value' => $order_id
1836
+ ),
1837
+ ),
1838
+ 'post_status' => array('wc-pending', 'wc-processing', 'wc-on-hold', 'wc-completed', 'wc-delivered', 'wc-cancelled', 'wc-refunded', 'wc-failed','wc-bit-payment') ,
1839
+ );
1840
+ $posts = get_posts( $args );
1841
+ $my_query = new WP_Query( $args );
1842
+
1843
+ if( $my_query->have_posts() ) {
1844
+ while( $my_query->have_posts()) {
1845
+ $my_query->the_post();
1846
+ if(get_the_ID()){
1847
+ $order_id = get_the_ID();
1848
+ }
1849
+ } // end while
1850
+ } // end if
1851
+ wp_reset_postdata();
1852
+ }
1853
+ }
1854
 
1855
  $tracking_provider = $_POST['tracking_provider'];
1856
  $tracking_number = $_POST['tracking_number'];
1875
  }
1876
 
1877
  if($replace_tracking_info == 1){
1878
+ $order = wc_get_order($order_id);
1879
 
1880
  if($order){
1881
  $tracking_items = $wast->get_tracking_items( $order_id );
1896
  'date_shipped' => wc_clean( $_POST['date_shipped'] ),
1897
  'status_shipped' => wc_clean( $_POST['status_shipped'] ),
1898
  );
1899
+ $order = wc_get_order($order_id);
1900
  //echo '<pre>';print_r($order);echo '</pre>';exit;
1901
  if ( $order === false ) {
1902
+ echo '<li class="error">Failed - Invalid Order Id - '.$_POST['order_id'].'</li>';exit;
1903
  } else{
1904
+ $wast->add_tracking_item( $order_id, $args );
1905
+ echo '<li class="success">Success - Successfully added tracking info for Order Id- '.$_POST['order_id'].'</li>';
1906
  exit;
1907
  }
1908
 
2126
  </td>
2127
  </tr>
2128
  <tr valign="top" class="">
2129
+ <th scope="row" class="" colspan="2">
2130
  <label for=""><?php _e('Email content', 'woo-advanced-shipment-tracking'); ?></label>
2131
+ </th>
2132
+ </tr>
2133
+ <tr valign="top" class="">
2134
+ <th scope="row" class="" colspan="2">
2135
+ <div class="variable_div variable_before_content">
2136
+ <h4><?php _e('Variables', 'woo-advanced-shipment-tracking'); ?></h4>
2137
+ <div class="variable_tag" id="variable_tag" ><input type="text" id="var_input" value="{site_title}" style="width: 90px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2138
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_email}" style="width: 115px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2139
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_first_name}"style="width: 150px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2140
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_last_name}" style="width: 145px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2141
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{customer_username}" style="width: 135px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2142
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{order_number}" style="width: 103px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2143
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{order_details}" style="width: 110px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2144
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{tracking_details}" style="width: 130px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2145
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{shipping_address}" style="width: 130px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2146
+ <div class="variable_tag" id="variable_tag"><input type="text" id="var_input" value="{billing_address}"style="width: 125px;"><span class="copy"><?php _e('Copied', 'woo-advanced-shipment-tracking'); ?></span></div>
2147
+ </div>
2148
  <?php
2149
  add_filter( 'wp_default_editor', create_function('', 'return "visual";') );
2150
  $content = $email_list->email_content;
2162
  ]);
2163
  ?>
2164
  <!--textarea name="<?php echo $editor_id; ?>"><?php echo $content; ?></textarea-->
2165
+ </th>
2166
  </tr>
2167
  <tr valign="top" class="">
2168
  <th scope="row" class="" colspan="2">
includes/class-wc-advanced-shipment-tracking.php CHANGED
@@ -561,6 +561,7 @@ class WC_Advanced_Shipment_Tracking_Actions {
561
  $tracking_item['custom_tracking_link'] = wc_clean( $args['custom_tracking_link'] );
562
  $tracking_item['tracking_number'] = wc_clean( $args['tracking_number'] );
563
  $tracking_item['date_shipped'] = wc_clean( strtotime( $args['date_shipped'] ) );
 
564
 
565
  if ( 0 == (int) $tracking_item['date_shipped'] ) {
566
  $tracking_item['date_shipped'] = time();
@@ -576,7 +577,10 @@ class WC_Advanced_Shipment_Tracking_Actions {
576
  $tracking_items[] = $tracking_item;
577
 
578
  $this->save_tracking_items( $order_id, $tracking_items );
579
-
 
 
 
580
  return $tracking_item;
581
  }
582
 
561
  $tracking_item['custom_tracking_link'] = wc_clean( $args['custom_tracking_link'] );
562
  $tracking_item['tracking_number'] = wc_clean( $args['tracking_number'] );
563
  $tracking_item['date_shipped'] = wc_clean( strtotime( $args['date_shipped'] ) );
564
+ $tracking_item['status_shipped'] = wc_clean( $args['status_shipped'] );
565
 
566
  if ( 0 == (int) $tracking_item['date_shipped'] ) {
567
  $tracking_item['date_shipped'] = time();
577
  $tracking_items[] = $tracking_item;
578
 
579
  $this->save_tracking_items( $order_id, $tracking_items );
580
+ if( !empty($tracking_item['status_shipped'] )){
581
+ $order = new WC_Order( $order_id );
582
+ $order->update_status('completed');
583
+ }
584
  return $tracking_item;
585
  }
586
 
includes/email-manager.php CHANGED
@@ -9,7 +9,7 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
9
  */
10
  public function __construct() {
11
  // template path
12
- define( 'CUSTOM_TEMPLATE_PATH', SHIPMENT_TRACKING_PATH . '/templates/' );
13
  // hook for when order status is changed
14
  // include the email class files
15
  add_filter( 'woocommerce_email_classes', array( $this, 'custom_init_emails' ));
@@ -177,7 +177,24 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
177
  }
178
 
179
  public function get_order_details($order_id, $order){
180
- ob_start(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  <div style="margin-bottom: 40px;">
182
  <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
183
  <thead>
@@ -188,65 +205,14 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
188
  </tr>
189
  </thead>
190
  <tbody>
191
- <?php
192
- foreach ( $order->get_items() as $item_id => $item ) :
193
- $product = $item->get_product();
194
- $sku = '';
195
- $purchase_note = '';
196
- $image = '';
197
-
198
- if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
199
- continue;
200
- }
201
-
202
- if ( is_object( $product ) ) {
203
- $sku = $product->get_sku();
204
- $purchase_note = $product->get_purchase_note();
205
- $image = $product->get_image( $image_size );
206
- }
207
-
208
- ?>
209
- <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
210
- <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;">
211
- <?php
212
-
213
- // Show title/image etc.
214
- if ( $show_image ) {
215
- echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
216
- }
217
-
218
- // Product name.
219
- echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
220
-
221
- // SKU.
222
- if ( $show_sku && $sku ) {
223
- echo wp_kses_post( ' (#' . $sku . ')' );
224
- }
225
-
226
- // allow other plugins to add additional product information here.
227
- do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
228
-
229
- wc_display_item_meta(
230
- $item,
231
- array(
232
- 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr( $text_align ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
233
- )
234
- );
235
-
236
- // allow other plugins to add additional product information here.
237
- do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
238
-
239
- ?>
240
- </td>
241
- <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
242
- <?php echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ) ); ?>
243
- </td>
244
- <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
245
- <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
246
- </td>
247
- </tr>
248
-
249
- <?php endforeach;
250
  ?>
251
  </tbody>
252
  <tfoot>
@@ -276,7 +242,7 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
276
  ?>
277
  </tfoot>
278
  </table>
279
- </div>
280
  <?php return ob_get_clean();
281
  }
282
 
@@ -285,6 +251,16 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
285
 
286
  if ( $tracking_items ){
287
  ob_start();
 
 
 
 
 
 
 
 
 
 
288
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
289
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
290
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); } else{ $email_border_size = "1"; }
@@ -378,9 +354,9 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
378
  $text_align = is_rtl() ? 'right' : 'left';
379
  $shipping = $order->get_formatted_shipping_address();
380
  ?>
381
- <table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
382
  <tr>
383
- <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
384
  <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%">
385
  <h2><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
386
 
@@ -397,7 +373,7 @@ class WC_Advanced_Shipment_Tracking_Email_Manager {
397
  $text_align = is_rtl() ? 'right' : 'left';
398
  $address = $order->get_formatted_billing_address();
399
  ?>
400
- <table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
401
  <tr>
402
  <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
403
  <h2><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
9
  */
10
  public function __construct() {
11
  // template path
12
+ if (!defined('AST_TEMPLATE_PATH')) define('AST_TEMPLATE_PATH', SHIPMENT_TRACKING_PATH . '/templates/');
13
  // hook for when order status is changed
14
  // include the email class files
15
  add_filter( 'woocommerce_email_classes', array( $this, 'custom_init_emails' ));
177
  }
178
 
179
  public function get_order_details($order_id, $order){
180
+ ob_start(); ?>
181
+ <h2>
182
+ <?php
183
+ $text_align = is_rtl() ? 'right' : 'left';
184
+ $sent_to_admin = false;
185
+ $plain_text = '';
186
+ if ( $sent_to_admin ) {
187
+ $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
188
+ $after = '</a>';
189
+ } else {
190
+ $before = '';
191
+ $after = '';
192
+ }
193
+ /* translators: %s: Order ID. */
194
+ echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) );
195
+ ?>
196
+ </h2>
197
+
198
  <div style="margin-bottom: 40px;">
199
  <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
200
  <thead>
205
  </tr>
206
  </thead>
207
  <tbody>
208
+ <?php
209
+ echo wc_get_email_order_items( $order, array( // WPCS: XSS ok.
210
+ 'show_sku' => $sent_to_admin,
211
+ 'show_image' => true,
212
+ 'image_size' => array( 32, 32 ),
213
+ 'plain_text' => $plain_text,
214
+ 'sent_to_admin' => $sent_to_admin,
215
+ ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  ?>
217
  </tbody>
218
  <tfoot>
242
  ?>
243
  </tfoot>
244
  </table>
245
+ </div>
246
  <?php return ob_get_clean();
247
  }
248
 
251
 
252
  if ( $tracking_items ){
253
  ob_start();
254
+ $table_header_font_size = '';
255
+ $table_header_font_color = '';
256
+ $table_content_font_size = '';
257
+ $table_content_font_color = '';
258
+ $email_border_color = '';
259
+ $email_border_size = '';
260
+ $shipment_tracking_header_text = '';
261
+ $email_table_backgroud_color = '';
262
+ $tracking_link_font_color = '';
263
+ $tracking_link_bg_color = '';
264
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
265
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
266
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); } else{ $email_border_size = "1"; }
354
  $text_align = is_rtl() ? 'right' : 'left';
355
  $shipping = $order->get_formatted_shipping_address();
356
  ?>
357
+ <table id="shipping_addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
358
  <tr>
359
+ <?php if ( $shipping ) : ?>
360
  <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%">
361
  <h2><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
362
 
373
  $text_align = is_rtl() ? 'right' : 'left';
374
  $address = $order->get_formatted_billing_address();
375
  ?>
376
+ <table id="billing_addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
377
  <tr>
378
  <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
379
  <h2><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
includes/emails/class-shipment-delivered-email.php CHANGED
@@ -38,7 +38,8 @@ if ( ! class_exists( 'WC_Email_Customer_Delivered_Order', false ) ) :
38
  '{order_date}' => '',
39
  '{order_number}' => '',
40
  );
41
- $this->template_base = CUSTOM_TEMPLATE_PATH;
 
42
  // Triggers for this email.
43
 
44
  // Call parent constructor.
@@ -101,8 +102,7 @@ if ( ! class_exists( 'WC_Email_Customer_Delivered_Order', false ) ) :
101
  */
102
  public function get_content_html() {
103
  $template = $this->get_template( 'template_html' );
104
- $local_file = $this->get_theme_template_file( $template );
105
-
106
  if ( file_exists( $local_file ) && is_writable( $local_file )){
107
  //echo $local_file;exit;
108
  return wc_get_template_html(
38
  '{order_date}' => '',
39
  '{order_number}' => '',
40
  );
41
+ $this->template_base = AST_TEMPLATE_PATH;
42
+ //echo $this->template_base;exit;
43
  // Triggers for this email.
44
 
45
  // Call parent constructor.
102
  */
103
  public function get_content_html() {
104
  $template = $this->get_template( 'template_html' );
105
+ $local_file = $this->get_theme_template_file( $template );
 
106
  if ( file_exists( $local_file ) && is_writable( $local_file )){
107
  //echo $local_file;exit;
108
  return wc_get_template_html(
includes/views/html-tracking-info-design-preview.php CHANGED
@@ -1,4 +1,15 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
2
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
3
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
4
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); } else{ $email_border_size = "1"; }
1
  <?php
2
+ $table_header_font_size = '';
3
+ $table_header_font_color = '';
4
+ $table_content_font_size = '';
5
+ $table_content_font_color = '';
6
+ $email_border_color = '';
7
+ $email_border_size = '';
8
+ $shipment_tracking_header_text = '';
9
+ $email_table_backgroud_color = '';
10
+ $tracking_link_font_color = '';
11
+ $tracking_link_bg_color = '';
12
+
13
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
14
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
15
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); } else{ $email_border_size = "1"; }
readme.txt CHANGED
@@ -37,6 +37,11 @@ We added translation to: Hebrew, Hindi, Italian, Norwegian (Bokmål), Russian, S
37
 
38
  If you want us to add more translations, you can upload the .mo/.po files after you translated on our [documentation](https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/translations/)
39
 
 
 
 
 
 
40
  == Compatibility with different email customizer plugin ==
41
 
42
  The plugin is copmatible with different email customizer plugin
@@ -48,6 +53,8 @@ For more information about compatibility please see this [post](https://www.zore
48
 
49
  https://youtu.be/g90Glw2jjX4
50
 
 
 
51
  == Frequently Asked Questions ==
52
 
53
  = Where will my customer see the tracking info?
@@ -82,6 +89,31 @@ For all REST API functions, [please see our documentation](https://www.zorem.com
82
 
83
  == Changelog ==
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  = 1.9.4.1 =
86
  * Added language support for Greek.
87
  * Bug Fixed - added missing translated strings text domains in js file.
37
 
38
  If you want us to add more translations, you can upload the .mo/.po files after you translated on our [documentation](https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/translations/)
39
 
40
+ == Compatibility with different custom order number plugin
41
+ 1. [Custom Order Numbers for WooCommerce](https://wordpress.org/plugins/custom-order-numbers-for-woocommerce/)
42
+ 2. [WooCommerce Sequential Order Numbers](https://wordpress.org/plugins/woocommerce-sequential-order-numbers/)
43
+ 3. [WP-Lister Pro for Amazon](https://www.wplab.com/plugins/wp-lister-for-amazon/)
44
+
45
  == Compatibility with different email customizer plugin ==
46
 
47
  The plugin is copmatible with different email customizer plugin
53
 
54
  https://youtu.be/g90Glw2jjX4
55
 
56
+ https://youtu.be/Gqf34_FCkGY
57
+
58
  == Frequently Asked Questions ==
59
 
60
  = Where will my customer see the tracking info?
89
 
90
  == Changelog ==
91
 
92
+ = 1.9.5.2 =
93
+ * Added DTDC Shipping provider as a default shipping provider
94
+
95
+ = 1.9.5.1 =
96
+ * Bug Fixed - Fixed email template issue for WooCommerce Delivered order.
97
+
98
+ = 1.9.5 =
99
+ * Update design of email notification section for small screen
100
+ * Update design of bulk upload section
101
+ * Make bulk upload compatible with Custom Order Numbers for WooCommerce plugin
102
+ * Make bulk upload compatible with WooCommerce Sequential Order Numbers plugin
103
+ * Make bulk upload compatible with WP-Lister Pro for Amazon plugin
104
+ * Change Chronopost provider url in database
105
+
106
+ = 1.9.4.4 =
107
+ * Bug Fixed - Fixed all php warnings
108
+ * Bug Fixed - Fixed ArrowXL shipping provider country issue
109
+ * Updated design of Bulk upload section
110
+
111
+ = 1.9.4.3 =
112
+ * Bug Fixed - Fixed bulk upload csv issue
113
+
114
+ = 1.9.4.2 =
115
+ * Bug Fixed - Fixed design issue in small screen
116
+
117
  = 1.9.4.1 =
118
  * Added language support for Greek.
119
  * Bug Fixed - added missing translated strings text domains in js file.
templates/emails/tracking-info.php CHANGED
@@ -14,6 +14,17 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  */
15
 
16
  if ( $tracking_items ) :
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
19
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
14
  */
15
 
16
  if ( $tracking_items ) :
17
+
18
+ $table_header_font_size = '';
19
+ $table_header_font_color = '';
20
+ $table_content_font_size = '';
21
+ $table_content_font_color = '';
22
+ $email_border_color = '';
23
+ $email_border_size = '';
24
+ $shipment_tracking_header_text = '';
25
+ $email_table_backgroud_color = '';
26
+ $tracking_link_font_color = '';
27
+ $tracking_link_bg_color = '';
28
 
29
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
30
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); } else{ $email_border_color = "#e4e4e4"; }
templates/myaccount/view-order.php CHANGED
@@ -14,6 +14,18 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  */
15
 
16
  if ( $tracking_items ) :
 
 
 
 
 
 
 
 
 
 
 
 
17
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
18
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); }
19
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); }
14
  */
15
 
16
  if ( $tracking_items ) :
17
+ $table_header_font_size = '';
18
+ $table_header_font_color = '';
19
+ $table_content_font_size = '';
20
+ $table_content_font_color = '';
21
+ $email_border_color = '';
22
+ $email_border_size = '';
23
+ $shipment_tracking_header_text = '';
24
+ $email_table_backgroud_color = '';
25
+ $tracking_link_font_color = '';
26
+ $tracking_link_bg_color = '';
27
+
28
+
29
  $display_thumbnail = get_option('display_shipment_provider_thumbnail');
30
  if(get_option('email_border_color')){ $email_border_color = get_option('email_border_color'); }
31
  if(get_option('email_border_size')){ $email_border_size = get_option('email_border_size'); }
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/shop/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: 1.9.4.1
8
  * Author: zorem
9
  * Author URI: http://www.zorem.com/
10
  * License: GPL-2.0+
@@ -22,7 +22,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
22
  *
23
  * @var string
24
  */
25
- public $version = '1.9.4.1';
26
 
27
  /**
28
  * Initialize the main plugin function
@@ -159,9 +159,9 @@ class zorem_woocommerce_advanced_shipment_tracking {
159
  if($wc_ast_status_delivered == 1)
160
  add_action( 'woocommerce_order_status_delivered', array( $this, 'email_trigger_delivered' ), 10, 2 );
161
 
162
- require_once( 'includes/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php' );
163
- add_action( 'admin_init', array( 'PAnD', 'init' ) );
164
- add_action( 'admin_notices', array( $this, 'admin_notice_after_update' ) );
165
 
166
  }
167
 
@@ -588,9 +588,12 @@ class zorem_woocommerce_advanced_shipment_tracking {
588
 
589
  $tracking_item = array();
590
 
591
- $tracking_item['tracking_provider'] = $args['tracking_provider'];
 
 
592
  $tracking_item['tracking_number'] = wc_clean( $args['tracking_number'] );
593
  $tracking_item['date_shipped'] = wc_clean( strtotime( $args['date_shipped'] ) );
 
594
 
595
  if ( 0 == (int) $tracking_item['date_shipped'] ) {
596
  $tracking_item['date_shipped'] = time();
@@ -606,7 +609,10 @@ class zorem_woocommerce_advanced_shipment_tracking {
606
  $tracking_items[] = $tracking_item;
607
 
608
  $this->save_tracking_items( $order_id, $tracking_items );
609
-
 
 
 
610
  return $tracking_item;
611
  }
612
 
@@ -1102,7 +1108,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
1102
  56 => array (
1103
  "provider_name" => 'ArrowXL',
1104
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
1105
- "shipping_country" => 'UK',
1106
  "shipping_default" => '1'
1107
  ),
1108
  57 => array (
@@ -1149,7 +1155,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
1149
  ),
1150
  65 => array (
1151
  "provider_name" => 'Chronopost',
1152
- "provider_url" => 'https://www.chronopost.fr/en/chrono_suivi_search?listeNumerosLT=%number%',
1153
  "shipping_country" => 'FR',
1154
  "shipping_default" => '1'
1155
  ),
@@ -1266,7 +1272,13 @@ class zorem_woocommerce_advanced_shipment_tracking {
1266
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
1267
  "shipping_country" => 'US',
1268
  "shipping_default" => '1'
1269
- ),
 
 
 
 
 
 
1270
  );
1271
  $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1272
  foreach($updated_providers as $shipping_provider){
@@ -1280,6 +1292,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
1280
  }
1281
  update_option( 'wc_advanced_shipment_tracking', '1.4');
1282
  }
 
1283
  if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'1.5', '>=') ){
1284
  }
1285
  else{
@@ -1289,10 +1302,66 @@ class zorem_woocommerce_advanced_shipment_tracking {
1289
 
1290
  if(!isset($results->enable)) {
1291
  $res = $wpdb->query( sprintf( "ALTER TABLE %s ADD enable int(11) NOT NULL DEFAULT '1'", $woo_shippment_status_email_table) );
1292
- //echo '<pre>';print_r($res);echo '</pre>';exit;
1293
  }
1294
  update_option( 'wc_advanced_shipment_tracking', '1.5');
1295
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1296
  }
1297
  }
1298
 
@@ -1594,7 +1663,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
1594
  56 => array (
1595
  "provider_name" => 'ArrowXL',
1596
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
1597
- "shipping_country" => 'UK',
1598
  "shipping_default" => '1'
1599
  ),
1600
  57 => array (
@@ -1641,7 +1710,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
1641
  ),
1642
  65 => array (
1643
  "provider_name" => 'Chronopost',
1644
- "provider_url" => 'https://www.chronopost.fr/en/chrono_suivi_search?listeNumerosLT=%number%',
1645
  "shipping_country" => 'FR',
1646
  "shipping_default" => '1'
1647
  ),
@@ -1758,6 +1827,12 @@ class zorem_woocommerce_advanced_shipment_tracking {
1758
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
1759
  "shipping_country" => 'US',
1760
  "shipping_default" => '1'
 
 
 
 
 
 
1761
  ),
1762
  );
1763
  return $providers;
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI: https://www.zorem.com/shop/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: 1.9.5.2
8
  * Author: zorem
9
  * Author URI: http://www.zorem.com/
10
  * License: GPL-2.0+
22
  *
23
  * @var string
24
  */
25
+ public $version = '1.9.5.2';
26
 
27
  /**
28
  * Initialize the main plugin function
159
  if($wc_ast_status_delivered == 1)
160
  add_action( 'woocommerce_order_status_delivered', array( $this, 'email_trigger_delivered' ), 10, 2 );
161
 
162
+ //require_once( 'includes/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php' );
163
+ //add_action( 'admin_init', array( 'PAnD', 'init' ) );
164
+ //add_action( 'admin_notices', array( $this, 'admin_notice_after_update' ) );
165
 
166
  }
167
 
588
 
589
  $tracking_item = array();
590
 
591
+ $tracking_item['tracking_provider'] = wc_clean( $args['tracking_provider'] );
592
+ $tracking_item['custom_tracking_provider'] = wc_clean( $args['custom_tracking_provider'] );
593
+ $tracking_item['custom_tracking_link'] = wc_clean( $args['custom_tracking_link'] );
594
  $tracking_item['tracking_number'] = wc_clean( $args['tracking_number'] );
595
  $tracking_item['date_shipped'] = wc_clean( strtotime( $args['date_shipped'] ) );
596
+ $tracking_item['status_shipped'] = wc_clean( $args['status_shipped'] );
597
 
598
  if ( 0 == (int) $tracking_item['date_shipped'] ) {
599
  $tracking_item['date_shipped'] = time();
609
  $tracking_items[] = $tracking_item;
610
 
611
  $this->save_tracking_items( $order_id, $tracking_items );
612
+ if( !empty($tracking_item['status_shipped'] )){
613
+ $order = new WC_Order( $order_id );
614
+ $order->update_status('completed');
615
+ }
616
  return $tracking_item;
617
  }
618
 
1108
  56 => array (
1109
  "provider_name" => 'ArrowXL',
1110
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
1111
+ "shipping_country" => 'GB',
1112
  "shipping_default" => '1'
1113
  ),
1114
  57 => array (
1155
  ),
1156
  65 => array (
1157
  "provider_name" => 'Chronopost',
1158
+ "provider_url" => 'https://www.chronopost.fr/fr/chrono_suivi_search?listeNumerosLT=%number%',
1159
  "shipping_country" => 'FR',
1160
  "shipping_default" => '1'
1161
  ),
1272
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
1273
  "shipping_country" => 'US',
1274
  "shipping_default" => '1'
1275
+ ),
1276
+ 86 => array (
1277
+ "provider_name" => 'DTDC',
1278
+ "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=%number%&TrkType2=awb_no',
1279
+ "shipping_country" => 'IN',
1280
+ "shipping_default" => '1'
1281
+ ),
1282
  );
1283
  $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1284
  foreach($updated_providers as $shipping_provider){
1292
  }
1293
  update_option( 'wc_advanced_shipment_tracking', '1.4');
1294
  }
1295
+
1296
  if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'1.5', '>=') ){
1297
  }
1298
  else{
1302
 
1303
  if(!isset($results->enable)) {
1304
  $res = $wpdb->query( sprintf( "ALTER TABLE %s ADD enable int(11) NOT NULL DEFAULT '1'", $woo_shippment_status_email_table) );
1305
+
1306
  }
1307
  update_option( 'wc_advanced_shipment_tracking', '1.5');
1308
+ }
1309
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'1.6', '>=') ){
1310
+ }
1311
+ else{
1312
+ global $wpdb;
1313
+ $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1314
+
1315
+ $data_array = array(
1316
+ 'shipping_country' => 'GB',
1317
+ );
1318
+ $where_array = array(
1319
+ 'provider_name' => 'ArrowXL'
1320
+ );
1321
+
1322
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1323
+ update_option( 'wc_advanced_shipment_tracking', '1.6');
1324
+ }
1325
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'1.7', '>=') ){
1326
+ }
1327
+ else{
1328
+ global $wpdb;
1329
+ $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1330
+
1331
+ $data_array = array(
1332
+ 'provider_url' => 'https://www.chronopost.fr/fr/chrono_suivi_search?listeNumerosLT=%number%',
1333
+ );
1334
+ $where_array = array(
1335
+ 'provider_name' => 'Chronopost'
1336
+ );
1337
+
1338
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1339
+ update_option( 'wc_advanced_shipment_tracking', '1.7');
1340
+ }
1341
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'1.8', '>=') ){
1342
+ }
1343
+ else{
1344
+ global $wpdb;
1345
+ $DTDC = array(
1346
+ 86 => array (
1347
+ "provider_name" => 'DTDC',
1348
+ "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=%number%&TrkType2=awb_no',
1349
+ "shipping_country" => 'IN',
1350
+ "shipping_default" => '1'
1351
+ ),
1352
+ );
1353
+ $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1354
+ foreach($DTDC as $shipping_provider){
1355
+ $shipping_provider['provider_name'];
1356
+ $success = $wpdb->insert($woo_shippment_table_name, array(
1357
+ "provider_name" => $shipping_provider['provider_name'],
1358
+ "provider_url" => $shipping_provider['provider_url'],
1359
+ "shipping_country" => $shipping_provider['shipping_country'],
1360
+ "shipping_default" => $shipping_provider['shipping_default'],
1361
+ ));
1362
+ }
1363
+ update_option( 'wc_advanced_shipment_tracking', '1.8');
1364
+ }
1365
  }
1366
  }
1367
 
1663
  56 => array (
1664
  "provider_name" => 'ArrowXL',
1665
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
1666
+ "shipping_country" => 'GB',
1667
  "shipping_default" => '1'
1668
  ),
1669
  57 => array (
1710
  ),
1711
  65 => array (
1712
  "provider_name" => 'Chronopost',
1713
+ "provider_url" => 'https://www.chronopost.fr/fr/chrono_suivi_search?listeNumerosLT=%number%',
1714
  "shipping_country" => 'FR',
1715
  "shipping_default" => '1'
1716
  ),
1827
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
1828
  "shipping_country" => 'US',
1829
  "shipping_default" => '1'
1830
+ ),
1831
+ 86 => array (
1832
+ "provider_name" => 'DTDC',
1833
+ "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=%number%&TrkType2=awb_no',
1834
+ "shipping_country" => 'IN',
1835
+ "shipping_default" => '1'
1836
  ),
1837
  );
1838
  return $providers;