Advanced Shipment Tracking for WooCommerce - Version 3.2.2.4

Version Description

  • Fix - Fixed issue with default shipping provider not automatically select on Add Tracking form
  • Dev - When user migrate from WooCommerce Shipment Tracking(official) to Advanced Shipment Tracking for WooCommerce plugin it will automatically migrate shipment tracking data
  • Fix - Fix search provides design issue for small screen on shipping providers list page
  • Dev - Improve TrackShip Tracking page design and make Estimate delivery date multilingual compatible
  • Fix - Fixed - Failed Attempt filter not working on orders page
Download this release

Release Info

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

Code changes from version 3.2.2.3 to 3.2.2.4

assets/css/admin.css CHANGED
@@ -2506,10 +2506,6 @@ ul.csv_error_details_ul li:before{
2506
  }
2507
 
2508
  @media screen and (min-width: 768px) and (max-width: 1269px) {
2509
- #search_provider{
2510
- width: 210px;
2511
- min-width: 210px;
2512
- }
2513
  .provider-thumb {
2514
  height: 40px;
2515
  }
2506
  }
2507
 
2508
  @media screen and (min-width: 768px) and (max-width: 1269px) {
 
 
 
 
2509
  .provider-thumb {
2510
  height: 40px;
2511
  }
assets/css/front.css CHANGED
@@ -323,7 +323,9 @@ ul.timeline > li > p{
323
  top: 0;
324
  left: 0;
325
  }
326
-
 
 
327
 
328
  /*** RTL CSS ***/
329
 
323
  top: 0;
324
  left: 0;
325
  }
326
+ p.pending_message {
327
+ padding: 0 20px;
328
+ }
329
 
330
  /*** RTL CSS ***/
331
 
includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -1219,7 +1219,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1219
 
1220
  if ( $qty > 0 ) {
1221
 
1222
- $product_id = wc_get_product_id_by_sku( $sku );
1223
 
1224
  if ( $product_id ) {
1225
 
1219
 
1220
  if ( $qty > 0 ) {
1221
 
1222
+ $product_id = ast_get_product_id_by_sku( $sku );
1223
 
1224
  if ( $product_id ) {
1225
 
includes/class-wc-advanced-shipment-tracking-settings.php CHANGED
@@ -437,7 +437,7 @@ class WC_Advanced_Shipment_Tracking_Settings {
437
  $country = $s_c->shipping_country;
438
  $shippment_providers_by_country = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->table WHERE shipping_country = %s AND display_in_order = 1",$country ) );
439
  foreach ( $shippment_providers_by_country as $providers ) {
440
- $selected = ( $default_provider == esc_attr( $providers->ts_slug ) ) ? 'selected' : '';
441
  echo '<option value="' . esc_attr( $providers->ts_slug ) . '" '.$selected. '>' . esc_html( $providers->provider_name ) . '</option>';
442
  }
443
  echo '</optgroup>';
437
  $country = $s_c->shipping_country;
438
  $shippment_providers_by_country = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->table WHERE shipping_country = %s AND display_in_order = 1",$country ) );
439
  foreach ( $shippment_providers_by_country as $providers ) {
440
+ $selected = ( $default_provider == esc_attr( $providers->provider_name ) ) ? 'selected' : '';
441
  echo '<option value="' . esc_attr( $providers->ts_slug ) . '" '.$selected. '>' . esc_html( $providers->provider_name ) . '</option>';
442
  }
443
  echo '</optgroup>';
includes/class-wc-advanced-shipment-tracking-trackship.php CHANGED
@@ -799,7 +799,7 @@ class WC_Advanced_Shipment_Tracking_Trackship {
799
  'available_for_pickup' => (object) array( 'term' => __( 'Available For Pickup', 'woo-advanced-shipment-tracking' ) ),
800
  'out_for_delivery' => (object) array( 'term' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ) ),
801
  'delivered' => (object) array( 'term' => __( 'Delivered', 'woo-advanced-shipment-tracking' ) ),
802
- 'failed_attempt' => (object) array( 'term' => __( 'Failed Attempt', 'woo-advanced-shipment-tracking' ) ),
803
  'cancelled' => (object) array( 'term' => __( 'Cancelled', 'woocommerce' ) ),
804
  'carrier_unsupported' => (object) array( 'term' => __( 'Carrier Unsupported', 'woo-advanced-shipment-tracking' ) ),
805
  'return_to_sender' => (object) array( 'term' => __( 'Return To Sender', 'woo-advanced-shipment-tracking' ) ),
@@ -905,7 +905,10 @@ class WC_Advanced_Shipment_Tracking_Trackship {
905
  break;
906
  case "deleted":
907
  $status = __( 'Deleted', 'woocommerce' );
908
- break;
 
 
 
909
  }
910
  return $status;
911
  }
799
  'available_for_pickup' => (object) array( 'term' => __( 'Available For Pickup', 'woo-advanced-shipment-tracking' ) ),
800
  'out_for_delivery' => (object) array( 'term' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ) ),
801
  'delivered' => (object) array( 'term' => __( 'Delivered', 'woo-advanced-shipment-tracking' ) ),
802
+ 'failure' => (object) array( 'term' => __( 'Failed Attempt', 'woo-advanced-shipment-tracking' ) ),
803
  'cancelled' => (object) array( 'term' => __( 'Cancelled', 'woocommerce' ) ),
804
  'carrier_unsupported' => (object) array( 'term' => __( 'Carrier Unsupported', 'woo-advanced-shipment-tracking' ) ),
805
  'return_to_sender' => (object) array( 'term' => __( 'Return To Sender', 'woo-advanced-shipment-tracking' ) ),
905
  break;
906
  case "deleted":
907
  $status = __( 'Deleted', 'woocommerce' );
908
+ break;
909
+ case "balance_zero":
910
+ $status = __( 'TrackShip balance is 0', 'woocommerce' );
911
+ break;
912
  }
913
  return $status;
914
  }
includes/class-wc-advanced-shipment-tracking.php CHANGED
@@ -330,9 +330,10 @@ class WC_Advanced_Shipment_Tracking_Actions {
330
  echo '<optgroup label="' . $country_name . '">';
331
  $country = $s_c->shipping_country;
332
  $shippment_providers_by_country = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_country = '$country' AND display_in_order = 1" );
333
- foreach ( $shippment_providers_by_country as $providers ) {
334
- $selected = ( $default_provider == esc_attr( $providers->ts_slug ) ) ? 'selected' : '';
335
- echo '<option value="' . esc_attr( $providers->ts_slug ) . '" '.$selected. '>' . esc_html( $providers->provider_name ) . '</option>';
 
336
  }
337
  echo '</optgroup>';
338
  }
@@ -932,7 +933,7 @@ class WC_Advanced_Shipment_Tracking_Actions {
932
  $link_format = '';
933
 
934
  foreach ( $this->get_providers() as $provider => $format ) {
935
- if ( $provider === $tracking_item['tracking_provider'] ) {
936
  $link_format = $format['provider_url'];
937
  $trackship_supported = $format['trackship_supported'];
938
  $formatted['formatted_tracking_provider'] = $format['provider_name'];
330
  echo '<optgroup label="' . $country_name . '">';
331
  $country = $s_c->shipping_country;
332
  $shippment_providers_by_country = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_country = '$country' AND display_in_order = 1" );
333
+ foreach ( $shippment_providers_by_country as $providers ) {
334
+ $providers->ts_slug;
335
+ $selected = ( $default_provider == esc_attr( $providers->provider_name ) ) ? 'selected' : '';
336
+ echo '<option value="' . esc_attr( $providers->ts_slug ) . '" '.$selected.'>' . esc_html( $providers->provider_name ) . '</option>';
337
  }
338
  echo '</optgroup>';
339
  }
933
  $link_format = '';
934
 
935
  foreach ( $this->get_providers() as $provider => $format ) {
936
+ if ( $provider === $tracking_item['tracking_provider'] || $format['provider_name'] === $tracking_item['tracking_provider'] ) {
937
  $link_format = $format['provider_url'];
938
  $trackship_supported = $format['trackship_supported'];
939
  $formatted['formatted_tracking_provider'] = $format['provider_name'];
includes/tracking-info.php CHANGED
@@ -60,3 +60,25 @@ if ( !function_exists( 'ast_get_tracking_items' ) ) {
60
  return $tracking_items;
61
  }
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  return $tracking_items;
61
  }
62
  }
63
+
64
+ if ( !function_exists( 'ast_get_product_id_by_sku' ) ) {
65
+ function ast_get_product_id_by_sku( $sku = false ) {
66
+
67
+ global $wpdb;
68
+
69
+ if ( !$sku ) {
70
+ return null;
71
+ }
72
+
73
+ $product_id = $wpdb->get_var(
74
+ $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value='%s' LIMIT 1",
75
+ $sku)
76
+ );
77
+
78
+ if ( $product_id ) {
79
+ return $product_id;
80
+ }
81
+
82
+ return null;
83
+ }
84
+ }
includes/views/front/tracking_page_header.php CHANGED
@@ -22,19 +22,9 @@
22
  <?php _e( 'Est. Delivery Date', 'woo-advanced-shipment-tracking' ); ?>: <strong>
23
  <?php
24
  if($tracker->est_delivery_date){
25
- echo date('l, M d', strtotime($tracker->est_delivery_date));
26
  } else{
27
  echo 'N/A';
28
  } ?></strong>
29
- </span>
30
- <?php
31
- if($tracker->ep_status == 'pending_trackship' || $tracker->ep_status == 'pending'){
32
- if($tracker->ep_status == 'pending'){
33
- $pending_message = __( 'Tracking information is not available, please try again in a few hour.', 'woo-advanced-shipment-tracking' );
34
- } else{
35
- $pending_message = __( 'Tracking information is not available, please try again in a few minutes.', 'woo-advanced-shipment-tracking' );
36
- }
37
- ?>
38
- <p class="pending_message"><?php echo apply_filters( "trackship_pending_status_message", $pending_message, $tracker->ep_status );?></p>
39
- <?php } ?>
40
- </div>
22
  <?php _e( 'Est. Delivery Date', 'woo-advanced-shipment-tracking' ); ?>: <strong>
23
  <?php
24
  if($tracker->est_delivery_date){
25
+ echo date_i18n( 'l, M d', strtotime( $tracker->est_delivery_date ) );
26
  } else{
27
  echo 'N/A';
28
  } ?></strong>
29
+ </span>
30
+ </div>
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -135,6 +135,13 @@ Yes, if you use external shipping services that work with the WooCommerce REST A
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
138
  = 3.2.2.3 =
139
  * Enhancement - Added datepicker on Add tracking lightbox on orders page
140
  * Enhancement - Removed the multiple API name option
135
 
136
  == Changelog ==
137
 
138
+ = 3.2.2.4 =
139
+ * Fix - Fixed issue with default shipping provider not automatically select on Add Tracking form
140
+ * Dev - When user migrate from WooCommerce Shipment Tracking(official) to Advanced Shipment Tracking for WooCommerce plugin it will automatically migrate shipment tracking data
141
+ * Fix - Fix search provides design issue for small screen on shipping providers list page
142
+ * Dev - Improve TrackShip Tracking page design and make Estimate delivery date multilingual compatible
143
+ * Fix - Fixed - Failed Attempt filter not working on orders page
144
+
145
  = 3.2.2.3 =
146
  * Enhancement - Added datepicker on Add tracking lightbox on orders page
147
  * Enhancement - Removed the multiple API name option
templates/emails/tracking-info.php CHANGED
@@ -202,7 +202,13 @@ if ( $tracking_items ) :
202
 
203
  <?php if($display_shipping_provider_name == 1){ ?>
204
  <td class="tracking-provider" data-title="<?php _e( 'Provider Name', 'woo-advanced-shipment-tracking' ); ?>" style="<?php echo $td_column_style; ?>">
205
- <?php echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'formatted_tracking_provider' ] )); ?>
 
 
 
 
 
 
206
  </td>
207
  <?php } ?>
208
 
202
 
203
  <?php if($display_shipping_provider_name == 1){ ?>
204
  <td class="tracking-provider" data-title="<?php _e( 'Provider Name', 'woo-advanced-shipment-tracking' ); ?>" style="<?php echo $td_column_style; ?>">
205
+ <?php
206
+ if ( $tracking_item[ 'formatted_tracking_provider' ] != '' ) {
207
+ echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'formatted_tracking_provider' ] ));
208
+ } else {
209
+ echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'tracking_provider' ] ));
210
+ }
211
+ ?>
212
  </td>
213
  <?php } ?>
214
 
templates/myaccount/tracking-info.php CHANGED
@@ -184,7 +184,13 @@ if ( $tracking_items ) :
184
 
185
  <?php if($display_shipping_provider_name == 1){ ?>
186
  <td class="tracking-provider" style="<?php echo $td_column_style; ?>" data-title="<?php _e( 'Provider Name', 'woo-advanced-shipment-tracking' ); ?>">
187
- <?php echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'formatted_tracking_provider' ] )); ?>
 
 
 
 
 
 
188
  </td>
189
  <?php }
190
 
184
 
185
  <?php if($display_shipping_provider_name == 1){ ?>
186
  <td class="tracking-provider" style="<?php echo $td_column_style; ?>" data-title="<?php _e( 'Provider Name', 'woo-advanced-shipment-tracking' ); ?>">
187
+ <?php
188
+ if ( $tracking_item[ 'formatted_tracking_provider' ] != '' ) {
189
+ echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'formatted_tracking_provider' ] ));
190
+ } else {
191
+ echo apply_filters( 'ast_provider_title', esc_html( $tracking_item[ 'tracking_provider' ] ));
192
+ }
193
+ ?>
194
  </td>
195
  <?php }
196
 
woocommerce-advanced-shipment-tracking.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI: https://www.zorem.com/products/woocommerce-advanced-shipment-tracking/
6
  * Description: Add shipment tracking information to your WooCommerce orders and provide customers with an easy way to track their orders. Shipment tracking Info will appear in customers accounts (in the order panel) and in WooCommerce order complete email.
7
- * Version: 3.2.2.3
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
20
  *
21
  * @var string
22
  */
23
- public $version = '3.2.2.3';
24
 
25
  /**
26
  * 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.2.4
8
  * Author: zorem
9
  * Author URI: https://www.zorem.com
10
  * License: GPL-2.0+
20
  *
21
  * @var string
22
  */
23
+ public $version = '3.2.2.4';
24
 
25
  /**
26
  * Initialize the main plugin function