Advanced Shipment Tracking for WooCommerce - Version 3.2.1.1

Version Description

  • Fix - Fixed Invalid user key in Shipment tracking section if TrackShip is not connected
Download this release

Release Info

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

Code changes from version 3.2.1 to 3.2.1.1

includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -1561,8 +1561,8 @@ class WC_Advanced_Shipment_Tracking_Admin {
1561
  <td>
1562
  <span class="provider_name">
1563
  <?php echo $d_s_p->provider_name;
1564
- if($d_s_p->custom_provider_name != ''){ echo ' ('.$d_s_p->custom_provider_name.')'; }
1565
- if($d_s_p->api_provider_name != ''){
1566
  if($this->isJSON($d_s_p->api_provider_name)){
1567
  $api_count = count(json_decode($d_s_p->api_provider_name));
1568
  } else{
1561
  <td>
1562
  <span class="provider_name">
1563
  <?php echo $d_s_p->provider_name;
1564
+ if( isset($d_s_p->custom_provider_name) && $d_s_p->custom_provider_name != ''){ echo ' ('.$d_s_p->custom_provider_name.')'; }
1565
+ if( isset($d_s_p->api_provider_name) && $d_s_p->api_provider_name != ''){
1566
  if($this->isJSON($d_s_p->api_provider_name)){
1567
  $api_count = count(json_decode($d_s_p->api_provider_name));
1568
  } else{
includes/class-wc-advanced-shipment-tracking-install.php CHANGED
@@ -92,7 +92,7 @@ class WC_Advanced_Shipment_Tracking_Install {
92
 
93
  $this->update_shipping_providers();
94
 
95
- update_option( 'wc_advanced_shipment_tracking', '3.14');
96
  }
97
 
98
  $wc_ast_default_mark_shipped = get_option('wc_ast_default_mark_shipped');
@@ -175,160 +175,7 @@ class WC_Advanced_Shipment_Tracking_Install {
175
  set_theme_mod('show_provider_border', 1);
176
  set_theme_mod('provider_border_color', '#e0e0e0');
177
  update_option( 'wc_advanced_shipment_tracking', '3.6');
178
- }
179
- $wcast_customizer_settings = new wcast_initialise_customizer_settings();
180
- if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'3.8', '<') ){
181
-
182
- $opt = array(
183
- 'display_tracking_info_at' => get_theme_mod('display_tracking_info_at',$wcast_customizer_settings->defaults['display_tracking_info_at']),
184
- 'select_tracking_template' => get_theme_mod('select_tracking_template',$wcast_customizer_settings->defaults['select_tracking_template']),
185
- 'header_text_change' => get_theme_mod('header_text_change',$wcast_customizer_settings->defaults['header_text_change']),
186
- 'additional_header_text' => get_theme_mod('additional_header_text',$wcast_customizer_settings->defaults['additional_header_text']),
187
- 'simple_provider_font_size' => get_theme_mod('simple_provider_font_size',$wcast_customizer_settings->defaults['simple_provider_font_size']),
188
- 'simple_provider_font_color' => get_theme_mod('simple_provider_font_color',$wcast_customizer_settings->defaults['simple_provider_font_color']),
189
- 'show_provider_border' => get_theme_mod('show_provider_border',$wcast_customizer_settings->defaults['show_provider_border']),
190
- 'provider_border_color' => get_theme_mod('provider_border_color',$wcast_customizer_settings->defaults['provider_border_color']),
191
- 'display_shipment_provider_name' => get_theme_mod('display_shipment_provider_name',$wcast_customizer_settings->defaults['display_shipment_provider_name']),
192
- 'display_shipment_provider_image' => get_theme_mod('display_shipment_provider_image',$wcast_customizer_settings->defaults['display_shipment_provider_image']),
193
- 'remove_date_from_tracking' => get_theme_mod('remove_date_from_tracking',$wcast_customizer_settings->defaults['remove_date_from_tracking']),
194
- 'tracking_number_header_text' => get_theme_mod('tracking_number_header_text',$wcast_customizer_settings->defaults['tracking_number_header_text']),
195
- 'shipped_date_header_text' => get_theme_mod('shipped_date_header_text',$wcast_customizer_settings->defaults['shipped_date_header_text']),
196
- 'show_track_label' => get_theme_mod('show_track_label',$wcast_customizer_settings->defaults['show_track_label']),'track_header_text' => get_theme_mod('track_header_text',$wcast_customizer_settings->defaults['track_header_text']),'table_header_font_size' => get_theme_mod('table_header_font_size',$wcast_customizer_settings->defaults['table_header_font_size']),
197
- 'table_header_font_color' => get_theme_mod('table_header_font_color',$wcast_customizer_settings->defaults['table_header_font_color']),
198
- 'table_padding' => get_theme_mod('table_padding',$wcast_customizer_settings->defaults['table_padding']),'table_bg_color' => get_theme_mod('table_bg_color',$wcast_customizer_settings->defaults['table_bg_color']),'table_border_color' => get_theme_mod('table_border_color',$wcast_customizer_settings->defaults['table_border_color']),
199
- 'table_border_size' => get_theme_mod('table_border_size',$wcast_customizer_settings->defaults['table_border_size']),'header_content_text_align' => get_theme_mod('header_content_text_align',$wcast_customizer_settings->defaults['header_content_text_align']),
200
- 'table_content_font_color' => get_theme_mod('table_content_font_color',$wcast_customizer_settings->defaults['table_content_font_color']),
201
- 'table_content_font_size' => get_theme_mod('table_content_font_size',$wcast_customizer_settings->defaults['table_content_font_size']),
202
- 'table_content_line_height' => get_theme_mod('table_content_line_height',$wcast_customizer_settings->defaults['table_content_line_height']),
203
- 'table_content_font_weight' => get_theme_mod('table_content_font_weight',$wcast_customizer_settings->defaults['table_content_font_weight']),
204
- 'tracking_link_font_color' => get_theme_mod('tracking_link_font_color',$wcast_customizer_settings->defaults['tracking_link_font_color']),
205
- 'tracking_link_bg_color' => get_theme_mod('tracking_link_bg_color',$wcast_customizer_settings->defaults['tracking_link_bg_color']),
206
- 'tracking_link_border' => get_theme_mod('tracking_link_border',$wcast_customizer_settings->defaults['tracking_link_border']),
207
- );
208
- update_option('tracking_info_settings',$opt);
209
-
210
- $wcast_partial_shipped_customizer_email = new wcast_partial_shipped_customizer_email();
211
- $woocommerce_customer_partial_shipped_order_settings = get_option('woocommerce_customer_partial_shipped_order_settings');
212
- $partial_shipped_email_opt = array(
213
- 'enabled' => $woocommerce_customer_partial_shipped_order_settings['enabled'],
214
- 'subject' => $woocommerce_customer_partial_shipped_order_settings['subject'],
215
- 'heading' => $woocommerce_customer_partial_shipped_order_settings['heading'],
216
- 'wcast_partial_shipped_email_content' => get_theme_mod('wcast_partial_shipped_email_content',$wcast_partial_shipped_customizer_email->defaults['wcast_partial_shipped_email_content']),
217
- );
218
- update_option( 'woocommerce_customer_partial_shipped_order_settings', $partial_shipped_email_opt );
219
-
220
- $wcast_updated_tracking_customizer_email = new wcast_updated_tracking_customizer_email();
221
- $woocommerce_customer_updated_tracking_order_settings = get_option('woocommerce_customer_updated_tracking_order_settings');
222
- $updated_tracking_email_opt = array(
223
- 'enabled' => $woocommerce_customer_updated_tracking_order_settings['enabled'],
224
- 'subject' => $woocommerce_customer_updated_tracking_order_settings['subject'],
225
- 'heading' => $woocommerce_customer_updated_tracking_order_settings['heading'],
226
- 'wcast_updated_tracking_email_content' => get_theme_mod('wcast_updated_tracking_email_content',$wcast_updated_tracking_customizer_email->defaults['wcast_updated_tracking_email_content']),
227
- );
228
- update_option( 'woocommerce_customer_updated_tracking_order_settings', $updated_tracking_email_opt );
229
-
230
- $wcast_intransit_customizer_email = new wcast_intransit_customizer_email();
231
- $in_transit_email_opt = array(
232
- 'wcast_enable_intransit_email' => get_theme_mod('wcast_enable_intransit_email',$wcast_intransit_customizer_email->defaults['wcast_enable_intransit_email']),
233
- 'wcast_intransit_email_to' => get_theme_mod('wcast_intransit_email_to',$wcast_intransit_customizer_email->defaults['wcast_intransit_email_to']),
234
- 'wcast_intransit_email_subject' => get_theme_mod('wcast_intransit_email_subject',$wcast_intransit_customizer_email->defaults['wcast_intransit_email_subject']),
235
- 'wcast_intransit_email_heading' => get_theme_mod('wcast_intransit_email_heading',$wcast_intransit_customizer_email->defaults['wcast_intransit_email_heading']),
236
- 'wcast_intransit_show_tracking_details' => get_theme_mod('wcast_intransit_show_tracking_details',$wcast_intransit_customizer_email->defaults['wcast_intransit_show_tracking_details']),
237
- 'wcast_intransit_show_order_details' => get_theme_mod('wcast_intransit_show_order_details',$wcast_intransit_customizer_email->defaults['wcast_intransit_show_order_details']),
238
- 'wcast_intransit_show_billing_address' => get_theme_mod('wcast_intransit_show_billing_address',$wcast_intransit_customizer_email->defaults['wcast_intransit_show_billing_address']),
239
- 'wcast_intransit_show_shipping_address' => get_theme_mod('wcast_intransit_show_shipping_address',$wcast_intransit_customizer_email->defaults['wcast_intransit_show_shipping_address']),
240
- 'wcast_intransit_email_content' => get_theme_mod('wcast_intransit_email_content',$wcast_intransit_customizer_email->defaults['wcast_intransit_email_content']),
241
- 'wcast_intransit_analytics_link' => get_theme_mod('wcast_intransit_analytics_link',''),
242
- );
243
- update_option( 'wcast_intransit_email_settings', $in_transit_email_opt );
244
-
245
- $wcast_returntosender_customizer_email = new wcast_returntosender_customizer_email();
246
- $returntosender_email_opt = array(
247
- 'wcast_enable_returntosender_email' => get_theme_mod('wcast_enable_returntosender_email',$wcast_returntosender_customizer_email->defaults['wcast_enable_returntosender_email']),
248
- 'wcast_returntosender_email_to' => get_theme_mod('wcast_returntosender_email_to',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_email_to']),
249
- 'wcast_returntosender_email_subject' => get_theme_mod('wcast_returntosender_email_subject',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_email_subject']),
250
- 'wcast_returntosender_email_heading' => get_theme_mod('wcast_returntosender_email_heading',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_email_heading']),
251
- 'wcast_returntosender_show_tracking_details' => get_theme_mod('wcast_returntosender_show_tracking_details',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_show_tracking_details']),
252
- 'wcast_returntosender_show_order_details' => get_theme_mod('wcast_returntosender_show_order_details',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_show_order_details']),
253
- 'wcast_returntosender_show_billing_address' => get_theme_mod('wcast_returntosender_show_billing_address',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_show_billing_address']), 'wcast_returntosender_show_shipping_address' => get_theme_mod('wcast_returntosender_show_shipping_address',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_show_shipping_address']),
254
- 'wcast_returntosender_email_content' => get_theme_mod('wcast_returntosender_email_content',$wcast_returntosender_customizer_email->defaults['wcast_returntosender_email_content']),
255
- 'wcast_returntosender_analytics_link' => get_theme_mod('wcast_returntosender_analytics_link',''),
256
- );
257
- update_option( 'wcast_returntosender_email_settings', $returntosender_email_opt );
258
-
259
- $wcast_availableforpickup_customizer_email = new wcast_availableforpickup_customizer_email();
260
- $availableforpickup_email_opt = array(
261
- 'wcast_enable_availableforpickup_email' => get_theme_mod('wcast_enable_availableforpickup_email',$wcast_availableforpickup_customizer_email->defaults['wcast_enable_availableforpickup_email']),
262
- 'wcast_availableforpickup_email_to' => get_theme_mod('wcast_availableforpickup_email_to',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_email_to']),
263
- 'wcast_availableforpickup_email_subject' => get_theme_mod('wcast_availableforpickup_email_subject',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_email_subject']),
264
- 'wcast_availableforpickup_email_heading' => get_theme_mod('wcast_availableforpickup_email_heading',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_email_heading']),
265
- 'wcast_availableforpickup_show_tracking_details' => get_theme_mod('wcast_availableforpickup_show_tracking_details',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_show_tracking_details']),
266
- 'wcast_availableforpickup_show_order_details' => get_theme_mod('wcast_availableforpickup_show_order_details',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_show_order_details']),
267
- 'wcast_availableforpickup_show_billing_address' => get_theme_mod('wcast_availableforpickup_show_billing_address',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_show_billing_address']),'wcast_availableforpickup_show_shipping_address' => get_theme_mod('wcast_availableforpickup_show_shipping_address',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_show_shipping_address']),
268
- 'wcast_availableforpickup_email_content' => get_theme_mod('wcast_availableforpickup_email_content',$wcast_availableforpickup_customizer_email->defaults['wcast_availableforpickup_email_content']),
269
- 'wcast_availableforpickup_analytics_link' => get_theme_mod('wcast_availableforpickup_analytics_link',''),
270
- );
271
- update_option( 'wcast_availableforpickup_email_settings', $availableforpickup_email_opt );
272
-
273
- $wcast_outfordelivery_customizer_email = new wcast_outfordelivery_customizer_email();
274
- $outfordelivery_email_opt = array(
275
- 'wcast_enable_outfordelivery_email' => get_theme_mod('wcast_enable_outfordelivery_email',$wcast_outfordelivery_customizer_email->defaults['wcast_enable_outfordelivery_email']),
276
- 'wcast_outfordelivery_email_to' => get_theme_mod('wcast_outfordelivery_email_to',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_email_to']),
277
- 'wcast_outfordelivery_email_subject' => get_theme_mod('wcast_outfordelivery_email_subject',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_email_subject']),
278
- 'wcast_outfordelivery_email_heading' => get_theme_mod('wcast_outfordelivery_email_heading',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_email_heading']),
279
- 'wcast_outfordelivery_show_tracking_details' => get_theme_mod('wcast_outfordelivery_show_tracking_details',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_show_tracking_details']),
280
- 'wcast_outfordelivery_show_order_details' => get_theme_mod('wcast_outfordelivery_show_order_details',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_show_order_details']),
281
- 'wcast_outfordelivery_show_billing_address' => get_theme_mod('wcast_outfordelivery_show_billing_address',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_show_billing_address']), 'wcast_outfordelivery_show_shipping_address' => get_theme_mod('wcast_outfordelivery_show_shipping_address',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_show_shipping_address']),
282
- 'wcast_outfordelivery_email_content' => get_theme_mod('wcast_outfordelivery_email_content',$wcast_outfordelivery_customizer_email->defaults['wcast_outfordelivery_email_content']),
283
- 'wcast_outfordelivery_analytics_link' => get_theme_mod('wcast_outfordelivery_analytics_link',''),
284
- );
285
- update_option( 'wcast_outfordelivery_email_settings', $outfordelivery_email_opt );
286
-
287
- $wcast_failure_customizer_email = new wcast_failure_customizer_email();
288
- $failure_email_opt = array(
289
- 'wcast_enable_failure_email' => get_theme_mod('wcast_enable_failure_email',$wcast_failure_customizer_email->defaults['wcast_enable_failure_email']),
290
- 'wcast_failure_email_to' => get_theme_mod('wcast_failure_email_to',$wcast_failure_customizer_email->defaults['wcast_failure_email_to']),
291
- 'wcast_failure_email_subject' => get_theme_mod('wcast_failure_email_subject',$wcast_failure_customizer_email->defaults['wcast_failure_email_subject']),
292
- 'wcast_failure_email_heading' => get_theme_mod('wcast_failure_email_heading',$wcast_failure_customizer_email->defaults['wcast_failure_email_heading']),
293
- 'wcast_failure_show_tracking_details' => get_theme_mod('wcast_failure_show_tracking_details',$wcast_failure_customizer_email->defaults['wcast_failure_show_tracking_details']),
294
- 'wcast_failure_show_order_details' => get_theme_mod('wcast_failure_show_order_details',$wcast_failure_customizer_email->defaults['wcast_failure_show_order_details']),
295
- 'wcast_failure_show_billing_address' => get_theme_mod('wcast_failure_show_billing_address',$wcast_failure_customizer_email->defaults['wcast_failure_show_billing_address']),
296
- 'wcast_failure_show_shipping_address' => get_theme_mod('wcast_failure_show_shipping_address',$wcast_failure_customizer_email->defaults['wcast_failure_show_shipping_address']),
297
- 'wcast_failure_email_content' => get_theme_mod('wcast_failure_email_content',$wcast_failure_customizer_email->defaults['wcast_failure_email_content']),
298
- 'wcast_failure_analytics_link' => get_theme_mod('wcast_failure_analytics_link',''),
299
- );
300
- update_option( 'wcast_failure_email_settings', $failure_email_opt );
301
-
302
- $wcast_delivered_customizer_email = new wcast_delivered_customizer_email();
303
- $delivered_status_email_opt = array(
304
- 'wcast_enable_delivered_status_email' => get_theme_mod('wcast_enable_delivered_status_email',$wcast_delivered_customizer_email->defaults['wcast_enable_delivered_status_email']),
305
- 'wcast_delivered_status_email_to' => get_theme_mod('wcast_delivered_status_email_to',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_email_to']),
306
- 'wcast_delivered_status_email_subject' => get_theme_mod('wcast_delivered_status_email_subject',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_email_subject']),
307
- 'wcast_delivered_status_email_heading' => get_theme_mod('wcast_delivered_status_email_heading',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_email_heading']),
308
- 'wcast_delivered_status_show_tracking_details' => get_theme_mod('wcast_delivered_status_show_tracking_details',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_tracking_details']),
309
- 'wcast_delivered_status_show_order_details' => get_theme_mod('wcast_delivered_status_show_order_details',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_order_details']),
310
- 'wcast_delivered_status_show_billing_address' => get_theme_mod('wcast_delivered_status_show_billing_address',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_billing_address']), 'wcast_delivered_status_show_shipping_address' => get_theme_mod('wcast_delivered_status_show_shipping_address',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_show_shipping_address']),
311
- 'wcast_delivered_status_email_content' => get_theme_mod('wcast_delivered_status_email_content',$wcast_delivered_customizer_email->defaults['wcast_delivered_status_email_content']),
312
- 'wcast_delivered_status_analytics_link' => get_theme_mod('wcast_delivered_status_analytics_link',''),
313
- );
314
- update_option( 'wcast_delivered_email_settings', $delivered_status_email_opt );
315
-
316
- $wcast_late_shipments_customizer_email = new wcast_late_shipments_customizer_email();
317
- $late_shipments_email_opt = array(
318
- 'wcast_enable_late_shipments_admin_email' => get_theme_mod('wcast_enable_late_shipments_admin_email',$wcast_late_shipments_customizer_email->defaults['wcast_enable_late_shipments_admin_email']),
319
- 'wcast_late_shipments_days' => get_theme_mod('wcast_late_shipments_days',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_days']),
320
- 'wcast_late_shipments_email_to' => get_theme_mod('wcast_late_shipments_email_to',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_email_to']),
321
- 'wcast_late_shipments_email_subject' => get_theme_mod('wcast_late_shipments_email_subject',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_email_subject']),
322
- 'wcast_late_shipments_email_heading' => get_theme_mod('wcast_late_shipments_email_heading',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_email_heading']),
323
- 'wcast_late_shipments_show_tracking_details' => get_theme_mod('wcast_late_shipments_show_tracking_details',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_show_tracking_details']),
324
- 'wcast_late_shipments_show_order_details' => get_theme_mod('wcast_late_shipments_show_order_details',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_show_order_details']), 'wcast_late_shipments_show_billing_address' => get_theme_mod('wcast_late_shipments_show_billing_address',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_show_billing_address']),
325
- 'wcast_late_shipments_show_shipping_address' => get_theme_mod('wcast_late_shipments_show_shipping_address',$wcast_late_shipments_customizer_email->defaults['wcast_late_shipments_show_shipping_address']),
326
- 'wcast_late_shipments_email_content' => get_theme_mod('wcast_late_shipments_email_content',''),
327
- );
328
- update_option( 'late_shipments_email_settings', $late_shipments_email_opt );
329
-
330
- update_option( 'wc_advanced_shipment_tracking', '3.8');
331
- }
332
 
333
  if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'3.10', '<') ){
334
  global $wpdb;
92
 
93
  $this->update_shipping_providers();
94
 
95
+ update_option( 'wc_advanced_shipment_tracking', '3.18');
96
  }
97
 
98
  $wc_ast_default_mark_shipped = get_option('wc_ast_default_mark_shipped');
175
  set_theme_mod('show_provider_border', 1);
176
  set_theme_mod('provider_border_color', '#e0e0e0');
177
  update_option( 'wc_advanced_shipment_tracking', '3.6');
178
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'3.10', '<') ){
181
  global $wpdb;
includes/class-wc-advanced-shipment-tracking-trackship.php CHANGED
@@ -55,88 +55,92 @@ class WC_Advanced_Shipment_Tracking_Trackship {
55
  * @since 1.0
56
  */
57
  public function init(){
 
 
 
58
 
59
- add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ) );
60
-
61
- //load trackship css js
62
  add_action( 'admin_enqueue_scripts', array( $this, 'trackship_styles' ), 4);
 
 
63
 
64
- //add_action('admin_menu', array( $this, 'register_woocommerce_trackship_menu' ), 99 );
65
-
66
- //ajax save admin trackship settings
67
- add_action( 'wp_ajax_wc_ast_trackship_form_update', array( $this, 'wc_ast_trackship_form_update_callback' ) );
68
- add_action( 'wp_ajax_trackship_tracking_page_form_update', array( $this, 'trackship_tracking_page_form_update_callback' ) );
69
- add_action( 'wp_ajax_ts_late_shipments_email_form_update', array( $this, 'ts_late_shipments_email_form_update_callback' ) );
70
-
71
- //add Shipment status column after tracking
72
- add_filter( 'manage_edit-shop_order_columns', array( $this, 'wc_add_order_shipment_status_column_header'), 20 );
73
- add_action( 'manage_shop_order_posts_custom_column', array( $this, 'wc_add_order_shipment_status_column_content') );
74
-
75
- //add bulk action - get shipment status
76
- add_filter( 'bulk_actions-edit-shop_order', array( $this, 'add_bulk_actions_get_shipment_status'), 10, 1 );
77
-
78
- // Make the action from selected orders to get shipment status
79
- add_filter( 'handle_bulk_actions-edit-shop_order', array( $this, 'get_shipment_status_handle_bulk_action_edit_shop_order'), 10, 3 );
80
-
81
- // Bulk shipment status sync ajax call from settings
82
- add_action( 'wp_ajax_bulk_shipment_status_from_settings', array( $this, 'bulk_shipment_status_from_settings_fun' ) );
83
-
84
- // Bulk shipment status sync for empty balance ajax call from settings
85
- add_action( 'wp_ajax_bulk_shipment_status_for_empty_balance_from_settings', array( $this, 'bulk_shipment_status_for_empty_balance_from_settings_fun' ) );
86
-
87
- // Bulk shipment status sync for please do connection status ajax call from settings
88
- add_action( 'wp_ajax_bulk_shipment_status_for_do_connection_from_settings', array( $this, 'bulk_shipment_status_for_do_connection_from_settings_fun' ) );
89
-
90
- // The results notice from bulk action on orders
91
- add_action( 'admin_notices', array( $this, 'shipment_status_bulk_action_admin_notice' ) );
92
-
93
- // add 'get_shipment_status' order meta box order action
94
- add_action( 'woocommerce_order_actions', array( $this, 'add_order_meta_box_get_shipment_status_actions' ) );
95
- add_action( 'woocommerce_order_action_get_shipment_status_edit_order', array( $this, 'process_order_meta_box_actions_get_shipment_status' ) );
96
-
97
- // add bulk order filter for exported / non-exported orders
98
- $wc_ast_show_shipment_status_filter = get_option( 'wc_ast_show_shipment_status_filter', 0 );
99
- if( $wc_ast_show_shipment_status_filter == 1 ){
100
- add_action( 'restrict_manage_posts', array( $this, 'filter_orders_by_shipment_status') , 20 );
101
- add_filter( 'request', array( $this, 'filter_orders_by_shipment_status_query' ) );
102
- }
103
-
104
- // trigger when order status changed to shipped or completed
105
- add_action( 'woocommerce_order_status_completed', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
106
-
107
- add_action( 'send_order_to_trackship', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
108
-
109
- add_action( 'woocommerce_order_status_updated-tracking', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
110
-
111
- // filter for shipment status
112
- add_filter("trackship_status_filter", array($this, "trackship_status_filter_func"), 10 , 1);
113
-
114
- // filter for shipment status icon
115
- add_filter("trackship_status_icon_filter", array($this, "trackship_status_icon_filter_func"), 10 , 2);
116
-
117
- add_action( 'wcast_retry_trackship_apicall', array( $this, 'wcast_retry_trackship_apicall_func' ) );
118
-
119
- add_action( 'wp_ajax_update_shipment_status_email_status', array( $this, 'update_shipment_status_email_status_fun') );
120
-
121
- add_action( 'wp_ajax_update_enable_late_shipments_email', array( $this, 'update_enable_late_shipments_email_fun') );
 
 
122
 
123
- add_action( 'ast_shipment_tracking_end', array( $this, 'display_shipment_tracking_info'), 10, 2 );
124
-
125
- add_action( 'delete_tracking_number_from_trackship', array( $this, 'delete_tracking_number_from_trackship'), 10, 3 );
126
-
127
- //fix shipment tracking for deleted tracking
128
- add_action("fix_shipment_tracking_for_deleted_tracking", array( $this, 'func_fix_shipment_tracking_for_deleted_tracking' ), 10, 3 );
129
-
130
- add_action( 'wp_dashboard_setup', array( $this, 'ast_add_dashboard_widgets') );
131
-
132
- //filter in shipped orders
133
- add_filter( 'is_order_shipped', array( $this, "check_tracking_exist" ),10,2);
134
- add_filter( 'is_order_shipped', array( $this, "check_order_status" ),5,2);
135
-
136
- add_filter( 'ast_menu_tab_options', array( $this, 'ast_menu_trackship_options' ) );
137
- add_action( 'ast_paypal_settings_panel', array( $this, 'ast_trackship_settings_panel' ) );
138
 
139
- add_action( 'wp_ajax_wc_ast_trackship_automation_form_update', array( $this, 'wc_ast_trackship_automation_form_update') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  /**
55
  * @since 1.0
56
  */
57
  public function init(){
58
+
59
+ add_filter( 'ast_menu_tab_options', array( $this, 'ast_menu_trackship_options' ) );
60
+ add_action( 'ast_paypal_settings_panel', array( $this, 'ast_trackship_settings_panel' ) );
61
 
 
 
 
62
  add_action( 'admin_enqueue_scripts', array( $this, 'trackship_styles' ), 4);
63
+ $wc_ast_api_key = get_option('wc_ast_api_key');
64
+ if($wc_ast_api_key){
65
 
66
+ add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ) );
67
+
68
+ //load trackship css js
69
+
70
+ //add_action('admin_menu', array( $this, 'register_woocommerce_trackship_menu' ), 99 );
71
+
72
+ //ajax save admin trackship settings
73
+ add_action( 'wp_ajax_wc_ast_trackship_form_update', array( $this, 'wc_ast_trackship_form_update_callback' ) );
74
+ add_action( 'wp_ajax_trackship_tracking_page_form_update', array( $this, 'trackship_tracking_page_form_update_callback' ) );
75
+ add_action( 'wp_ajax_ts_late_shipments_email_form_update', array( $this, 'ts_late_shipments_email_form_update_callback' ) );
76
+
77
+ //add Shipment status column after tracking
78
+ add_filter( 'manage_edit-shop_order_columns', array( $this, 'wc_add_order_shipment_status_column_header'), 20 );
79
+ add_action( 'manage_shop_order_posts_custom_column', array( $this, 'wc_add_order_shipment_status_column_content') );
80
+
81
+ //add bulk action - get shipment status
82
+ add_filter( 'bulk_actions-edit-shop_order', array( $this, 'add_bulk_actions_get_shipment_status'), 10, 1 );
83
+
84
+ // Make the action from selected orders to get shipment status
85
+ add_filter( 'handle_bulk_actions-edit-shop_order', array( $this, 'get_shipment_status_handle_bulk_action_edit_shop_order'), 10, 3 );
86
+
87
+ // Bulk shipment status sync ajax call from settings
88
+ add_action( 'wp_ajax_bulk_shipment_status_from_settings', array( $this, 'bulk_shipment_status_from_settings_fun' ) );
89
+
90
+ // Bulk shipment status sync for empty balance ajax call from settings
91
+ add_action( 'wp_ajax_bulk_shipment_status_for_empty_balance_from_settings', array( $this, 'bulk_shipment_status_for_empty_balance_from_settings_fun' ) );
92
+
93
+ // Bulk shipment status sync for please do connection status ajax call from settings
94
+ add_action( 'wp_ajax_bulk_shipment_status_for_do_connection_from_settings', array( $this, 'bulk_shipment_status_for_do_connection_from_settings_fun' ) );
95
+
96
+ // The results notice from bulk action on orders
97
+ add_action( 'admin_notices', array( $this, 'shipment_status_bulk_action_admin_notice' ) );
98
+
99
+ // add 'get_shipment_status' order meta box order action
100
+ add_action( 'woocommerce_order_actions', array( $this, 'add_order_meta_box_get_shipment_status_actions' ) );
101
+ add_action( 'woocommerce_order_action_get_shipment_status_edit_order', array( $this, 'process_order_meta_box_actions_get_shipment_status' ) );
102
+
103
+ // add bulk order filter for exported / non-exported orders
104
+ $wc_ast_show_shipment_status_filter = get_option( 'wc_ast_show_shipment_status_filter', 0 );
105
+ if( $wc_ast_show_shipment_status_filter == 1 ){
106
+ add_action( 'restrict_manage_posts', array( $this, 'filter_orders_by_shipment_status') , 20 );
107
+ add_filter( 'request', array( $this, 'filter_orders_by_shipment_status_query' ) );
108
+ }
109
+
110
+ // trigger when order status changed to shipped or completed
111
+ add_action( 'woocommerce_order_status_completed', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
112
+
113
+ add_action( 'send_order_to_trackship', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
114
+
115
+ add_action( 'woocommerce_order_status_updated-tracking', array( $this, 'trigger_woocommerce_order_status_completed'), 10, 1 );
116
+
117
+ // filter for shipment status
118
+ add_filter("trackship_status_filter", array($this, "trackship_status_filter_func"), 10 , 1);
119
+
120
+ // filter for shipment status icon
121
+ add_filter("trackship_status_icon_filter", array($this, "trackship_status_icon_filter_func"), 10 , 2);
122
+
123
+ add_action( 'wcast_retry_trackship_apicall', array( $this, 'wcast_retry_trackship_apicall_func' ) );
124
+
125
+ add_action( 'wp_ajax_update_shipment_status_email_status', array( $this, 'update_shipment_status_email_status_fun') );
126
 
127
+ add_action( 'wp_ajax_update_enable_late_shipments_email', array( $this, 'update_enable_late_shipments_email_fun') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
+ add_action( 'ast_shipment_tracking_end', array( $this, 'display_shipment_tracking_info'), 10, 2 );
130
+
131
+ add_action( 'delete_tracking_number_from_trackship', array( $this, 'delete_tracking_number_from_trackship'), 10, 3 );
132
+
133
+ //fix shipment tracking for deleted tracking
134
+ add_action("fix_shipment_tracking_for_deleted_tracking", array( $this, 'func_fix_shipment_tracking_for_deleted_tracking' ), 10, 3 );
135
+
136
+ add_action( 'wp_dashboard_setup', array( $this, 'ast_add_dashboard_widgets') );
137
+
138
+ //filter in shipped orders
139
+ add_filter( 'is_order_shipped', array( $this, "check_tracking_exist" ),10,2);
140
+ add_filter( 'is_order_shipped', array( $this, "check_order_status" ),5,2);
141
+
142
+ add_action( 'wp_ajax_wc_ast_trackship_automation_form_update', array( $this, 'wc_ast_trackship_automation_form_update') );
143
+ }
144
  }
145
 
146
  /**
readme.txt CHANGED
@@ -142,6 +142,9 @@ Yes, if you use external shipping services that work with the WooCommerce REST A
142
 
143
  == Changelog ==
144
 
 
 
 
145
  = 3.2.1 =
146
  * Enhancement - Updated the Shipment Tracking settings page design
147
  * Enhancement - Updated the Shipping Providers listing page design
142
 
143
  == Changelog ==
144
 
145
+ = 3.2.1.1 =
146
+ * Fix - Fixed Invalid user key in Shipment tracking section if TrackShip is not connected
147
+
148
  = 3.2.1 =
149
  * Enhancement - Updated the Shipment Tracking settings page design
150
  * Enhancement - Updated the Shipping Providers listing page design
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
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';
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.1
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.1';
25
 
26
  /**
27
  * Initialize the main plugin function