Advanced Shipment Tracking for WooCommerce - Version 2.3

Version Description

  • Fixed - PHP Warning
  • Fixed - Unable to override customer-delivered-order.php template
  • Fixed - Sync Providers issues with images when adding new providers
  • Added details info of the changes after Sync Providers
  • Added "Change order to Shipped?" checkbox when adding tracking info to orders
  • Added "DHL Freight","Sendle" and "Deppon" shipping provider
  • Added Slug field to shipping providers table
  • Added ajax overlay in customizer refresh
  • Updated settings page design
  • Updated - When new provider added default status is inactive
  • Updated - added parameter in return url of tracking info customizer and shipping status email customizer so when close customizer directly go into particular tab
  • Updated - remove trim from tracking number when add tracking info to orders
Download this release

Release Info

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

Code changes from version 2.2 to 2.3

Files changed (195) hide show
  1. assets/css/admin.css +625 -45
  2. assets/css/customizer-styles.css +75 -2
  3. assets/css/front.css +216 -40
  4. assets/css/icons/Branded-Tracking-Page.png +0 -0
  5. assets/css/icons/Delivered-512.png +0 -0
  6. assets/{shipment-provider-img/fastways.png → css/icons/Delivered-o.png} +0 -0
  7. assets/css/icons/In-Transit--o.png +0 -0
  8. assets/css/icons/In-Transit-512.png +0 -0
  9. assets/css/icons/Multi-Carrier-Support.png +0 -0
  10. assets/css/icons/Out-for-Delivery-512.png +0 -0
  11. assets/css/icons/Out-for-Delivery-o.png +0 -0
  12. assets/css/icons/Pre-Transit-512.png +0 -0
  13. assets/css/icons/Pre-Transit-o.png +0 -0
  14. assets/css/icons/available-for-picup-512.png +0 -0
  15. assets/css/icons/available-for-picup-o.png +0 -0
  16. assets/css/icons/available-for-picup-v3.png +0 -0
  17. assets/css/icons/available-for-picup-v4.png +0 -0
  18. assets/css/icons/cancel-o.png +0 -0
  19. assets/css/icons/cancel-v3.png +0 -0
  20. assets/css/icons/cancel-v4.png +0 -0
  21. assets/css/icons/carrier-unsupported-v3.png +0 -0
  22. assets/css/icons/carrier-unsupported-v4.png +0 -0
  23. assets/css/icons/customer-support.png +0 -0
  24. assets/css/icons/delivered-grey-v3.png +0 -0
  25. assets/css/icons/delivered-v3.png +0 -0
  26. assets/css/icons/delivered-v4.png +0 -0
  27. assets/css/icons/delivery-email-2.png +0 -0
  28. assets/css/icons/failure-512.png +0 -0
  29. assets/css/icons/failure-o.png +0 -0
  30. assets/css/icons/failure-v3.png +0 -0
  31. assets/css/icons/failure-v4.png +0 -0
  32. assets/css/icons/in-transit-grey-v3.png +0 -0
  33. assets/css/icons/in-transit-v3.png +0 -0
  34. assets/css/icons/in-transit-v4.png +0 -0
  35. assets/css/icons/out-for-delivery-grey-v3.png +0 -0
  36. assets/css/icons/out-for-delivery-v3.png +0 -0
  37. assets/css/icons/out-for-delivery-v4.png +0 -0
  38. assets/css/icons/pending-trackship-v3.png +0 -0
  39. assets/css/icons/pending-trackship-v4.png +0 -0
  40. assets/css/icons/pre-transit-v3.png +0 -0
  41. assets/css/icons/pre-transit-v4.png +0 -0
  42. assets/css/icons/return-to-sender-512.png +0 -0
  43. assets/css/icons/return-to-sender-o.png +0 -0
  44. assets/css/icons/return-to-sender-v3.png +0 -0
  45. assets/css/icons/return-to-sender-v4.png +0 -0
  46. assets/css/icons/shiping-and-delivery-analytics.png +0 -0
  47. assets/css/icons/unknown-v3.png +0 -0
  48. assets/css/icons/unknown-v4.png +0 -0
  49. assets/css/icons/woo-inegration.png +0 -0
  50. assets/css/preview-styles.css +12 -0
  51. assets/images/checked.png +0 -0
  52. assets/images/unchecked.png +0 -0
  53. assets/js/admin.js +16 -0
  54. assets/js/customizer-scripts.js +25 -3
  55. assets/js/front.js +10 -0
  56. assets/js/preview-scripts.js +4 -4
  57. assets/js/shipping_row.js +484 -556
  58. assets/shipment-provider-img/abf.png +0 -0
  59. assets/shipment-provider-img/aliexpress-standard-shipping.png +0 -0
  60. assets/shipment-provider-img/an-post.png +0 -0
  61. assets/shipment-provider-img/apc.png +0 -0
  62. assets/shipment-provider-img/arrowxl.png +0 -0
  63. assets/shipment-provider-img/associated-global-systems.png +0 -0
  64. assets/shipment-provider-img/australia-ems.png +0 -0
  65. assets/shipment-provider-img/australia-post.png +0 -0
  66. assets/shipment-provider-img/bangladesh-ems.png +0 -0
  67. assets/shipment-provider-img/belgium-post.png +0 -0
  68. assets/shipment-provider-img/boxberry.png +0 -0
  69. assets/shipment-provider-img/brazil-correios.png +0 -0
  70. assets/shipment-provider-img/canada-post.png +0 -0
  71. assets/shipment-provider-img/canpar.png +0 -0
  72. assets/shipment-provider-img/china-post.png +0 -0
  73. assets/shipment-provider-img/chronopost.png +0 -0
  74. assets/shipment-provider-img/colis-prive.png +0 -0
  75. assets/shipment-provider-img/colissimo.png +0 -0
  76. assets/shipment-provider-img/colombia-post.png +0 -0
  77. assets/shipment-provider-img/correios.png +0 -0
  78. assets/shipment-provider-img/correos-chile.png +0 -0
  79. assets/shipment-provider-img/correos-costa-rica.png +0 -0
  80. assets/shipment-provider-img/costa-rica-post.png +0 -0
  81. assets/shipment-provider-img/couriersplease.png +0 -0
  82. assets/shipment-provider-img/croatia-post.png +0 -0
  83. assets/shipment-provider-img/cyprus-post.png +0 -0
  84. assets/shipment-provider-img/dai-post.png +0 -0
  85. assets/shipment-provider-img/delhivery.png +0 -0
  86. assets/shipment-provider-img/deliv.png +0 -0
  87. assets/shipment-provider-img/denmark-post.png +0 -0
  88. assets/shipment-provider-img/{fastway-couriers.png → deppon.png} +0 -0
  89. assets/shipment-provider-img/deutsche-post-dhl.png +0 -0
  90. assets/shipment-provider-img/deutsche-post.png +0 -0
  91. assets/shipment-provider-img/dhl-at.png +0 -0
  92. assets/shipment-provider-img/dhl-cz.png +0 -0
  93. assets/shipment-provider-img/dhl-express.png +0 -0
  94. assets/shipment-provider-img/dhl-freight.png +0 -0
  95. assets/shipment-provider-img/dhl-intraship-de.png +0 -0
  96. assets/shipment-provider-img/dhl-se.png +0 -0
  97. assets/shipment-provider-img/dhl-uk.png +0 -0
  98. assets/shipment-provider-img/dhl-us.png +0 -0
  99. assets/shipment-provider-img/dhlparcel-nl.png +0 -0
  100. assets/shipment-provider-img/direct-link.png +0 -0
  101. assets/shipment-provider-img/dpd-at.png +0 -0
  102. assets/shipment-provider-img/dpd-co-uk.png +0 -0
  103. assets/shipment-provider-img/dpd-cz.png +0 -0
  104. assets/shipment-provider-img/dpd-de.png +0 -0
  105. assets/shipment-provider-img/dpd-ie.png +0 -0
  106. assets/shipment-provider-img/dpd-nl.png +0 -0
  107. assets/shipment-provider-img/dpd-romania.png +0 -0
  108. assets/shipment-provider-img/dtdc-plus.png +0 -0
  109. assets/shipment-provider-img/dtdc.png +0 -0
  110. assets/shipment-provider-img/ec-firstclass.png +0 -0
  111. assets/shipment-provider-img/ecom-express.png +0 -0
  112. assets/shipment-provider-img/ems.png +0 -0
  113. assets/shipment-provider-img/epacket.png +0 -0
  114. assets/shipment-provider-img/estonia-post.png +0 -0
  115. assets/shipment-provider-img/fastway-au.png +0 -0
  116. assets/shipment-provider-img/fastway-nz.png +0 -0
  117. assets/shipment-provider-img/fedex.png +0 -0
  118. assets/shipment-provider-img/france-ems-chronopost.png +0 -0
  119. assets/shipment-provider-img/gso.png +0 -0
  120. assets/shipment-provider-img/hermes.png +0 -0
  121. assets/shipment-provider-img/hong-kong-post.png +0 -0
  122. assets/shipment-provider-img/india-post.png +0 -0
  123. assets/shipment-provider-img/interlink.png +0 -0
  124. assets/shipment-provider-img/israel-post.png +0 -0
  125. assets/shipment-provider-img/ivory-coast-ems.png +0 -0
  126. assets/shipment-provider-img/jp-post.png +0 -0
  127. assets/shipment-provider-img/korea-post.png +0 -0
  128. assets/shipment-provider-img/la-poste.png +0 -0
  129. assets/shipment-provider-img/lasership.png +0 -0
  130. assets/shipment-provider-img/latvijas-pasts.png +0 -0
  131. assets/shipment-provider-img/monaco-ems.png +0 -0
  132. assets/shipment-provider-img/mondial-relay.png +0 -0
  133. assets/shipment-provider-img/ninja-van.png +0 -0
  134. assets/shipment-provider-img/ontrac.png +0 -0
  135. assets/shipment-provider-img/overseas-territory-fr-ems.png +0 -0
  136. assets/shipment-provider-img/parcelforce.png +0 -0
  137. assets/shipment-provider-img/portugal-post-ctt.png +0 -0
  138. assets/shipment-provider-img/postnl.png +0 -0
  139. assets/shipment-provider-img/postnord-sverige-ab.png +0 -0
  140. assets/shipment-provider-img/royal-mail.png +0 -0
  141. assets/shipment-provider-img/s-f-express.png +0 -0
  142. assets/shipment-provider-img/{bpost.png → sendle.png} +0 -0
  143. assets/shipment-provider-img/singapore-post.png +0 -0
  144. assets/shipment-provider-img/south-african-post-office.png +0 -0
  145. assets/shipment-provider-img/speedex-courier.png +0 -0
  146. assets/shipment-provider-img/startrack.png +0 -0
  147. assets/shipment-provider-img/swiss-post.png +0 -0
  148. assets/shipment-provider-img/tnt-australia.png +0 -0
  149. assets/shipment-provider-img/tnt-click.png +0 -0
  150. assets/shipment-provider-img/tnt-france.png +0 -0
  151. assets/shipment-provider-img/tnt-italy.png +0 -0
  152. assets/shipment-provider-img/tnt-reference.png +0 -0
  153. assets/shipment-provider-img/tnt-uk.png +0 -0
  154. assets/shipment-provider-img/tnt.png +0 -0
  155. assets/shipment-provider-img/ukraine-ems.png +0 -0
  156. assets/shipment-provider-img/ukrposhta.png +0 -0
  157. assets/shipment-provider-img/ups-germany.png +0 -0
  158. assets/shipment-provider-img/ups-i-parcel.png +0 -0
  159. assets/shipment-provider-img/ups-se.png +0 -0
  160. assets/shipment-provider-img/ups.png +0 -0
  161. assets/shipment-provider-img/usps.png +0 -0
  162. includes/class-wc-advanced-shipment-tracking-admin.php +539 -483
  163. includes/class-wc-advanced-shipment-tracking-api-call.php +1 -1
  164. includes/class-wc-advanced-shipment-tracking-front.php +465 -198
  165. includes/class-wc-advanced-shipment-tracking-install.php +752 -96
  166. includes/class-wc-advanced-shipment-tracking.php +41 -11
  167. includes/customizer/class-wc-availableforpickup-email-customizer.php +5 -4
  168. includes/customizer/class-wc-delivered-email-customizer.php +5 -4
  169. includes/customizer/class-wc-email-customizer.php +1 -0
  170. includes/customizer/{class-wc-pretransit-email-customizer.php → class-wc-failure-email-customizer.php} +79 -78
  171. includes/customizer/class-wc-intransit-email-customizer.php +5 -4
  172. includes/customizer/class-wc-outfordelivery-email-customizer.php +5 -4
  173. includes/customizer/class-wc-returntosender-email-customizer.php +5 -4
  174. includes/customizer/class-wc-tracking-info-customizer.php +106 -88
  175. includes/customizer/class-wc-tracking-page-customizer.php +1 -0
  176. includes/customizer/class-wcast-customizer.php +30 -27
  177. includes/customizer/preview/availableforpickup_preview.php +4 -4
  178. includes/customizer/preview/delivered_preview.php +4 -4
  179. includes/customizer/preview/delivered_status_preview.php +4 -4
  180. includes/customizer/preview/failure_preview.php +30 -0
  181. includes/customizer/preview/intransit_preview.php +4 -4
  182. includes/customizer/preview/outfordelivery_preview.php +4 -4
  183. includes/customizer/preview/pretransit_preview.php +0 -30
  184. includes/customizer/preview/preview.php +4 -4
  185. includes/customizer/preview/returntosender_preview.php +4 -4
  186. includes/emails/class-shipment-delivered-email.php +84 -67
  187. includes/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php +2 -2
  188. includes/views/admin_options_bulk_upload.php +5 -8
  189. includes/views/admin_options_email_notifications.php +7 -19
  190. includes/views/admin_options_settings.php +19 -9
  191. includes/views/admin_options_shipping_provider.php +174 -191
  192. includes/views/admin_options_trackship_integration.php +156 -18
  193. includes/views/zorem_admin_sidebar.php +2 -2
  194. readme.txt +46 -20
  195. woocommerce-advanced-shipment-tracking.php +6 -3
assets/css/admin.css CHANGED
@@ -33,9 +33,12 @@
33
  #woocommerce-advanced-shipment-tracking #shipment-tracking-form p.form-field {
34
  margin-top: 0
35
  }
36
- #woocommerce-advanced-shipment-tracking input {
37
  width: 100%
38
  }
 
 
 
39
  #woocommerce-advanced-shipment-tracking .preview_tracking_link {
40
  display: none;
41
  margin-bottom: 0
@@ -121,8 +124,8 @@ input.tab_input_1 + label{
121
  vertical-align:top;
122
  }
123
  input.tab_input_1:checked + label{
124
- color: #000;
125
- font-weight: 600;
126
  border: none;
127
  }
128
  .tab_inner_container {
@@ -131,7 +134,7 @@ input.tab_input_1:checked + label{
131
  .tab_inner_container h4 {
132
  margin-top: 0;
133
  }
134
- #tab1:checked ~ #content1, #tab2:checked ~ #content2, #tab3:checked ~ #content3, #tab4:checked ~ #content4, #tab5:checked ~ #content5, #tab6:checked ~ #content6, #tab7:checked ~ #content7 {
135
  display: block;
136
  }
137
  .shipping_add_field {
@@ -145,6 +148,7 @@ input.tab_input_1:checked + label{
145
  width: 100%;
146
  table-layout: fixed;
147
  margin: 0;
 
148
  }
149
  .zorem_admin_content {
150
  width: 100%;
@@ -514,11 +518,14 @@ td.column-columnname.url-column {
514
  .csv_upload_status li.error {
515
  color: red;
516
  }
517
- .form-table td.input_file_cl {
518
- padding-left: 0;
 
 
 
519
  }
520
- #wc_ast_settings_form .form-table tr {
521
- border-bottom: 1px solid #fff;
522
  }
523
  input#wc_ast_api_key {
524
  width: 260px;
@@ -535,9 +542,10 @@ span.api_connected .dashicons.dashicons-yes {
535
  margin: 10px auto 30px auto;
536
  text-align: left;
537
  }
538
- .ac-container label.headig_label {
539
- padding: 10px 20px 0;
540
- height: 45px;
 
541
  position: relative;
542
  z-index: 20;
543
  display: block;
@@ -546,21 +554,22 @@ span.api_connected .dashicons.dashicons-yes {
546
  text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
547
  font-size: 14px;
548
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea', GradientType=0 );
549
- box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3), 1px 0px 0px 0px rgba(255,255,255,0.9) inset, 0px 2px 2px rgba(0,0,0,0.1);
550
  }
551
  .email_heading{
552
  font-size: 14px!important;
553
  font-weight: 600;
554
  text-decoration: none;
 
555
  }
556
  .email_heading:focus,.email_heading:hover{
557
  outline:none;
558
  box-shadow: none;
559
  }
560
- .ac-container label.headig_label.enable {
561
  background: #ffffff;
562
  }
563
- .ac-container label.headig_label.disable {
564
  background: #f9f9f9;
565
  }
566
  .ac-container input:checked + label.headig_label:hover:after {
@@ -732,9 +741,6 @@ span.email_status_span i.enable {
732
  .ast-shipment-status i {
733
  font-size: 18px;
734
  }
735
- .woocommerce.zorem_admin_layout table.form-table th {
736
- width: 30%;
737
- }
738
  .label_content {
739
  font-weight: 600;
740
  padding: 12px;
@@ -750,6 +756,173 @@ span.email_status_span i.enable {
750
  margin-bottom: 1px;
751
  margin-right: 10px;
752
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
753
  .wcast-shipment-status-icon i {
754
  font-size: 25px;
755
  margin-top: 7px;
@@ -852,10 +1025,10 @@ a.cancel_edit {
852
  }
853
  .email_status_span{
854
  float: right;
855
- padding-top: 5px;
856
  }
857
  .edit_customizer_a{
858
- margin-right: 10px;
859
  line-height: 20px;
860
  font-size: 13px;
861
  text-decoration: none
@@ -868,8 +1041,11 @@ a.cancel_edit {
868
  position: relative;
869
  left: -9999em;
870
  }
871
- .ac-container .headig_label:hover .row-actions{
872
- position:static
 
 
 
873
  }
874
  .woocommerce_page_woocommerce-advanced-shipment-tracking #wpcontent, .woocommerce_page_woocommerce-advanced-shipment-tracking#wpfooter{
875
  background: #f9f9f9;
@@ -975,6 +1151,8 @@ a.cancel_edit {
975
  color: #071d57;
976
  font-size: 17px;
977
  line-height: 23px;
 
 
978
  }
979
  .multiple_checkbox .mdl-switch.is-upgraded{
980
  padding-left: 42px;
@@ -1016,42 +1194,444 @@ a.cancel_edit {
1016
  }
1017
 
1018
  @media screen and (max-width: 1150px) {
1019
- .zorem_admin_layout {
1020
- display: block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1021
  }
1022
- .zorem_admin_sidebar {
1023
- width: auto;
1024
- display: block;
 
 
 
1025
  }
1026
- #add_new_status_email_form .variable_div {
1027
- display: none !important;
 
 
 
1028
  }
1029
- #add_new_status_email_form .variable_div.variable_before_content {
1030
- display: block !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  }
1032
- .ac-container article .variable_div.variable_before_content {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
  display: block;
1034
  }
1035
- .ac-container article .variable_div.variable_before_content, #add_new_status_email_form .variable_div.variable_before_content {
1036
- width: 625px;
1037
- float: none;
1038
- padding: 12px;
1039
  }
1040
- .ac-small .form-table .wp-editor-wrap, #add_new_status_email_form .form-table .wp-editor-wrap {
1041
- width: 625px;
 
 
 
 
 
1042
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1043
  }
1044
 
1045
- @media screen and (max-width: 650px) {
1046
- label.tab_label:before {
1047
- margin: 0;
1048
- font-size: 18px;
 
 
 
 
1049
  }
 
 
 
1050
  }
1051
 
1052
- @media screen and (max-width: 400px) {
1053
- label.tab_label {
1054
- padding: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1055
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1056
  }
1057
- .widefat .column-wc_actions a.delivered_icon.button::after { font-family: woocommerce; content: "\e01a"; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  #woocommerce-advanced-shipment-tracking #shipment-tracking-form p.form-field {
34
  margin-top: 0
35
  }
36
+ #woocommerce-advanced-shipment-tracking input[type=text] {
37
  width: 100%
38
  }
39
+ #woocommerce-advanced-shipment-tracking input[type=checkbox]{
40
+ margin: 0px 4px 0 4px;
41
+ }
42
  #woocommerce-advanced-shipment-tracking .preview_tracking_link {
43
  display: none;
44
  margin-bottom: 0
124
  vertical-align:top;
125
  }
126
  input.tab_input_1:checked + label{
127
+ color: #888;
128
+ font-weight: 400;
129
  border: none;
130
  }
131
  .tab_inner_container {
134
  .tab_inner_container h4 {
135
  margin-top: 0;
136
  }
137
+ #tab1:checked ~ #content1, #tab2:checked ~ #content2, #tab3:checked ~ #content3, #tab4:checked ~ #content4, #tab5:checked ~ #content5, #tab6:checked ~ #content6, #tab7:checked ~ #content7, #tab8:checked ~ #content8, #tab9:checked ~ #content9, #tab10:checked ~ #content10 {
138
  display: block;
139
  }
140
  .shipping_add_field {
148
  width: 100%;
149
  table-layout: fixed;
150
  margin: 0;
151
+ padding-left: 0 !important;
152
  }
153
  .zorem_admin_content {
154
  width: 100%;
518
  .csv_upload_status li.error {
519
  color: red;
520
  }
521
+ .form-table td p{
522
+ margin: 0;
523
+ }
524
+ #wc_ast_settings_form .form-table tr,#wc_ast_trackship_form .form-table tr,#wc_ast_upload_csv_form .form-table tr{
525
+ border-bottom: 1px solid #eee;
526
  }
527
+ a.settings_edit {
528
+ margin-left: 10px;
529
  }
530
  input#wc_ast_api_key {
531
  width: 260px;
542
  margin: 10px auto 30px auto;
543
  text-align: left;
544
  }
545
+ .ac-container .headig_label {
546
+ padding: 15px 20px 15px 55px;
547
+ margin-bottom: 10px;
548
+ /*height: 60px; */
549
  position: relative;
550
  z-index: 20;
551
  display: block;
554
  text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
555
  font-size: 14px;
556
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea', GradientType=0 );
557
+ box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3), 1px 0px 0px 0px rgba(255,255,255,0.9) inset, 0px 2px 2px rgba(0,0,0,0.1);
558
  }
559
  .email_heading{
560
  font-size: 14px!important;
561
  font-weight: 600;
562
  text-decoration: none;
563
+ line-height: 20px;
564
  }
565
  .email_heading:focus,.email_heading:hover{
566
  outline:none;
567
  box-shadow: none;
568
  }
569
+ .ac-container .headig_label.enable {
570
  background: #ffffff;
571
  }
572
+ .ac-container .headig_label.disable {
573
  background: #f9f9f9;
574
  }
575
  .ac-container input:checked + label.headig_label:hover:after {
741
  .ast-shipment-status i {
742
  font-size: 18px;
743
  }
 
 
 
744
  .label_content {
745
  font-weight: 600;
746
  padding: 12px;
756
  margin-bottom: 1px;
757
  margin-right: 10px;
758
  }
759
+ .wcast-shipment-status-icon span{
760
+ margin-top: 4px;
761
+ display: inline-block;
762
+ }
763
+ .wcast-shipment-status-icon .icon-delivered:before{
764
+ content: ' ';
765
+ background-image: url(icons/delivered-v4.png);
766
+ width: 20px;
767
+ height: 20px;
768
+ background-size: cover;
769
+ display: inline-block;
770
+ vertical-align: middle;
771
+ }
772
+ .wcast-shipment-status-icon .icon-in_transit:before{
773
+ content: ' ';
774
+ background-image: url(icons/in-transit-v4.png);
775
+ width: 20px;
776
+ height: 20px;
777
+ background-size: cover;
778
+ display: inline-block;
779
+ vertical-align: middle;
780
+ }
781
+ .wcast-shipment-status-icon .icon-pre_transit:before{
782
+ content: ' ';
783
+ background-image: url(icons/pre-transit-v4.png);
784
+ width: 20px;
785
+ height: 20px;
786
+ background-size: cover;
787
+ display: inline-block;
788
+ vertical-align: middle;
789
+ }
790
+ .wcast-shipment-status-icon .icon-out_for_delivery:before{
791
+ content: ' ';
792
+ background-image: url(icons/out-for-delivery-v4.png);
793
+ width: 20px;
794
+ height: 20px;
795
+ background-size: cover;
796
+ display: inline-block;
797
+ vertical-align: middle;
798
+ }
799
+ .wcast-shipment-status-icon .icon-available_for_pickup:before{
800
+ content: ' ';
801
+ background-image: url(icons/available-for-picup-v4.png);
802
+ width: 20px;
803
+ height: 20px;
804
+ background-size: cover;
805
+ display: inline-block;
806
+ vertical-align: middle;
807
+ }
808
+ .wcast-shipment-status-icon .icon-return_to_sender:before{
809
+ content: ' ';
810
+ background-image: url(icons/return-to-sender-v4.png);
811
+ width: 20px;
812
+ height: 20px;
813
+ background-size: cover;
814
+ display: inline-block;
815
+ vertical-align: middle;
816
+ }
817
+ .wcast-shipment-status-icon .icon-failure:before{
818
+ content: ' ';
819
+ background-image: url(icons/failure-v4.png);
820
+ width: 20px;
821
+ height: 20px;
822
+ background-size: cover;
823
+ display: inline-block;
824
+ vertical-align: middle;
825
+ }
826
+ .wcast-shipment-status-icon .icon-unknown:before{
827
+ content: ' ';
828
+ background-image: url(icons/unknown-v4.png);
829
+ width: 20px;
830
+ height: 20px;
831
+ background-size: cover;
832
+ display: inline-block;
833
+ vertical-align: middle;
834
+ }
835
+ .wcast-shipment-status-icon .icon-pending_trackship:before{
836
+ content: ' ';
837
+ background-image: url(icons/pending-trackship-v4.png);
838
+ width: 20px;
839
+ height: 20px;
840
+ background-size: cover;
841
+ display: inline-block;
842
+ vertical-align: middle;
843
+ }
844
+ .ast-shipment-status .icon-delivered:before{
845
+ content: ' ';
846
+ background-image: url(icons/delivered-v4.png);
847
+ width: 20px;
848
+ height: 20px;
849
+ background-size: cover;
850
+ display: inline-block;
851
+ vertical-align: middle;
852
+ }
853
+ .ast-shipment-status .icon-in_transit:before{
854
+ content: ' ';
855
+ background-image: url(icons/in-transit-v4.png);
856
+ width: 20px;
857
+ height: 20px;
858
+ background-size: cover;
859
+ display: inline-block;
860
+ vertical-align: middle;
861
+ }
862
+ .ast-shipment-status .icon-pre_transit:before{
863
+ content: ' ';
864
+ background-image: url(icons/pre-transit-v4.png);
865
+ width: 20px;
866
+ height: 20px;
867
+ background-size: cover;
868
+ display: inline-block;
869
+ vertical-align: middle;
870
+ }
871
+ .ast-shipment-status .icon-out_for_delivery:before{
872
+ content: ' ';
873
+ background-image: url(icons/out-for-delivery-v4.png);
874
+ width: 20px;
875
+ height: 20px;
876
+ background-size: cover;
877
+ display: inline-block;
878
+ vertical-align: middle;
879
+ }
880
+ .ast-shipment-status .icon-available_for_pickup:before{
881
+ content: ' ';
882
+ background-image: url(icons/available-for-picup-v4.png);
883
+ width: 20px;
884
+ height: 20px;
885
+ background-size: cover;
886
+ display: inline-block;
887
+ vertical-align: middle;
888
+ }
889
+ .ast-shipment-status .icon-return_to_sender:before{
890
+ content: ' ';
891
+ background-image: url(icons/return-to-sender-v4.png);
892
+ width: 20px;
893
+ height: 20px;
894
+ background-size: cover;
895
+ display: inline-block;
896
+ vertical-align: middle;
897
+ }
898
+ .ast-shipment-status .icon-failure:before{
899
+ content: ' ';
900
+ background-image: url(icons/failure-v4.png);
901
+ width: 20px;
902
+ height: 20px;
903
+ background-size: cover;
904
+ display: inline-block;
905
+ vertical-align: middle;
906
+ }
907
+ .ast-shipment-status .icon-unknown:before{
908
+ content: ' ';
909
+ background-image: url(icons/unknown-v4.png);
910
+ width: 20px;
911
+ height: 20px;
912
+ background-size: cover;
913
+ display: inline-block;
914
+ vertical-align: middle;
915
+ }
916
+ .ast-shipment-status .icon-pending_trackship:before{
917
+ content: ' ';
918
+ background-image: url(icons/pending-trackship-v4.png);
919
+ width: 20px;
920
+ height: 20px;
921
+ background-size: cover;
922
+ display: inline-block;
923
+ vertical-align: middle;
924
+ }
925
+
926
  .wcast-shipment-status-icon i {
927
  font-size: 25px;
928
  margin-top: 7px;
1025
  }
1026
  .email_status_span{
1027
  float: right;
1028
+ padding-top: 7px;
1029
  }
1030
  .edit_customizer_a{
1031
+ margin-left: 10px;
1032
  line-height: 20px;
1033
  font-size: 13px;
1034
  text-decoration: none
1041
  position: relative;
1042
  left: -9999em;
1043
  }
1044
+ .ac-container .headig_label .edit_customizer_a{
1045
+ display:none;
1046
+ }
1047
+ .ac-container .headig_label:hover .edit_customizer_a{
1048
+ display:inline-block;
1049
  }
1050
  .woocommerce_page_woocommerce-advanced-shipment-tracking #wpcontent, .woocommerce_page_woocommerce-advanced-shipment-tracking#wpfooter{
1051
  background: #f9f9f9;
1151
  color: #071d57;
1152
  font-size: 17px;
1153
  line-height: 23px;
1154
+ margin-top: 10px;
1155
+ margin-bottom: 10px;
1156
  }
1157
  .multiple_checkbox .mdl-switch.is-upgraded{
1158
  padding-left: 42px;
1194
  }
1195
 
1196
  @media screen and (max-width: 1150px) {
1197
+ .zorem_admin_layout {
1198
+ display: block;
1199
+ }
1200
+ .zorem_admin_sidebar {
1201
+ width: auto;
1202
+ display: block;
1203
+ }
1204
+ #add_new_status_email_form .variable_div {
1205
+ display: none !important;
1206
+ }
1207
+ #add_new_status_email_form .variable_div.variable_before_content {
1208
+ display: block !important;
1209
+ }
1210
+ .ac-container article .variable_div.variable_before_content {
1211
+ display: block;
1212
+ }
1213
+ .ac-container article .variable_div.variable_before_content, #add_new_status_email_form .variable_div.variable_before_content {
1214
+ width: 625px;
1215
+ float: none;
1216
+ padding: 12px;
1217
+ }
1218
+ .ac-small .form-table .wp-editor-wrap, #add_new_status_email_form .form-table .wp-editor-wrap {
1219
+ width: 625px;
1220
+ }
1221
  }
1222
+
1223
+ @media screen and (max-width: 650px) {
1224
+ label.tab_label:before {
1225
+ margin: 0;
1226
+ font-size: 18px;
1227
+ }
1228
  }
1229
+
1230
+ @media screen and (max-width: 400px) {
1231
+ label.tab_label {
1232
+ padding: 15px;
1233
+ }
1234
  }
1235
+ .widefat .column-wc_actions a.delivered_icon.button::after { font-family: woocommerce; content: "\e01a"; }
1236
+
1237
+ .provider {
1238
+ padding: 10px 5px 10px 10px;
1239
+ border: 1px solid #ccc;
1240
+ display: inline-block;
1241
+ width: 19%;
1242
+ margin-bottom: 10px;
1243
+ margin-right: 7px;
1244
+ vertical-align: top;
1245
+ min-height: 110px;
1246
+ box-sizing: border-box;
1247
+ background: #eee;
1248
+ }
1249
+ .provider_list {
1250
+ }
1251
+ .provider-thumb{
1252
+ height: 50px;
1253
+ }
1254
+ .left-div {
1255
+ display: inline-block;
1256
+ vertical-align: middle;
1257
+ width: 30%;
1258
  }
1259
+ .right-div {
1260
+ display: inline-block;
1261
+ vertical-align: middle;
1262
+ margin-left: 8px;
1263
+ width: 62%;
1264
+ }
1265
+ span.provider_name {
1266
+ font-weight: 500;
1267
+ font-size: 14px;
1268
+ }
1269
+ .row-1 {
1270
+ margin-bottom: 5px;
1271
+ }
1272
+ .row-2 {
1273
+ margin-top: 10px;
1274
+ }
1275
+ .default-provider {
1276
+ float: left;
1277
+ }
1278
+ .checked-img {
1279
+ width: 18px;
1280
+ display: inline-block;
1281
+ vertical-align: bottom;
1282
+ }
1283
+ .provider-status {
1284
+ float: right;
1285
+ padding-right: 10px;
1286
+ }
1287
+ .row-2:after{
1288
+ content:'';
1289
+ clear:both;
1290
  display: block;
1291
  }
1292
+ .active_provider {
1293
+ border: 1px solid rgba(131, 189, 49, 0.5);
1294
+ background: #fff;
 
1295
  }
1296
+ .status_filter {
1297
+ margin: 10px 8px 10px 0;
1298
+ display:inline-block;
1299
+ }
1300
+ .status_filter a{
1301
+ padding: 0 5px;
1302
+ text-decoration: none;
1303
  }
1304
+ a.active{
1305
+ color:#83bd31;
1306
+ }
1307
+ .search_section {
1308
+ display: inline-block;
1309
+ float: right;
1310
+ }
1311
+ #search_provider{
1312
+ width: 264px;
1313
+ padding-top: 5px;
1314
+ padding-bottom: 5px;
1315
+ border-radius: 3px;
1316
+ padding-left: 30px;
1317
+ }
1318
+ .search_section .search-icon{
1319
+ position: absolute;
1320
+ padding: 5px;
1321
+ }
1322
+ .provider_settings {
1323
+ display: inline-block;
1324
+ float: right;
1325
+ margin-top: 5px;
1326
+ margin-left: 5px;
1327
  }
1328
 
1329
+ .provider_top:after{
1330
+ content:'';
1331
+ clear:both;
1332
+ display:block;
1333
+ }
1334
+ .provider_top {
1335
+ position: relative;
1336
+ margin-bottom: 10px;
1337
  }
1338
+ .dropdown {
1339
+ position: relative;
1340
+ display: inline-block;
1341
  }
1342
 
1343
+ .dropdown-content {
1344
+ display: none;
1345
+ position: absolute;
1346
+ right: 0;
1347
+ background-color: #f9f9f9;
1348
+ min-width: 220px;
1349
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1350
+ z-index: 100;
1351
+ border: 1px solid #ccc;
1352
+ padding: .5rem;
1353
+ margin-top: 0;
1354
+ }
1355
+ .dropdown-content li {
1356
+ margin-bottom: 0;
1357
+ border-bottom: 1px solid #ebeef2;
1358
+ padding: .5rem;
1359
+ }
1360
+ .dropdown-content li a {
1361
+ color: black;
1362
+ text-decoration: none;
1363
+ display: block;
1364
+
1365
+ }
1366
+ .dropdown-content li a.reset_active,.dropdown-content li a.reset_inactive{
1367
+ display: inline-block;
1368
+ color: #0073aa;
1369
+ }
1370
+ .dropdown-content li:last-child{
1371
+ border-bottom: none;
1372
+ }
1373
+ .dropdown-content li:hover {background-color: #f1f1f1;}
1374
+ /*.dropdown:hover .dropdown-content {display: block;}*/
1375
+
1376
+ .dropdown_menu{
1377
+ cursor: pointer;
1378
+ padding: 0 5px 10px;
1379
+ }
1380
+ .dropdown-content:before{
1381
+ content: '';
1382
+ width: .75rem;
1383
+ height: .75rem;
1384
+ position: absolute;
1385
+ z-index: 1;
1386
+ top: -0.375rem;
1387
+ right: 8px;
1388
+ background-color: #fff;
1389
+ transform: rotate(45deg);
1390
+ /* box-shadow: -1px -1px 1px rgba(0,0,0,0.125); */
1391
+ border: 1px solid #aebacc;
1392
+ border-width: 1px 0 0 1px;
1393
+ margin-top: -1px;
1394
+ }
1395
+ .mdl-dialog.add_custom_dialog{
1396
+ width: 600px;
1397
+ }
1398
+ .add_custom_dialog .mdl-dialog__title{
1399
+ font-size: 30px;
1400
+ }
1401
+
1402
+ .popupwrapper {
1403
+ position: fixed;
1404
+ top: 0;
1405
+ left: 0;
1406
+ background: rgba(0, 0, 0, 0.4);
1407
+ z-index: 10;
1408
+ width: 100%;
1409
+ height: 100%;
1410
+ text-align: center;
1411
+ }
1412
+ .popupwrapper:after {
1413
+ content: '';
1414
+ display: inline-block;
1415
+ vertical-align: middle;
1416
+ height: 100%;
1417
+ }
1418
+ .popuprow {
1419
+ display: inline-block;
1420
+ vertical-align: middle;
1421
+ max-width: 300px;
1422
+ background: #f9f9f9;
1423
+ padding: 30px;
1424
+ position: relative;
1425
+ z-index: 10;
1426
+ border-radius: 2px;
1427
+ width: 97%;
1428
+ width: calc(100% - 5px);
1429
+ max-height: 90%;
1430
+ overflow-y: overlay;
1431
  }
1432
+ .popupclose {
1433
+ position: absolute;
1434
+ width: 100%;
1435
+ height: 100%;
1436
+ z-index: 9;
1437
+ top: 0;
1438
+ left: 0;
1439
+ }
1440
+ .popupwrapper input[type=text]{
1441
+ line-height: 24px;
1442
+ color: #0d0d0d;
1443
+ width: 90%;
1444
+ margin-bottom: 10px;
1445
+ /*border: 1px solid #ddd !important;*/
1446
+ }
1447
+ .popupwrapper input[type=text].image_path{
1448
+ width: 68%;
1449
+ }
1450
+ .popupwrapper select{
1451
+ line-height: 24px;
1452
+ color: #0d0d0d;
1453
+ width: 90%;
1454
+ margin-bottom: 10px;
1455
+ height: 32px;
1456
+ /*border: 1px solid #ddd !important;*/
1457
+ }
1458
+ .close-button{
1459
+ background: #000 none repeat scroll 0 0;
1460
+ height: 50px;
1461
+ margin-top: 10px;
1462
+ padding: 10px;
1463
+ color: #fff;
1464
+ position: absolute;
1465
+ bottom: 8px;
1466
+ right: 10px;
1467
+ height: 34px;
1468
+ }
1469
+ .provider-status .mdl-switch{
1470
+ width: auto;
1471
+ }
1472
+ .provider .edit_provider,.provider .remove{
1473
+ display:none;
1474
+ cursor:pointer;
1475
+ }
1476
+ .provider:hover .edit_provider{
1477
+ display:inline-block;
1478
+ }
1479
+ .provider:hover .remove{
1480
+ display:inline-block;
1481
+ }
1482
+ .provider a {
1483
+ text-decoration: none;
1484
+ color: #444;
1485
+ }
1486
+ h1.plugin-title {
1487
+ padding: 20px 10px 10px 20px;
1488
+ font-size: 1.7em;
1489
+ color: #071d57;
1490
+ }
1491
+ .disable_label span {
1492
+ color: #999;
1493
+ }
1494
+ .synch_result{
1495
+ display:none;
1496
+ margin: 20px 0;
1497
+ }
1498
+ .wp-core-ui .button-primary.close_synch_popup{
1499
+ display:none;
1500
+ }
1501
+ .synch_result li {
1502
+ border-bottom: 1px solid #ccc;
1503
+ padding-bottom: 10px;
1504
+ font-size: 15px;
1505
+ }
1506
+ .sync_provider_popup .spinner{
1507
+ display:none;
1508
+ height: 25px;
1509
+ }
1510
+ .spinner.active{
1511
+ display: inline-block;
1512
+ }
1513
+ .shipment_about{
1514
+ margin:0;
1515
+ line-height: 20px;
1516
+ }
1517
+ .disabled_link{
1518
+ pointer-events: none;
1519
+ cursor: default;
1520
  }
1521
+ .delivered_enabel p.disable_delivered {
1522
+ display:block;
1523
+ margin:0;
1524
+ line-height: 20px;
1525
+ }
1526
+ .delivered_enabel p.shipment_about{
1527
+ display: none;
1528
+ }
1529
+ p.delivered_message {
1530
+ display: none;
1531
+ }
1532
+ .email-icon{
1533
+ position: absolute;
1534
+ left: 10px;
1535
+ top: 17px;
1536
+ width: 35px;
1537
+ }
1538
+ .woocommerce.zorem_admin_layout table.form-table{
1539
+ background: #fff;
1540
+ border: 2px solid #eee;
1541
+ margin-top: 20px;
1542
+ margin-bottom: 10px;
1543
+ }
1544
+ .zorem_admin_layout div.submit{
1545
+ padding: 0;
1546
+ }
1547
+ .woocommerce.zorem_admin_layout table.form-table th{
1548
+ padding: 20px 24px 20px 15px;
1549
+ }
1550
+ .woocommerce.zorem_admin_layout table.form-table p.description{
1551
+ font-size: 0.9em;
1552
+ }
1553
+ p.tracking-preview-desc {
1554
+ font-style: italic;
1555
+ font-size: 0.9em;
1556
+ }
1557
+ #content4{
1558
+ padding: 10px;
1559
+ }
1560
+ .updated_details {
1561
+ margin-top: 10px;
1562
+ display:none;
1563
+ }
1564
+ .view_synch_details{
1565
+ display:none;
1566
+ padding-top: 5px;
1567
+ }
1568
+ .updated_details li {
1569
+ display: inline-block;
1570
+ border-bottom: 0;
1571
+ padding-bottom: 0;
1572
+ background: #071d57;
1573
+ color: #fff;
1574
+ padding: 5px;
1575
+ border-radius: 3px;
1576
+ }
1577
+ .woocommerce.zorem_admin_layout table.form-table select{
1578
+ width: 100%;
1579
+ max-width: 400px;
1580
+ }
1581
+ .trackship-icon{
1582
+ width: 70px;
1583
+ }
1584
+ @media screen and (min-width: 1850px) {
1585
+ .provider{
1586
+ padding:10px;
1587
+ }
1588
+ .right-div{
1589
+ margin-left:10px;
1590
+ }
1591
+ }
1592
+ @media screen and (min-width: 1151px) and (max-width: 1465px) {
1593
+ .provider {
1594
+ width: 23%;
1595
+ }
1596
+ }
1597
+ @media screen and (min-width: 768px) and (max-width: 1150px) {
1598
+ .provider{
1599
+ width: 31%;
1600
+ }
1601
+ #search_provider{
1602
+ width: 200px;
1603
+ }
1604
+ .provider-thumb {
1605
+ height: 40px;
1606
+ }
1607
+ .right-div{
1608
+ width: 60%;
1609
+ }
1610
+ }
1611
+ @media screen and (max-width: 767px) {
1612
+ .provider{
1613
+ width: 30.8%;
1614
+ }
1615
+ .search_section .search-icon{
1616
+ padding: 8px 5px;
1617
+ }
1618
+ .provider_top {
1619
+ margin-bottom: 10px;
1620
+ }
1621
+ }
1622
+ @media screen and (max-width: 500px) {
1623
+ .provider{
1624
+ width: 47%;
1625
+ }
1626
+ .search_section{
1627
+ display: block;
1628
+ float: none;
1629
+ margin-bottom: 10px;
1630
+ }
1631
+ .search_section .search-icon{
1632
+ padding: 10px 5px;
1633
+ }
1634
+ #search_provider{
1635
+ width: 100%;
1636
+ }
1637
+ }
assets/css/customizer-styles.css CHANGED
@@ -9,8 +9,7 @@
9
  top: -1px;
10
  content: "\f230";
11
  }
12
-
13
- #accordion-section-customer_delivered_email>h3:before,#accordion-section-customer_pretransit_email>h3:before,#accordion-section-customer_intransit_email>h3:before,#accordion-section-customer_outfordelivery_email>h3:before,#accordion-section-customer_delivered_status_email>h3:before,#accordion-section-customer_returntosender_email>h3:before,#accordion-section-customer_availableforpickup_email>h3:before{
14
  font-family: 'Dashicons';
15
  font-size: 20px;
16
  font-weight: thin !important;
@@ -21,6 +20,80 @@
21
  top: -1px;
22
  content: "\f465";
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  #accordion-section-tracking_page_section>h3:before{
26
  font-family: 'Dashicons';
9
  top: -1px;
10
  content: "\f230";
11
  }
12
+ #accordion-panel-wcast_emails_panel>h3:before{
 
13
  font-family: 'Dashicons';
14
  font-size: 20px;
15
  font-weight: thin !important;
20
  top: -1px;
21
  content: "\f465";
22
  }
23
+ #accordion-panel-wcast_naviation_panel>h3:before{
24
+ font-family: 'Dashicons';
25
+ font-size: 20px;
26
+ font-weight: thin !important;
27
+ position: relative;
28
+ line-height: 0;
29
+ vertical-align: middle;
30
+ opacity: .6;
31
+ top: -1px;
32
+ content: "\f231";
33
+ }
34
+ #accordion-section-customer_delivered_email>h3:before{
35
+ content: ' ';
36
+ background-image: url(icons/delivered-v4.png);
37
+ width: 20px;
38
+ height: 20px;
39
+ background-size: cover;
40
+ display: inline-block;
41
+ vertical-align: middle;
42
+ }
43
+ #accordion-section-customer_failure_email>h3:before{
44
+ content: ' ';
45
+ background-image: url(icons/failure-v4.png);
46
+ width: 20px;
47
+ height: 20px;
48
+ background-size: cover;
49
+ display: inline-block;
50
+ vertical-align: middle;
51
+ }
52
+ #accordion-section-customer_intransit_email>h3:before{
53
+ content: ' ';
54
+ background-image: url(icons/in-transit-v4.png);
55
+ width: 20px;
56
+ height: 20px;
57
+ background-size: cover;
58
+ display: inline-block;
59
+ vertical-align: middle;
60
+ }
61
+ #accordion-section-customer_outfordelivery_email>h3:before{
62
+ content: ' ';
63
+ background-image: url(icons/out-for-delivery-v4.png);
64
+ width: 20px;
65
+ height: 20px;
66
+ background-size: cover;
67
+ display: inline-block;
68
+ vertical-align: middle;
69
+ }
70
+ #accordion-section-customer_delivered_status_email>h3:before{
71
+ content: ' ';
72
+ background-image: url(icons/delivered-v4.png);
73
+ width: 20px;
74
+ height: 20px;
75
+ background-size: cover;
76
+ display: inline-block;
77
+ vertical-align: middle;
78
+ }
79
+ #accordion-section-customer_returntosender_email>h3:before{
80
+ content: ' ';
81
+ background-image: url(icons/return-to-sender-v4.png);
82
+ width: 20px;
83
+ height: 20px;
84
+ background-size: cover;
85
+ display: inline-block;
86
+ vertical-align: middle;
87
+ }
88
+ #accordion-section-customer_availableforpickup_email>h3:before{
89
+ content: ' ';
90
+ background-image: url(icons/available-for-picup-v4.png);
91
+ width: 20px;
92
+ height: 20px;
93
+ background-size: cover;
94
+ display: inline-block;
95
+ vertical-align: middle;
96
+ }
97
 
98
  #accordion-section-tracking_page_section>h3:before{
99
  font-family: 'Dashicons';
assets/css/front.css CHANGED
@@ -7,24 +7,19 @@
7
  font-stretch: normal
8
  }
9
  .tracker-progress-bar-with-dots {
10
- margin-bottom: 90px;
 
11
  position: relative
12
  }
13
- .progress-bar.bg-success {
14
- background-color: #5cb85c;
15
- }
16
- .progress-bar.bg-warning {
17
- background-color: #f0ad4e;
18
- }
19
  @media (max-width: 575.98px) {
20
  .tracker-progress-bar-with-dots {
21
  font-size: 12px
22
  }
23
  }
24
  .tracker-progress-bar-with-dots .progress {
25
- margin-bottom: 19px;
26
- height: 12px;
27
- border-radius: 6px
28
  }
29
  .tracker-progress-bar-with-dots .progress .progress-bar {
30
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.15)
@@ -46,8 +41,7 @@
46
  left: 100%
47
  }
48
  .tracker-progress-bar-with-dots .state-label {
49
- width: 90px;
50
- margin-left: -45px;
51
  text-align: center;
52
  }
53
  .tracker-progress-bar-with-dots .primary .dot {
@@ -65,19 +59,75 @@
65
  .tracker-progress-bar-with-dots .danger .dot {
66
  border-color: #d9534f
67
  }
68
- .tracker-progress-bar-with-dots .dot {
69
- width: 40px;
70
- height: 40px;
71
- border-radius: 20px;
72
- background-color: #fff;
73
- border-width: 9px;
74
- border-style: solid;
75
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
76
- top: 0;
77
- margin-left: -20px;
78
- margin-top: -14px;
79
  box-sizing: border-box;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
 
 
 
 
 
 
 
 
81
  .tracker-progress-bar-with-dots .past-state {
82
  color: #899DA3
83
  }
@@ -92,13 +142,9 @@
92
  }
93
  .progress {
94
  display: -ms-flexbox;
95
- display: flex;
96
- height: 1.25rem;
97
- overflow: hidden;
98
- font-size: .705rem;
99
- background-color: #E4ECEF;
100
- border-radius: .6rem;
101
- box-shadow: inset 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1)
102
  }
103
  .progress-bar {
104
  display: -ms-flexbox;
@@ -110,7 +156,7 @@
110
  color: #fff;
111
  text-align: center;
112
  white-space: nowrap;
113
- background-color: #303F9F;
114
  transition: width 0.6s ease
115
  }
116
 
@@ -127,8 +173,8 @@
127
  animation: progress-bar-stripes 1s linear infinite
128
  }
129
  .status-section {
130
- max-width: 100%;
131
- margin: 0px 35px;
132
  }
133
  .tracking-detail .col-md-6 {
134
  width: 50%;
@@ -152,7 +198,7 @@
152
  color: #f0ad4e;
153
  }
154
  .tracking-detail .text-success {
155
- color: #5cb85c;
156
  }
157
  .tracking-detail .border-light {
158
  border-color: #E4ECEF;
@@ -244,11 +290,11 @@
244
  padding-top: .5rem !important;
245
  }
246
  .tracking-detail .mb-3, .tracking-detail .my-3 {
247
- margin-bottom: 1rem !important;
248
  }
249
  .col.tracking-detail {
250
  margin: 20px auto 20px;
251
- padding: 20px 30px 0;
252
  border: 1px solid #f9f9f9;
253
  width: 800px;
254
  }
@@ -261,7 +307,7 @@
261
  font-weight: 600;
262
  }
263
  .shipment_status_heading{
264
- padding-bottom: 10px;
265
  font-weight: 600;
266
  color: #303F9F;
267
  }
@@ -269,9 +315,139 @@
269
  display: flex;
270
  margin-bottom: 2rem;
271
  }
272
- .shipment_progress_heading_div{
273
- display: flex;
274
- }
275
  .tracking-details{
276
  display: contents;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
7
  font-stretch: normal
8
  }
9
  .tracker-progress-bar-with-dots {
10
+ margin-bottom: 30px;
11
+ margin-top: 50px;
12
  position: relative
13
  }
14
+
 
 
 
 
 
15
  @media (max-width: 575.98px) {
16
  .tracker-progress-bar-with-dots {
17
  font-size: 12px
18
  }
19
  }
20
  .tracker-progress-bar-with-dots .progress {
21
+ margin-bottom: 35px;
22
+ height: 5px;
 
23
  }
24
  .tracker-progress-bar-with-dots .progress .progress-bar {
25
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.15)
41
  left: 100%
42
  }
43
  .tracker-progress-bar-with-dots .state-label {
44
+ width: 75px;
 
45
  text-align: center;
46
  }
47
  .tracker-progress-bar-with-dots .primary .dot {
59
  .tracker-progress-bar-with-dots .danger .dot {
60
  border-color: #d9534f
61
  }
62
+ .tracker-progress-bar-with-dots .dot {
63
+ width: 75px;
64
+ height: 75px;
65
+ top: 0;
66
+ margin-top: -34px;
 
 
 
 
 
 
67
  box-sizing: border-box;
68
+ background-size: cover;
69
+ }
70
+ .tracker-progress-bar-with-dots .dot.pre_transit{
71
+ background-image: url(icons/Pre-Transit-512.png);
72
+ }
73
+ .tracker-progress-bar-with-dots .dot.pre_transit.past-state{
74
+ background-image: url(icons/pre-transit-v3.png);
75
+ }
76
+ .tracker-progress-bar-with-dots .dot.unknown{
77
+ background-image: url(icons/failure-512.png);
78
+ }
79
+ .tracker-progress-bar-with-dots .dot.unknown.past-state{
80
+ background-image: url(icons/failure-v3.png);
81
+ }
82
+ .tracker-progress-bar-with-dots .dot.in_transit{
83
+ background-image: url(icons/In-Transit-512.png);
84
+ }
85
+ .tracker-progress-bar-with-dots .dot.in_transit.past-state{
86
+ background-image: url(icons/in-transit-v3.png);
87
+ }
88
+ .tracker-progress-bar-with-dots .dot.out_for_delivery{
89
+ background-image: url(icons/Out-for-Delivery-512.png);
90
+ }
91
+ .tracker-progress-bar-with-dots .dot.out_for_delivery.past-state{
92
+ background-image: url(icons/out-for-delivery-v3.png);
93
+ }
94
+ .tracker-progress-bar-with-dots .dot.delivered{
95
+ background-image: url(icons/Delivered-512.png);
96
+ }
97
+ .tracker-progress-bar-with-dots .dot.delivered.past-state{
98
+ background-image: url(icons/delivered-v3.png);
99
+ }
100
+ .tracker-progress-bar-with-dots .dot.return_to_sender{
101
+ background-image: url(icons/return-to-sender-512.png);
102
+ }
103
+ .tracker-progress-bar-with-dots .dot.return_to_sender.past-state{
104
+ background-image: url(icons/return-to-sender-v3.png);
105
+ }
106
+ .tracker-progress-bar-with-dots .dot.failure{
107
+ background-image: url(icons/failure-512.png);
108
+ }
109
+ .tracker-progress-bar-with-dots .dot.failure.past-state{
110
+ background-image: url(icons/failure-v3.png);
111
+ }
112
+ .tracker-progress-bar-with-dots .dot.available_for_pickup{
113
+ background-image: url(icons/available-for-picup-512.png);
114
+ }
115
+ .tracker-progress-bar-with-dots .dot.available_for_pickup.past-state{
116
+ background-image: url(icons/available-for-picup-v3.png);
117
+ }
118
+
119
+
120
+ .tracker-progress-bar-with-dots .dot.in_transit.future-state{
121
+ background-image: url(icons/in-transit-grey-v3.png);
122
  }
123
+ .tracker-progress-bar-with-dots .dot.out_for_delivery.future-state{
124
+ background-image: url(icons/out-for-delivery-grey-v3.png);
125
+ }
126
+ .tracker-progress-bar-with-dots .dot.delivered.future-state{
127
+ background-image: url(icons/delivered-grey-v3.png);
128
+ }
129
+
130
+
131
  .tracker-progress-bar-with-dots .past-state {
132
  color: #899DA3
133
  }
142
  }
143
  .progress {
144
  display: -ms-flexbox;
145
+ display: flex;
146
+ overflow: hidden;
147
+ background-color: #C1C1C1;
 
 
 
 
148
  }
149
  .progress-bar {
150
  display: -ms-flexbox;
156
  color: #fff;
157
  text-align: center;
158
  white-space: nowrap;
159
+ background-color: #C1C1C1;
160
  transition: width 0.6s ease
161
  }
162
 
173
  animation: progress-bar-stripes 1s linear infinite
174
  }
175
  .status-section {
176
+ max-width: 90%;
177
+ margin: 0px 35px 0 0;
178
  }
179
  .tracking-detail .col-md-6 {
180
  width: 50%;
198
  color: #f0ad4e;
199
  }
200
  .tracking-detail .text-success {
201
+ color: #0c8043;
202
  }
203
  .tracking-detail .border-light {
204
  border-color: #E4ECEF;
290
  padding-top: .5rem !important;
291
  }
292
  .tracking-detail .mb-3, .tracking-detail .my-3 {
293
+ margin-bottom: 0 !important;
294
  }
295
  .col.tracking-detail {
296
  margin: 20px auto 20px;
297
+ padding: 30px;
298
  border: 1px solid #f9f9f9;
299
  width: 800px;
300
  }
307
  font-weight: 600;
308
  }
309
  .shipment_status_heading{
310
+ padding-top: 10px;
311
  font-weight: 600;
312
  color: #303F9F;
313
  }
315
  display: flex;
316
  margin-bottom: 2rem;
317
  }
 
 
 
318
  .tracking-details{
319
  display: contents;
320
+ }
321
+ .tracking-table thead tr th{
322
+ padding: 15px 0;
323
+ border-bottom: 0;
324
+ }
325
+ .tracking-table tbody tr td{
326
+ padding: .5em .5em .5em 0;
327
+ border-bottom: 1px solid #eee
328
+ }
329
+ .tracking-header {
330
+ display: flex;
331
+ margin-bottom: 30px;
332
+ }
333
+ .tracking-number {
334
+ font-weight: 400;
335
+ color: #303F9F;
336
+ }
337
+ .mobile-section{
338
+ display:none;
339
+ }
340
+ .desktop-section{
341
+ display:block;
342
+ }
343
+ table.tracking-table tr:nth-child(n+3) {
344
+ display: none;
345
+ }
346
+ table.tracking-table{
347
+ margin-bottom: 5px;
348
+ }
349
+ .view_table_rows{
350
+ color: #303F9F;
351
+ text-decoration: underline;
352
+ }
353
+ .hide_table_rows{
354
+ display:none;
355
+ color: #303F9F;
356
+ text-decoration: underline;
357
+ }
358
+ .shipment_progress_div {
359
+ padding-bottom: 7px;
360
+ }
361
+ .h4-heading{
362
+ border-bottom: 1px solid #eee;
363
+ }
364
+ @media screen and (max-width: 767px) {
365
+ .col.tracking-detail{
366
+ padding: 20px 15px 0;
367
+ width: 100%;
368
+ }
369
+ .tracking-detail .col-md-6{
370
+ width: 100%;
371
+ }
372
+ .tracking-detail .text-right{
373
+ text-align: left;
374
+ }
375
+ .tracking-header{
376
+ display: block;
377
+ }
378
+ .status-section{
379
+ max-width: 80%;
380
+ }
381
+ }
382
+ @media screen and (max-width: 550px) {
383
+ .mobile-section{
384
+ display:block;
385
+ }
386
+ .desktop-section{
387
+ display:none;
388
+ }
389
+ .tracker-progress-bar-with-dots .dot{
390
+ width: 60px;
391
+ height: 60px;
392
+ margin-top: -26px;
393
+ }
394
+ .tracker-progress-bar-with-dots .state-label{
395
+ display: inline-block;
396
+ vertical-align: middle;
397
+ width: auto;
398
+ margin-left: 10px;
399
+ }
400
+ .mobile-section .tracker-progress-bar-with-dots .dot{
401
+ background-size: cover;
402
+ width: 60px;
403
+ position: relative;
404
+ display: inline-block;
405
+ vertical-align: middle;
406
+ height: 60px;
407
+ margin: 0 auto;
408
+ }
409
+ .tracker-progress-bar-with-dots .state-1{
410
+ position: relative;
411
+ left:0;
412
+ }
413
+ .tracker-progress-bar-with-dots .state-2{
414
+ position: relative;
415
+ left:0;
416
+ }
417
+ .tracker-progress-bar-with-dots .state-3{
418
+ position: relative;
419
+ left:0;
420
+ }
421
+ .mobile-section .dot-div {
422
+ margin-bottom: 20px;
423
+ }
424
+ .mobile-section .tracker-progress-bar.tracker-progress-bar-with-dots:before {
425
+ content: '';
426
+ height: 100%;
427
+ position: absolute;
428
+ left: 48px;
429
+ width: 5px;
430
+ background-color: #C1C1C1;
431
+ }
432
+ .progress-bar{
433
+ position: absolute;
434
+ }
435
+ .progress-bar.bg-secondary:before{
436
+ content: '';
437
+ height: 100%;
438
+ position: absolute;
439
+ left: 28px;
440
+ width: 5px;
441
+ background-color: #303F9F;
442
+ }
443
+ .tracker-progress-bar-with-dots .progress{
444
+ margin-bottom: 0;
445
+ height: 100%;
446
+ border-radius: 0;
447
+ }
448
+ .tracker-progress-bar-with-dots{
449
+ margin-bottom: 20px;
450
+ margin-top: 20px;
451
+ padding-left: 20px;
452
+ }
453
  }
assets/css/icons/Branded-Tracking-Page.png ADDED
Binary file
assets/css/icons/Delivered-512.png ADDED
Binary file
assets/{shipment-provider-img/fastways.png → css/icons/Delivered-o.png} RENAMED
Binary file
assets/css/icons/In-Transit--o.png ADDED
Binary file
assets/css/icons/In-Transit-512.png ADDED
Binary file
assets/css/icons/Multi-Carrier-Support.png ADDED
Binary file
assets/css/icons/Out-for-Delivery-512.png ADDED
Binary file
assets/css/icons/Out-for-Delivery-o.png ADDED
Binary file
assets/css/icons/Pre-Transit-512.png ADDED
Binary file
assets/css/icons/Pre-Transit-o.png ADDED
Binary file
assets/css/icons/available-for-picup-512.png ADDED
Binary file
assets/css/icons/available-for-picup-o.png ADDED
Binary file
assets/css/icons/available-for-picup-v3.png ADDED
Binary file
assets/css/icons/available-for-picup-v4.png ADDED
Binary file
assets/css/icons/cancel-o.png ADDED
Binary file
assets/css/icons/cancel-v3.png ADDED
Binary file
assets/css/icons/cancel-v4.png ADDED
Binary file
assets/css/icons/carrier-unsupported-v3.png ADDED
Binary file
assets/css/icons/carrier-unsupported-v4.png ADDED
Binary file
assets/css/icons/customer-support.png ADDED
Binary file
assets/css/icons/delivered-grey-v3.png ADDED
Binary file
assets/css/icons/delivered-v3.png ADDED
Binary file
assets/css/icons/delivered-v4.png ADDED
Binary file
assets/css/icons/delivery-email-2.png ADDED
Binary file
assets/css/icons/failure-512.png ADDED
Binary file
assets/css/icons/failure-o.png ADDED
Binary file
assets/css/icons/failure-v3.png ADDED
Binary file
assets/css/icons/failure-v4.png ADDED
Binary file
assets/css/icons/in-transit-grey-v3.png ADDED
Binary file
assets/css/icons/in-transit-v3.png ADDED
Binary file
assets/css/icons/in-transit-v4.png ADDED
Binary file
assets/css/icons/out-for-delivery-grey-v3.png ADDED
Binary file
assets/css/icons/out-for-delivery-v3.png ADDED
Binary file
assets/css/icons/out-for-delivery-v4.png ADDED
Binary file
assets/css/icons/pending-trackship-v3.png ADDED
Binary file
assets/css/icons/pending-trackship-v4.png ADDED
Binary file
assets/css/icons/pre-transit-v3.png ADDED
Binary file
assets/css/icons/pre-transit-v4.png ADDED
Binary file
assets/css/icons/return-to-sender-512.png ADDED
Binary file
assets/css/icons/return-to-sender-o.png ADDED
Binary file
assets/css/icons/return-to-sender-v3.png ADDED
Binary file
assets/css/icons/return-to-sender-v4.png ADDED
Binary file
assets/css/icons/shiping-and-delivery-analytics.png ADDED
Binary file
assets/css/icons/unknown-v3.png ADDED
Binary file
assets/css/icons/unknown-v4.png ADDED
Binary file
assets/css/icons/woo-inegration.png ADDED
Binary file
assets/css/preview-styles.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ast_preview_body.wp-customizer-unloading #overlay{
2
+ position: fixed; /* Sit on top of the page content */
3
+ width: 100%; /* Full width (cover the whole page) */
4
+ height: 100%; /* Full height (cover the whole page) */
5
+ top: 0;
6
+ left: 0;
7
+ right: 0;
8
+ bottom: 0;
9
+ background-color: rgba(7, 29, 87, 0.5); /* Black background with opacity */
10
+ z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
11
+ cursor: default; /* Add a pointer on hover */
12
+ }
assets/images/checked.png ADDED
Binary file
assets/images/unchecked.png ADDED
Binary file
assets/js/admin.js CHANGED
@@ -43,6 +43,12 @@ jQuery( function( $ ) {
43
  }
44
  } );
45
 
 
 
 
 
 
 
46
  var data = {
47
  action: 'wc_shipment_tracking_save_form',
48
  order_id: woocommerce_admin_meta_boxes.post_id,
@@ -51,6 +57,7 @@ jQuery( function( $ ) {
51
  custom_tracking_link: $( 'input#custom_tracking_link' ).val(),
52
  tracking_number: $( 'input#tracking_number' ).val(),
53
  date_shipped: $( 'input#date_shipped' ).val(),
 
54
  security: $( '#wc_shipment_tracking_create_nonce' ).val()
55
  };
56
 
@@ -66,6 +73,12 @@ jQuery( function( $ ) {
66
  $( 'input#custom_tracking_link' ).val( '' );
67
  $( 'input#tracking_number' ).val( '' );
68
  $( 'input#date_shipped' ).val( '' );
 
 
 
 
 
 
69
  }
70
  });
71
 
@@ -136,6 +149,9 @@ jQuery( function( $ ) {
136
 
137
  window.wc_shipment_tracking_refresh = wc_shipment_tracking_items.refresh_items;
138
  } );
 
 
 
139
  function showerror(element){
140
  element.css("border-color","red");
141
  }
43
  }
44
  } );
45
 
46
+ if($('input#change_order_to_shipped').prop("checked") == true){
47
+ var checked = 'yes';
48
+ } else{
49
+ var checked = 'no';
50
+ }
51
+
52
  var data = {
53
  action: 'wc_shipment_tracking_save_form',
54
  order_id: woocommerce_admin_meta_boxes.post_id,
57
  custom_tracking_link: $( 'input#custom_tracking_link' ).val(),
58
  tracking_number: $( 'input#tracking_number' ).val(),
59
  date_shipped: $( 'input#date_shipped' ).val(),
60
+ change_order_to_shipped: checked,
61
  security: $( '#wc_shipment_tracking_create_nonce' ).val()
62
  };
63
 
73
  $( 'input#custom_tracking_link' ).val( '' );
74
  $( 'input#tracking_number' ).val( '' );
75
  $( 'input#date_shipped' ).val( '' );
76
+ if(checked == 'yes'){
77
+ jQuery('#order_status').val('wc-completed');
78
+ jQuery('#order_status').select2().trigger('change');
79
+ jQuery('#post').before('<div id="order_updated_message" class="updated notice notice-success is-dismissible"><p>Order updated.</p><button type="button" class="notice-dismiss update-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>');
80
+ //location.reload();
81
+ }
82
  }
83
  });
84
 
149
 
150
  window.wc_shipment_tracking_refresh = wc_shipment_tracking_items.refresh_items;
151
  } );
152
+ jQuery(document).on("click", ".update-dismiss", function(){
153
+ jQuery('#order_updated_message').fadeOut();
154
+ });
155
  function showerror(element){
156
  element.css("border-color","red");
157
  }
assets/js/customizer-scripts.js CHANGED
@@ -9,8 +9,30 @@ jQuery(document).ready(function() {
9
  * Change description
10
  */
11
  jQuery(wcast_customizer.trigger_click).trigger( "click" );
12
- jQuery('#customize-theme-controls #accordion-section-themes').hide();
 
 
 
 
 
 
 
 
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  });
15
  // Handle mobile button click
16
  function custom_size_mobile() {
@@ -90,12 +112,12 @@ jQuery(document).ready(function() {
90
  } );
91
  } ( wp.customize ) );*/
92
  (function ( api ) {
93
- api.section( 'customer_pretransit_email', function( section ) {
94
  section.expanded.bind( function( isExpanded ) {
95
  var url;
96
  if ( isExpanded ) {
97
  jQuery('#save').trigger('click');
98
- url = wcast_customizer.customer_pretransit_preview_url;
99
  api.previewer.previewUrl.set( url );
100
  }
101
  } );
9
  * Change description
10
  */
11
  jQuery(wcast_customizer.trigger_click).trigger( "click" );
12
+ jQuery('#customize-theme-controls #accordion-section-themes').hide();
13
+
14
+ if(wcast_customizer.wcast_enable_delivered_email == 'yes'){
15
+ jQuery('#_customize-input-wcast_enable_delivered_status_email').prop('disabled', true);
16
+ }
17
+
18
+ if(jQuery("#_customize-input-show_track_label").prop("checked") != true){
19
+ jQuery('#customize-control-track_header_text').hide();
20
+ }
21
 
22
+ });
23
+ jQuery(document).on("change", "#_customize-input-show_track_label", function(){
24
+ if(jQuery(this).prop("checked") == true){
25
+ jQuery('#customize-control-track_header_text').show();
26
+ } else{
27
+ jQuery('#customize-control-track_header_text').hide();
28
+ }
29
+ });
30
+ jQuery(document).on("change", "#customize-control-woocommerce_customer_delivered_order_settings-enabled input", function(){
31
+ if(jQuery(this).prop("checked") == true){
32
+ jQuery('#_customize-input-wcast_enable_delivered_status_email').prop('disabled', true);
33
+ } else{
34
+ jQuery('#_customize-input-wcast_enable_delivered_status_email').removeAttr('disabled');
35
+ }
36
  });
37
  // Handle mobile button click
38
  function custom_size_mobile() {
112
  } );
113
  } ( wp.customize ) );*/
114
  (function ( api ) {
115
+ api.section( 'customer_failure_email', function( section ) {
116
  section.expanded.bind( function( isExpanded ) {
117
  var url;
118
  if ( isExpanded ) {
119
  jQuery('#save').trigger('click');
120
+ url = wcast_customizer.customer_failure_preview_url;
121
  api.previewer.previewUrl.set( url );
122
  }
123
  } );
assets/js/front.js CHANGED
@@ -43,4 +43,14 @@ jQuery(document).on("submit", ".order_track_form", function(){
43
  jQuery(document).on("click", ".back_to_tracking_form", function(){
44
  jQuery('.tracking-detail').hide();
45
  jQuery('.track-order-section').show();
 
 
 
 
 
 
 
 
 
 
46
  });
43
  jQuery(document).on("click", ".back_to_tracking_form", function(){
44
  jQuery('.tracking-detail').hide();
45
  jQuery('.track-order-section').show();
46
+ });
47
+ jQuery(document).on("click", ".view_table_rows", function(){
48
+ jQuery(this).hide();
49
+ jQuery('.hide_table_rows').show();
50
+ jQuery('table.tracking-table tr:nth-child(n+3)').show();
51
+ });
52
+ jQuery(document).on("click", ".hide_table_rows", function(){
53
+ jQuery(this).hide();
54
+ jQuery('.view_table_rows').show();
55
+ jQuery('table.tracking-table tr:nth-child(n+3)').hide();
56
  });
assets/js/preview-scripts.js CHANGED
@@ -303,15 +303,15 @@
303
  } );
304
  } );
305
 
306
- wp.customize( 'wcast_pretransit_email_heading', function( value ) {
307
- value.bind( function( wcast_pretransit_email_heading ) {
308
 
309
- var str = wcast_pretransit_email_heading;
310
  var res = str.replace("{site_title}", wcast_preview.site_title);
311
 
312
  var res = res.replace("{order_number}", wcast_preview.order_number);
313
 
314
- if( wcast_pretransit_email_heading ){
315
  $( '#header_wrapper h1' ).text(res);
316
  } else{
317
  $( '#header_wrapper h1' ).text('');
303
  } );
304
  } );
305
 
306
+ wp.customize( 'wcast_failure_email_heading', function( value ) {
307
+ value.bind( function( wcast_failure_email_heading ) {
308
 
309
+ var str = wcast_failure_email_heading;
310
  var res = str.replace("{site_title}", wcast_preview.site_title);
311
 
312
  var res = res.replace("{order_number}", wcast_preview.order_number);
313
 
314
+ if( wcast_failure_email_heading ){
315
  $( '#header_wrapper h1' ).text(res);
316
  } else{
317
  $( '#header_wrapper h1' ).text('');
assets/js/shipping_row.js CHANGED
@@ -26,7 +26,7 @@
26
  } ) );
27
  } );
28
 
29
- $wc_ast_settings_form.on( 'click', '.woocommerce-save-button', this.save_wc_ast_settings_form );
30
  $wc_ast_trackship_form.on( 'click', '.woocommerce-save-button', this.save_wc_ast_trackship_form );
31
 
32
  $(".tipTip").tipTip();
@@ -46,7 +46,7 @@
46
  snackbarContainer.MaterialSnackbar.showSnackbar(data);
47
  });
48
 
49
- },
50
 
51
  save_wc_ast_trackship_form: function( event ) {
52
  event.preventDefault();
@@ -138,324 +138,6 @@
138
  });
139
  })( jQuery, shipment_tracking_table_rows, wp, ajaxurl );
140
 
141
- // Item ordering.
142
- jQuery('.shipping_provider_table tbody').sortable({
143
- items: '.provider_tr',
144
- cursor: 'move',
145
- handle: '.sort-item',
146
- opacity: 0.8,
147
- update: function( event, ui ) {
148
- jQuery(this).children().each(function(index) {
149
- jQuery(this).find('.sort_order').val(index + 1)
150
- });
151
- },
152
- stop:function( event, ui ){
153
- update_sort_order();
154
- }
155
- });
156
-
157
- function update_sort_order(){
158
- var form = jQuery('#shipping_provider_form');
159
- var error;
160
- jQuery(".shipping_provider_table ").block({
161
- message: null,
162
- overlayCSS: {
163
- background: "#fff",
164
- opacity: .6
165
- }
166
- });
167
- jQuery.ajax({
168
- url: ajaxurl+'?action=update_sort_order',
169
- data: form.serialize(),
170
- type: 'POST',
171
- success: function(response) {
172
- jQuery(document).on("click", ".edit_provider", function(){
173
- jQuery(this).closest('tr').find('.on_edit_show').show();
174
- jQuery(this).closest('tr').find('.on_edit_hide').hide();
175
- });
176
- update_default_shipping_provider();
177
- jQuery(".shipping_provider_table ").unblock();
178
- },
179
- error: function(response) {
180
- console.log(response);
181
- }
182
- });
183
- }
184
-
185
- jQuery(document).on("click", ".status_slide", function(){
186
- if(jQuery(this).prop("checked") == true){
187
- jQuery(this).closest('tr').removeClass('status_deactivate');
188
- } else{
189
- jQuery(this).closest('tr').addClass('status_deactivate');
190
- }
191
- var form = jQuery('#shipping_provider_form');
192
- var error;
193
- jQuery(".shipping_provider_table ").block({
194
- message: null,
195
- overlayCSS: {
196
- background: "#fff",
197
- opacity: .6
198
- }
199
- });
200
- jQuery.ajax({
201
- url: ajaxurl+'?action=update_shipment_status',
202
- data: form.serialize(),
203
- type: 'POST',
204
- success: function(response) {
205
- update_default_shipping_provider();
206
- jQuery(".shipping_provider_table ").unblock();
207
- },
208
- error: function(response) {
209
- console.log(response);
210
- }
211
- });
212
- });
213
- jQuery(".custom_provider_tr").hover(function() {
214
- jQuery(this).find('.dashicons-edit').show();
215
- jQuery(this).find('.dashicons-trash').show();
216
- }, function() {
217
- jQuery(this).find('.dashicons-edit').hide();
218
- jQuery(this).find('.dashicons-trash').hide();
219
- });
220
-
221
- jQuery(document).on("click", ".edit_provider", function(){
222
- jQuery(this).closest('tr').find('.on_edit_show').show();
223
- jQuery(this).closest('tr').find('.on_edit_hide').hide();
224
- jQuery(".custom_provider_tr").hover(function() {
225
- jQuery(this).find('.dashicons-edit').hide();
226
- jQuery(this).find('.dashicons-trash').hide();
227
- }, function() {
228
- });
229
- });
230
- jQuery(document).on("click", ".cancel_edit", function(){
231
- jQuery(this).closest('tr').find('.on_edit_show').hide();
232
- jQuery(this).closest('tr').find('.on_edit_hide').show();
233
- jQuery('.add-provider').removeAttr("disabled");
234
- jQuery(".custom_provider_tr").hover(function() {
235
- jQuery(this).find('.dashicons-edit').show();
236
- jQuery(this).find('.dashicons-trash').show();
237
- }, function() {
238
- });
239
- });
240
- jQuery(document).on("click", ".update_provider", function(){
241
- jQuery(".shipping_provider_table ").block({
242
- message: null,
243
- overlayCSS: {
244
- background: "#fff",
245
- opacity: .6
246
- }
247
- });
248
- var custom_provider_name = jQuery(this).closest('tr').find('.custom_provider_name').val();
249
- var custom_provider_country = jQuery(this).closest('tr').find('.custom_provider_country').val();
250
- var custom_provider_url = jQuery(this).closest('tr').find('.custom_provider_url').val();
251
- var provider_id = jQuery(this).closest('tr').find('.provider_id').val();
252
- var sort_order = jQuery(this).closest('tr').find('.sort_order').val();
253
- var image_id = jQuery(this).closest('tr').find('.image_id').val();
254
-
255
-
256
- var ajax_data = {
257
- action: 'update_shipping_provider',
258
- provider_id: provider_id,
259
- custom_provider_name: custom_provider_name,
260
- custom_provider_country: custom_provider_country,
261
- custom_provider_url: custom_provider_url,
262
- sort_order: sort_order,
263
- image_id: image_id,
264
- };
265
-
266
- jQuery.ajax({
267
- url: ajaxurl,
268
- data: ajax_data,
269
- type: 'POST',
270
- success: function(response) {
271
- jQuery(".shipping_provider_table tbody").replaceWith(response);
272
- jQuery(".custom_provider_tr").hover(function() {
273
- jQuery(this).find('.dashicons-edit').show();
274
- jQuery(this).find('.dashicons-trash').show();
275
- }, function() {
276
- jQuery(this).find('.dashicons-edit').hide();
277
- jQuery(this).find('.dashicons-trash').hide();
278
- });
279
- jQuery(document).on("click", ".edit_provider", function(){
280
- jQuery(this).closest('tr').find('.on_edit_show').show();
281
- jQuery(this).closest('tr').find('.on_edit_hide').hide();
282
- });
283
- // Item ordering.
284
- jQuery('.shipping_provider_table tbody').sortable({
285
- items: '.provider_tr',
286
- cursor: 'move',
287
- handle: '.sort-item',
288
- scrollSensitivity: 40,
289
- opacity: 0.65,
290
- update: function( event, ui ) {
291
- jQuery(this).children().each(function(index) {
292
- jQuery(this).find('.sort_order').val(index + 1)
293
- });
294
- },
295
- stop:function( event, ui ){
296
- update_sort_order();
297
- }
298
- });
299
- jQuery('.shipping_provider_table .provider_tr td').each(function() {
300
- var width = jQuery(this).width();
301
- jQuery(this).width(width);
302
- });
303
-
304
- var file_frame;
305
- jQuery('#upload_image_button').live('click', function(product) {
306
- product.preventDefault();
307
- var image_id = jQuery(this).siblings(".image_id");
308
- var image_path = jQuery(this).siblings(".image_path");
309
-
310
- // If the media frame already exists, reopen it.
311
- if (file_frame) {
312
- file_frame.open();
313
- return;
314
- }
315
-
316
- // Create the media frame.
317
- file_frame = wp.media.frames.file_frame = wp.media({
318
- title: 'Upload Media',
319
- button: {
320
- text: 'Add',
321
- },
322
- multiple: false // Set to true to allow multiple files to be selected
323
- });
324
-
325
- // When a file is selected, run a callback.
326
- file_frame.on('select', function(){
327
- attachment = file_frame.state().get('selection').first().toJSON();
328
- var id = attachment.id;
329
- var url = attachment.url;
330
- image_path.attr('value', url);
331
- image_id.attr('value', id);
332
-
333
- });
334
- // Finally, open the modal
335
- file_frame.open();
336
- });
337
-
338
- componentHandler.upgradeAllRegistered();
339
- update_default_shipping_provider();
340
- jQuery(".shipping_provider_table ").unblock();
341
- },
342
- error: function(response) {
343
- }
344
- });
345
- return false;
346
- });
347
-
348
- jQuery(document).on("click", ".add_new", function(){
349
- var form = jQuery('#shipping_provider_form');
350
- var error;
351
-
352
- jQuery(".shipping_provider_table ").block({
353
- message: null,
354
- overlayCSS: {
355
- background: "#fff",
356
- opacity: .6
357
- }
358
- });
359
- jQuery.ajax({
360
- url: ajaxurl+'?action=add_custom_shipment_provider',
361
- data: form.serialize(),
362
- type: 'POST',
363
- success: function(response) {
364
- jQuery(".shipping_provider_table tbody").replaceWith(response);
365
- jQuery(".custom_provider_tr").hover(function() {
366
- jQuery(this).find('.dashicons-edit').show();
367
- jQuery(this).find('.dashicons-trash').show();
368
- }, function() {
369
- jQuery(this).find('.dashicons-edit').hide();
370
- jQuery(this).find('.dashicons-trash').hide();
371
- });
372
- jQuery(document).on("click", ".edit_provider", function(){
373
- jQuery(this).closest('tr').find('.on_edit_show').show();
374
- jQuery(this).closest('tr').find('.on_edit_hide').hide();
375
- });
376
- // Item ordering.
377
- jQuery('.shipping_provider_table tbody').sortable({
378
- items: '.provider_tr',
379
- cursor: 'move',
380
- handle: '.sort-item',
381
- scrollSensitivity: 40,
382
- opacity: 0.65,
383
- update: function( event, ui ) {
384
- jQuery(this).children().each(function(index) {
385
- jQuery(this).find('.sort_order').val(index + 1)
386
- });
387
- },
388
- stop:function( event, ui ){
389
- update_sort_order();
390
- }
391
- });
392
- jQuery('.shipping_provider_table .provider_tr td').each(function() {
393
- var width = jQuery(this).width();
394
- jQuery(this).width(width);
395
- });
396
-
397
- var file_frame;
398
- jQuery('#upload_image_button').live('click', function(product) {
399
- product.preventDefault();
400
- var image_id = jQuery(this).siblings(".image_id");
401
- var image_path = jQuery(this).siblings(".image_path");
402
-
403
- // If the media frame already exists, reopen it.
404
- if (file_frame) {
405
- file_frame.open();
406
- return;
407
- }
408
-
409
- // Create the media frame.
410
- file_frame = wp.media.frames.file_frame = wp.media({
411
- title: 'Upload Media',
412
- button: {
413
- text: 'Add',
414
- },
415
- multiple: false // Set to true to allow multiple files to be selected
416
- });
417
-
418
- // When a file is selected, run a callback.
419
- file_frame.on('select', function(){
420
- attachment = file_frame.state().get('selection').first().toJSON();
421
- var id = attachment.id;
422
- var url = attachment.url;
423
- image_path.attr('value', url);
424
- image_id.attr('value', id);
425
-
426
- });
427
- // Finally, open the modal
428
- file_frame.open();
429
- });
430
-
431
- update_default_shipping_provider();
432
- componentHandler.upgradeAllRegistered();
433
- jQuery(".shipping_provider_table ").unblock();
434
- },
435
- error: function(response) {
436
- console.log(response);
437
- }
438
- });
439
- return false;
440
- });
441
- function update_default_shipping_provider(){
442
- var ajax_data = {
443
- action: 'update_shipping_provider_dropdown',
444
- };
445
- jQuery.ajax({
446
- url: ajaxurl,
447
- data: ajax_data,
448
- type: 'POST',
449
- success: function(response) {
450
- jQuery(".wc_ast_default_provider").replaceWith(response);
451
- var snackbarContainer = document.querySelector('#demo-toast-example');
452
- var data = {message: shipment_tracking_table_rows.i18n.data_saved};
453
- snackbarContainer.MaterialSnackbar.showSnackbar(data);
454
- },
455
- error: function(response) {
456
- }
457
- });
458
- }
459
 
460
  jQuery(document).on("change", ".wc_ast_default_provider", function(){
461
  jQuery(".d_s_select_section ").block({
@@ -484,55 +166,6 @@ jQuery(document).on("change", ".wc_ast_default_provider", function(){
484
  }
485
  });
486
  });
487
-
488
- jQuery(document).on("click", "#list-switch", function(){
489
- var r = confirm( shipment_tracking_table_rows.i18n.provider_status_alert );
490
- if (r === true) {
491
-
492
- } else {
493
- if(jQuery(this).prop("checked") == true){
494
- jQuery(this).prop('checked', false);
495
- } else{
496
- jQuery(this).prop('checked', true);
497
- }
498
- return;
499
- }
500
- if(jQuery('#list-switch').prop("checked") == true){
501
- jQuery('.status_slide').prop('checked', true);
502
- jQuery('.status_slide').parent('label').addClass('is-checked');
503
- jQuery('tr.provider_tr').removeClass('status_deactivate');
504
- } else{
505
- jQuery('.status_slide').removeAttr('checked');
506
- jQuery('.status_slide').parent('label').removeClass('is-checked');
507
- jQuery('tr.provider_tr').addClass('status_deactivate');
508
- }
509
- var form = jQuery('#shipping_provider_form');
510
- var error;
511
- jQuery(".shipping_provider_table ").block({
512
- message: null,
513
- overlayCSS: {
514
- background: "#fff",
515
- opacity: .6
516
- }
517
- });
518
- jQuery.ajax({
519
- url: ajaxurl+'?action=update_shipment_status',
520
- data: form.serialize(),
521
- type: 'POST',
522
- success: function(response) {
523
- update_default_shipping_provider();
524
- jQuery(".shipping_provider_table ").unblock();
525
- },
526
- error: function(response) {
527
- console.log(response);
528
- }
529
- });
530
- });
531
- jQuery('.shipping_provider_table .provider_tr td.on_edit_hide').each(function() {
532
- var width = jQuery(this).width();
533
- jQuery(this).width(width);
534
- });
535
-
536
  var file_frame;
537
  jQuery('#upload_image_button').live('click', function(product) {
538
  product.preventDefault();
@@ -687,129 +320,256 @@ jQuery(document).on("submit", "#wc_ast_upload_csv_form", function(){
687
  }
688
  return false;
689
  });
690
- jQuery(document).on("click", "#add_new_status_email", function(){
691
- jQuery('#add_new_status_email_form').toggle(500);
692
- });
693
- jQuery(document).on("change", ".email_trigger_dropdown", function(){
694
- var trigger = jQuery(this).val();
695
-
696
- if(trigger == ''){
697
- jQuery('.show_if_order_status').hide();
698
- jQuery('.show_if_shippment_status').hide();
699
- jQuery('.show_if_any').hide();
700
- jQuery('.shippment_status_message').hide();
701
- }
702
- if(trigger == 'order_status'){
703
- jQuery('.show_if_order_status').show();
704
- jQuery('.show_if_shippment_status').hide();
705
- jQuery('.show_if_any').show();
706
- jQuery('.shippment_status_message').hide();
707
- }
708
- if(trigger == 'shipment_status'){
709
- jQuery('.show_if_shippment_status').show();
710
- jQuery('.show_if_order_status').hide();
711
- jQuery('.show_if_any').show();
712
- jQuery('.shippment_status_message').hide();
713
- }
714
- });
715
- jQuery(document).on("submit", "#add_new_status_email_form", function(){
716
-
717
- var form = jQuery('#add_new_status_email_form');
718
- var error;
719
- var email_trigger = jQuery("#email_trigger");
720
- var order_status = jQuery("#order_status");
721
- var shippment_status = jQuery("#shippment_status");
722
- var email_label = jQuery("#email_label");
723
- var email_subject = jQuery("#email_subject");
724
- var email_to = jQuery("#email_to");
725
- var email_heading = jQuery("#email_heading");
726
- var id_list = jQuery("#id_list").val();
727
- if( email_trigger.val() === '' ){
728
- showerror(email_trigger);
729
- error = true;
730
- } else{
731
- hideerror(email_trigger);
732
  }
733
- if(email_trigger.val() == 'order_status'){
734
- if( order_status.val() === '' ){
735
- showerror(order_status);
736
- error = true;
737
- } else{
738
- hideerror(order_status);
 
 
 
 
 
 
 
 
 
 
 
739
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
740
  }
741
- if(email_trigger.val() == 'shipment_status'){
742
- if( shippment_status.val() === '' ){
743
- showerror(shippment_status);
744
- error = true;
745
- } else{
746
- hideerror(shippment_status);
 
 
 
 
 
 
 
 
 
 
747
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  }
 
749
 
750
- if( email_label.val() === '' ){
751
- showerror(email_label);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
752
  error = true;
753
  } else{
754
- hideerror(email_label);
755
- }
756
- if( email_subject.val() === '' ){
757
- showerror(email_subject);
 
758
  error = true;
759
  } else{
760
- hideerror(email_subject);
761
- }
762
- if( email_to.val() === '' ){
763
- showerror(email_to);
 
764
  error = true;
765
  } else{
766
- hideerror(email_to);
767
- }
768
- if( email_heading.val() === '' ){
769
- showerror(email_heading);
 
770
  error = true;
771
  } else{
772
- hideerror(email_heading);
773
  }
774
 
 
775
  if(error == true){
776
  return false;
777
  }
778
- jQuery("#content5 ").block({
779
- message: null,
780
- overlayCSS: {
781
- background: "#fff",
782
- opacity: .6
783
- }
784
  });
785
  jQuery.ajax({
786
  url: ajaxurl,
787
  data: form.serialize(),
788
- type: 'POST',
789
- dataType: "json",
790
- success: function(response) {
791
- jQuery(".ac-container").replaceWith(response.html);
792
  componentHandler.upgradeAllRegistered();
793
- form[0].reset();
794
-
795
- var insertid = 'email_content_'+response.insertid;
796
- tinymce.execCommand('mceAddEditor', true, insertid);
797
-
798
- if(id_list){
799
- var id_array = id_list.split(',');
800
- jQuery.each(id_array, function(index, value) {
801
- if(insertid != value){
802
- var id = 'email_content_'+value;
803
- tinymce.execCommand('mceRemoveEditor', true, id);
804
- tinymce.execCommand('mceAddEditor', true, id);
805
- var init = tinymce.extend( {}, tinyMCEPreInit.mceInit[ id ] );
806
- try { tinymce.init( init ); } catch(e){}
807
- }
808
- });
809
- }
810
-
811
- jQuery('#add_new_status_email_form').toggle(500);
812
- jQuery("#content5").unblock();
813
  },
814
  error: function(response) {
815
  console.log(response);
@@ -818,13 +578,112 @@ jQuery(document).on("change", ".email_trigger_dropdown", function(){
818
  return false;
819
  });
820
 
821
- jQuery(document).on("click", "#update_shipment_status_email_btn", function(){
822
- var status_email_id = jQuery(this).data("id");
823
- var form = jQuery('#status_email_form_'+status_email_id);
824
- var id_list = jQuery("#id_list").val();
825
- var id_array = id_list.split(',');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  var error;
827
- jQuery("#content5 ").block({
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
  message: null,
829
  overlayCSS: {
830
  background: "#fff",
@@ -834,134 +693,203 @@ jQuery(document).on("click", "#update_shipment_status_email_btn", function(){
834
  jQuery.ajax({
835
  url: ajaxurl,
836
  data: form.serialize(),
837
- type: 'POST',
838
- success: function(response) {
839
- jQuery(".ac-container").replaceWith(response);
840
- jQuery.each(id_array, function(index, value) {
841
- var id = 'email_content_'+value;
842
- tinymce.execCommand('mceRemoveEditor', true, id);
843
- tinymce.execCommand('mceAddEditor', true, id);
844
- var init = tinymce.extend( {}, tinyMCEPreInit.mceInit[ id ] );
845
- try { tinymce.init( init ); } catch(e){}
846
- });
847
  componentHandler.upgradeAllRegistered();
848
- jQuery("#content5").unblock();
 
 
 
849
  },
850
  error: function(response) {
851
  console.log(response);
852
  }
853
- });
 
854
  });
855
 
856
- jQuery(document).on("click", "#delete_shipment_status_email_btn", function(){
857
- jQuery("#content5 ").block({
858
  message: null,
859
  overlayCSS: {
860
  background: "#fff",
861
  opacity: .6
862
  }
863
  });
864
- var r = confirm("Really delete this entry? This will not be undo.");
865
- if (r === true) {
866
-
867
- } else {
868
- jQuery("#content5 ").unblock();
869
  return;
870
- }
871
- var status_email_id = jQuery(this).data("id");
872
- var id_list = jQuery("#id_list").val();
873
- var id_array = id_list.split(',');
874
- var data = {
875
- action: 'delete_status_email',
876
- status_email_id: status_email_id,
877
  };
878
-
879
  jQuery.ajax({
880
  url: ajaxurl,
881
- data: data,
882
  type: 'POST',
883
- success: function(response) {
884
- jQuery(".ac-container").replaceWith(response);
 
 
885
  componentHandler.upgradeAllRegistered();
886
- /*jQuery.each(id_array, function(index, value) {
887
- var id = 'email_content_'+value;
888
- tinymce.execCommand('mceRemoveEditor', true, id);
889
- //tinymce.execCommand('mceAddEditor', true, id);
890
- var init = tinymce.extend( {}, tinyMCEPreInit.mceInit[ id ] );
891
- try { tinymce.init( init ); } catch(e){}
892
- });*/
893
- jQuery("#content5 ").unblock();
894
  },
895
  error: function(response) {
896
  console.log(response);
897
  }
898
- });
899
  });
900
 
901
- jQuery(document).on("change", "#wcast_enable_delivered_email", function(){
902
- jQuery("#content5 ").block({
903
- message: null,
904
- overlayCSS: {
905
- background: "#fff",
906
- opacity: .6
907
- }
908
  });
909
- if(jQuery(this).prop("checked") == true){
910
- var wcast_enable_delivered_email = 'yes';
911
- } else{
912
- var wcast_enable_delivered_email = 'no';
913
- }
 
 
 
914
  var ajax_data = {
915
- action: 'update_delivered_order_email_status',
916
- wcast_enable_delivered_email: wcast_enable_delivered_email,
917
  };
918
  jQuery.ajax({
919
  url: ajaxurl,
920
- data: ajax_data,
921
  type: 'POST',
922
- success: function(response) {
923
- jQuery("#content5 ").unblock();
924
- var snackbarContainer = document.querySelector('#demo-toast-example');
925
- var data = {message: shipment_tracking_table_rows.i18n.data_saved};
926
- snackbarContainer.MaterialSnackbar.showSnackbar(data);
 
927
  },
928
- error: function(response) {
 
929
  }
930
  });
931
  });
932
 
933
- jQuery(document).on("change", ".shipment_status_toggle input", function(){
934
- jQuery("#content5 ").block({
935
- message: null,
936
- overlayCSS: {
937
- background: "#fff",
938
- opacity: .6
939
- }
940
- });
941
- if(jQuery(this).prop("checked") == true){
942
- var wcast_enable_status_email = 1;
943
- }
944
- var id = jQuery(this).attr('id');
945
  var ajax_data = {
946
- action: 'update_shipment_status_email_status',
947
- id: id,
948
- wcast_enable_status_email: wcast_enable_status_email,
949
  };
950
  jQuery.ajax({
951
  url: ajaxurl,
952
- data: ajax_data,
953
  type: 'POST',
954
- success: function(response) {
955
- jQuery("#content5 ").unblock();
956
- var snackbarContainer = document.querySelector('#demo-toast-example');
957
- var data = {message: shipment_tracking_table_rows.i18n.data_saved};
958
- snackbarContainer.MaterialSnackbar.showSnackbar(data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
959
  },
960
- error: function(response) {
 
961
  }
962
  });
963
  });
964
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
965
  function showerror(element){
966
  element.css("border","1px solid red");
967
  }
26
  } ) );
27
  } );
28
 
29
+ $wc_ast_settings_form.on( 'click', '.woocommerce-save-button', this.save_wc_ast_settings_form );
30
  $wc_ast_trackship_form.on( 'click', '.woocommerce-save-button', this.save_wc_ast_trackship_form );
31
 
32
  $(".tipTip").tipTip();
46
  snackbarContainer.MaterialSnackbar.showSnackbar(data);
47
  });
48
 
49
+ },
50
 
51
  save_wc_ast_trackship_form: function( event ) {
52
  event.preventDefault();
138
  });
139
  })( jQuery, shipment_tracking_table_rows, wp, ajaxurl );
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
  jQuery(document).on("change", ".wc_ast_default_provider", function(){
143
  jQuery(".d_s_select_section ").block({
166
  }
167
  });
168
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  var file_frame;
170
  jQuery('#upload_image_button').live('click', function(product) {
171
  product.preventDefault();
320
  }
321
  return false;
322
  });
323
+
324
+
325
+ jQuery(document).on("change", ".shipment_status_toggle input", function(){
326
+ jQuery("#content5 ").block({
327
+ message: null,
328
+ overlayCSS: {
329
+ background: "#fff",
330
+ opacity: .6
331
+ }
332
+ });
333
+ if(jQuery(this).prop("checked") == true){
334
+ var wcast_enable_status_email = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  }
336
+ var id = jQuery(this).attr('id');
337
+ var ajax_data = {
338
+ action: 'update_shipment_status_email_status',
339
+ id: id,
340
+ wcast_enable_status_email: wcast_enable_status_email,
341
+ };
342
+ jQuery.ajax({
343
+ url: ajaxurl,
344
+ data: ajax_data,
345
+ type: 'POST',
346
+ success: function(response) {
347
+ jQuery("#content5 ").unblock();
348
+ var snackbarContainer = document.querySelector('#demo-toast-example');
349
+ var data = {message: shipment_tracking_table_rows.i18n.data_saved};
350
+ snackbarContainer.MaterialSnackbar.showSnackbar(data);
351
+ },
352
+ error: function(response) {
353
  }
354
+ });
355
+ });
356
+
357
+
358
+ jQuery(document).on("click", ".status_filter a", function(){
359
+ jQuery("#content1 ").block({
360
+ message: null,
361
+ overlayCSS: {
362
+ background: "#fff",
363
+ opacity: .6
364
+ }
365
+ });
366
+ jQuery('.status_filter a').removeClass('active');
367
+ jQuery(this).addClass('active');
368
+ var status = jQuery(this).data('status');
369
+ var ajax_data = {
370
+ action: 'filter_shipiing_provider_by_status',
371
+ status: status,
372
+ };
373
+ jQuery.ajax({
374
+ url: ajaxurl,
375
+ data: ajax_data,
376
+ type: 'POST',
377
+ success: function(response) {
378
+ jQuery(".provider_list").replaceWith(response);
379
+ jQuery("#content1 ").unblock();
380
+ componentHandler.upgradeAllRegistered();
381
+ },
382
+ error: function(response) {
383
+ }
384
+ });
385
+ });
386
+
387
+ jQuery(document).on("click", ".status_slide", function(){
388
+ var id = jQuery(this).val();
389
+ if(jQuery(this).prop("checked") == true){
390
+ var checked = 1;
391
+ jQuery(this).closest('.provider').addClass('active_provider');
392
+ jQuery('#make_default_'+id).prop('disabled', false);
393
+ jQuery('#default_label_'+id).removeClass('disable_label');
394
+ } else{
395
+ var checked = 0;
396
+ jQuery(this).closest('.provider').removeClass('active_provider');
397
+ jQuery('#make_default_'+id).prop('disabled', true);
398
+ jQuery('#make_default_'+id).prop('checked', false);
399
+ jQuery('#default_label_'+id).addClass('disable_label');
400
  }
401
+
402
+
403
+ var error;
404
+ var ajax_data = {
405
+ action: 'update_shipment_status',
406
+ id: id,
407
+ checked: checked,
408
+ };
409
+ jQuery.ajax({
410
+ url: ajaxurl,
411
+ data: ajax_data,
412
+ type: 'POST',
413
+ success: function(response) {
414
+ },
415
+ error: function(response) {
416
+ console.log(response);
417
  }
418
+ });
419
+ });
420
+
421
+ jQuery(document).on("change", ".make_provider_default", function(){
422
+ jQuery("#content1 ").block({
423
+ message: null,
424
+ overlayCSS: {
425
+ background: "#fff",
426
+ opacity: .6
427
+ }
428
+ });
429
+ if(jQuery(this).prop("checked") == true){
430
+ jQuery('.make_provider_default').removeAttr('checked');
431
+ var checked = 1;
432
+ jQuery(this).prop('checked',true);
433
+ } else{
434
+ var checked = 0;
435
  }
436
+ var id = jQuery(this).data('id');
437
 
438
+ var error;
439
+ var default_provider = jQuery(this).val();
440
+ var ajax_data = {
441
+ action: 'update_default_provider',
442
+ default_provider: default_provider,
443
+ id: id,
444
+ checked: checked,
445
+ };
446
+ jQuery.ajax({
447
+ url: ajaxurl,
448
+ data: ajax_data,
449
+ type: 'POST',
450
+ success: function(response) {
451
+ jQuery("#content1 ").unblock();
452
+ },
453
+ error: function(response) {
454
+ console.log(response);
455
+ }
456
+ });
457
+ });
458
+
459
+ jQuery(document).on( "input", "#search_provider", function(){
460
+ jQuery('.status_filter a').removeClass('active');
461
+ jQuery("[data-status=all]").addClass('active');
462
+
463
+ var ajax_data = {
464
+ action: 'filter_shipiing_provider_by_status',
465
+ status: 'all',
466
+ };
467
+ jQuery.ajax({
468
+ url: ajaxurl,
469
+ data: ajax_data,
470
+ type: 'POST',
471
+ success: function(response) {
472
+ jQuery(".provider_list").replaceWith(response);
473
+ //jQuery("#content1 ").unblock();
474
+ componentHandler.upgradeAllRegistered();
475
+ var searchvalue = jQuery("#search_provider").val().toLowerCase().replace(/\s+/g, '');
476
+ jQuery('.provider').each(function() {
477
+ var provider = jQuery(this).find('.provider_name').text().toLowerCase().replace(/\s+/g, '');
478
+ var country = jQuery(this).find('.provider_country').text().toLowerCase().replace(/\s+/g, '');
479
+
480
+ var hasprovider = provider.indexOf(searchvalue)!==-1;
481
+ var hascountry= country.indexOf(searchvalue)!==-1;
482
+
483
+ if (hasprovider || hascountry) {
484
+ jQuery(this).show();
485
+ } else {
486
+ jQuery(this).hide();
487
+ }
488
+ });
489
+ },
490
+ error: function(response) {
491
+ }
492
+ });
493
+ });
494
+
495
+ jQuery(document).on("click", ".add_custom_provider", function(){
496
+ jQuery('.add_provider_popup').show();
497
+ });
498
+ jQuery(document).on("click", ".popupclose", function(){
499
+ jQuery('.add_provider_popup').hide();
500
+ jQuery('.edit_provider_popup').hide();
501
+ jQuery('.sync_provider_popup').hide();
502
+ });
503
+ jQuery(document).on("click", ".close_synch_popup", function(){
504
+ jQuery('.sync_provider_popup').hide();
505
+ jQuery(".sync_message").show();
506
+ jQuery(".synch_result").hide();
507
+ jQuery(".view_synch_details").remove();
508
+ jQuery(".updated_details").remove();
509
+
510
+ jQuery(".sync_providers_btn").show();
511
+ jQuery(".close_synch_popup").hide();
512
+ });
513
+ jQuery(document).on("submit", "#add_provider_form", function(){
514
+
515
+ var form = jQuery('#add_provider_form');
516
+ var error;
517
+ var shipping_provider = jQuery(".add_provider_popup #shipping_provider");
518
+ var shipping_country = jQuery(".add_provider_popup #shipping_country");
519
+ var thumb_url = jQuery(".add_provider_popup #thumb_url");
520
+ var tracking_url = jQuery(".add_provider_popup #tracking_url");
521
+
522
+ if( shipping_provider.val() === '' ){
523
+ showerror(shipping_provider);
524
  error = true;
525
  } else{
526
+ hideerror(shipping_provider);
527
+ }
528
+
529
+ if( shipping_country.val() === '' ){
530
+ showerror(shipping_country);
531
  error = true;
532
  } else{
533
+ hideerror(shipping_country);
534
+ }
535
+
536
+ /*if( thumb_url.val() === '' ){
537
+ showerror(thumb_url);
538
  error = true;
539
  } else{
540
+ hideerror(thumb_url);
541
+ }*/
542
+
543
+ if( tracking_url.val() === '' ){
544
+ showerror(tracking_url);
545
  error = true;
546
  } else{
547
+ hideerror(tracking_url);
548
  }
549
 
550
+
551
  if(error == true){
552
  return false;
553
  }
554
+ jQuery(".add_provider_popup").block({
555
+ message: null,
556
+ overlayCSS: {
557
+ background: "#fff",
558
+ opacity: .6
559
+ }
560
  });
561
  jQuery.ajax({
562
  url: ajaxurl,
563
  data: form.serialize(),
564
+ type: 'POST',
565
+ success: function(response) {
566
+ jQuery(".provider_list").replaceWith(response);
567
+ form[0].reset();
568
  componentHandler.upgradeAllRegistered();
569
+ jQuery('.status_filter a').removeClass('active');
570
+ jQuery("[data-status=custom]").addClass('active');
571
+ jQuery('.add_provider_popup').hide();
572
+ jQuery(".add_provider_popup").unblock();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  },
574
  error: function(response) {
575
  console.log(response);
578
  return false;
579
  });
580
 
581
+ jQuery(document).on("click", ".remove", function(){
582
+ jQuery("#content1 ").block({
583
+ message: null,
584
+ overlayCSS: {
585
+ background: "#fff",
586
+ opacity: .6
587
+ }
588
+ });
589
+ var r = confirm( shipment_tracking_table_rows.i18n.delete_provider );
590
+ if (r === true) {
591
+ } else {
592
+ $("#content1").unblock();
593
+ return;
594
+ }
595
+ var id = jQuery(this).data('pid');
596
+
597
+ var error;
598
+ var default_provider = jQuery(this).val();
599
+ var ajax_data = {
600
+ action: 'woocommerce_shipping_provider_delete',
601
+ provider_id: id,
602
+ };
603
+ jQuery.ajax({
604
+ url: ajaxurl,
605
+ data: ajax_data,
606
+ type: 'POST',
607
+ success: function(response) {
608
+ jQuery(".provider_list").replaceWith(response);
609
+ jQuery('.status_filter a').removeClass('active');
610
+ jQuery("[data-status=custom]").addClass('active');
611
+ componentHandler.upgradeAllRegistered();
612
+ jQuery("#content1").unblock();
613
+ },
614
+ error: function(response) {
615
+ console.log(response);
616
+ }
617
+ });
618
+ });
619
+
620
+ jQuery(document).on("click", ".edit_provider", function(){
621
+ var id = jQuery(this).data('pid');
622
+ var ajax_data = {
623
+ action: 'get_provider_details',
624
+ provider_id: id,
625
+ };
626
+ jQuery.ajax({
627
+ url: ajaxurl,
628
+ data: ajax_data,
629
+ type: 'POST',
630
+ dataType: "json",
631
+ success: function(response) {
632
+ var provider_name = response.provider_name;
633
+ var provider_url = response.provider_url;
634
+ var shipping_country = response.shipping_country;
635
+ var custom_thumb_id = response.custom_thumb_id;
636
+ var image = response.image;
637
+ jQuery('.edit_provider_popup #shipping_provider').val(provider_name);
638
+ jQuery('.edit_provider_popup #tracking_url').val(provider_url);
639
+ jQuery('.edit_provider_popup #thumb_url').val(image);
640
+ jQuery('.edit_provider_popup #thumb_id').val(custom_thumb_id);
641
+ jQuery('.edit_provider_popup #provider_id').val(id);
642
+ $(".edit_provider_popup #shipping_country").val(shipping_country);
643
+ jQuery('.edit_provider_popup').show();
644
+ //console.log(provider_name);
645
+ },
646
+ error: function(response) {
647
+ console.log(response);
648
+ }
649
+ });
650
+ });
651
+
652
+ jQuery(document).on("submit", "#edit_provider_form", function(){
653
+
654
+ var form = jQuery('#edit_provider_form');
655
  var error;
656
+ var shipping_provider = jQuery("#edit_provider_form #shipping_provider");
657
+ var shipping_country = jQuery("#edit_provider_form #shipping_country");
658
+ var thumb_url = jQuery("#edit_provider_form #thumb_url");
659
+ var tracking_url = jQuery("#edit_provider_form #tracking_url");
660
+
661
+ if( shipping_provider.val() === '' ){
662
+ showerror(shipping_provider);
663
+ error = true;
664
+ } else{
665
+ hideerror(shipping_provider);
666
+ }
667
+
668
+ if( shipping_country.val() === '' ){
669
+ showerror(shipping_country);
670
+ error = true;
671
+ } else{
672
+ hideerror(shipping_country);
673
+ }
674
+
675
+ if( tracking_url.val() === '' ){
676
+ showerror(tracking_url);
677
+ error = true;
678
+ } else{
679
+ hideerror(tracking_url);
680
+ }
681
+
682
+
683
+ if(error == true){
684
+ return false;
685
+ }
686
+ jQuery(".edit_provider_popup").block({
687
  message: null,
688
  overlayCSS: {
689
  background: "#fff",
693
  jQuery.ajax({
694
  url: ajaxurl,
695
  data: form.serialize(),
696
+ type: 'POST',
697
+ success: function(response) {
698
+ jQuery(".provider_list").replaceWith(response);
699
+ form[0].reset();
 
 
 
 
 
 
700
  componentHandler.upgradeAllRegistered();
701
+ jQuery('.status_filter a').removeClass('active');
702
+ jQuery("[data-status=custom]").addClass('active');
703
+ jQuery('.edit_provider_popup').hide();
704
+ jQuery(".edit_provider_popup").unblock();
705
  },
706
  error: function(response) {
707
  console.log(response);
708
  }
709
+ });
710
+ return false;
711
  });
712
 
713
+ jQuery(document).on("click", ".reset_active", function(){
714
+ jQuery("#content1 ").block({
715
  message: null,
716
  overlayCSS: {
717
  background: "#fff",
718
  opacity: .6
719
  }
720
  });
721
+ var r = confirm( 'Do you really want to change all provider status to active?' );
722
+ if (r === true) {
723
+ } else {
724
+ $("#content1").unblock();
 
725
  return;
726
+ }
727
+
728
+ var error;
729
+ var ajax_data = {
730
+ action: 'update_provider_status_active',
 
 
731
  };
 
732
  jQuery.ajax({
733
  url: ajaxurl,
734
+ data: ajax_data,
735
  type: 'POST',
736
+ success: function(response) {
737
+ jQuery(".provider_list").replaceWith(response);
738
+ jQuery('.status_filter a').removeClass('active');
739
+ jQuery("[data-status=active]").addClass('active');
740
  componentHandler.upgradeAllRegistered();
741
+ jQuery("#content1").unblock();
 
 
 
 
 
 
 
742
  },
743
  error: function(response) {
744
  console.log(response);
745
  }
746
+ });
747
  });
748
 
749
+ jQuery(document).on("click", ".reset_inactive", function(){
750
+ jQuery("#content1 ").block({
751
+ message: null,
752
+ overlayCSS: {
753
+ background: "#fff",
754
+ opacity: .6
755
+ }
756
  });
757
+ var r = confirm( 'Do you really want to change all provider status to inactive?' );
758
+ if (r === true) {
759
+ } else {
760
+ $("#content1").unblock();
761
+ return;
762
+ }
763
+
764
+ var error;
765
  var ajax_data = {
766
+ action: 'update_provider_status_inactive',
 
767
  };
768
  jQuery.ajax({
769
  url: ajaxurl,
770
+ data: ajax_data,
771
  type: 'POST',
772
+ success: function(response) {
773
+ jQuery(".provider_list").replaceWith(response);
774
+ jQuery('.status_filter a').removeClass('active');
775
+ jQuery("[data-status=inactive]").addClass('active');
776
+ componentHandler.upgradeAllRegistered();
777
+ jQuery("#content1").unblock();
778
  },
779
+ error: function(response) {
780
+ console.log(response);
781
  }
782
  });
783
  });
784
 
785
+ jQuery(document).on("click", ".sync_providers", function(){
786
+ jQuery('.sync_provider_popup').show();
787
+ });
788
+ jQuery(document).on("click", ".sync_providers_btn", function(){
789
+ jQuery('.sync_provider_popup .spinner').addClass('active');
790
+ jQuery('.sync_message').hide();
 
 
 
 
 
 
791
  var ajax_data = {
792
+ action: 'sync_providers',
 
 
793
  };
794
  jQuery.ajax({
795
  url: ajaxurl,
796
+ data: ajax_data,
797
  type: 'POST',
798
+ dataType: "json",
799
+ success: function(response) {
800
+ console.log(response.updated_data);
801
+ jQuery('.sync_provider_popup .spinner').removeClass('active');
802
+ jQuery(".provider_list").replaceWith(response.html);
803
+ jQuery('.status_filter a').removeClass('active');
804
+ jQuery("[data-status=active]").addClass('active');
805
+
806
+ jQuery(".providers_added span").text(response.added);
807
+ if(response.added > 0 ){
808
+ jQuery( ".providers_added" ).append( response.added_html );
809
+ }
810
+
811
+ jQuery(".providers_updated span").text(response.updated);
812
+ if(response.updated > 0 ){
813
+ jQuery( ".providers_updated" ).append( response.updated_html );
814
+ }
815
+
816
+ jQuery(".providers_deleted span").text(response.deleted);
817
+ if(response.deleted > 0 ){
818
+ jQuery( ".providers_deleted" ).append( response.deleted_html );
819
+ }
820
+ jQuery(".synch_result").show();
821
+ jQuery(".sync_providers_btn").hide();
822
+ jQuery(".close_synch_popup").show();
823
+
824
+ componentHandler.upgradeAllRegistered();
825
  },
826
+ error: function(response) {
827
+ console.log(response);
828
  }
829
  });
830
  });
831
 
832
+ jQuery(document).on("click", "#view_added_details", function(){
833
+ jQuery('#added_providers').show();
834
+ jQuery(this).hide();
835
+ jQuery('#hide_added_details').show();
836
+ });
837
+ jQuery(document).on("click", "#hide_added_details", function(){
838
+ jQuery('#added_providers').hide();
839
+ jQuery(this).hide();
840
+ jQuery('#view_added_details').show();
841
+ });
842
+
843
+ jQuery(document).on("click", "#view_updated_details", function(){
844
+ jQuery('#updated_providers').show();
845
+ jQuery(this).hide();
846
+ jQuery('#hide_updated_details').show();
847
+ });
848
+ jQuery(document).on("click", "#hide_updated_details", function(){
849
+ jQuery('#updated_providers').hide();
850
+ jQuery(this).hide();
851
+ jQuery('#view_updated_details').show();
852
+ });
853
+
854
+ jQuery(document).on("click", "#view_deleted_details", function(){
855
+ jQuery('#deleted_providers').show();
856
+ jQuery(this).hide();
857
+ jQuery('#hide_deleted_details').show();
858
+ });
859
+ jQuery(document).on("click", "#hide_deleted_details", function(){
860
+ jQuery('#deleted_providers').hide();
861
+ jQuery(this).hide();
862
+ jQuery('#view_deleted_details').show();
863
+ });
864
+
865
+ jQuery(document).on("change", "#wcast_enable_delivered_email", function(){
866
+ if(jQuery(this).prop("checked") == true){
867
+ jQuery('.delivered_shipment_label').addClass('delivered_enabel');
868
+ jQuery('.delivered_shipment_label .email_heading').addClass('disabled_link');
869
+ jQuery('.delivered_shipment_label .edit_customizer_a').addClass('disabled_link');
870
+ jQuery('.delivered_shipment_label .delivered_message').addClass('disable_delivered');
871
+ jQuery('#wcast_enable_delivered_status_email').prop('disabled', true);
872
+ } else{
873
+ jQuery('.delivered_shipment_label').removeClass('delivered_enabel');
874
+ jQuery('.delivered_shipment_label .email_heading').removeClass('disabled_link');
875
+ jQuery('.delivered_shipment_label .edit_customizer_a').removeClass('disabled_link');
876
+ jQuery('.delivered_shipment_label .delivered_message').removeClass('disable_delivered');
877
+ jQuery('#wcast_enable_delivered_status_email').removeAttr('disabled');
878
+ }
879
+ componentHandler.upgradeAllRegistered();
880
+ });
881
+
882
+
883
+ jQuery(document).click(function(){
884
+ var $trigger = jQuery(".dropdown");
885
+ if($trigger !== event.target && !$trigger.has(event.target).length){
886
+ jQuery(".dropdown-content").hide();
887
+ }
888
+ });
889
+ jQuery(document).on("click", ".dropdown_menu", function(){
890
+ jQuery('.dropdown-content').show();
891
+ });
892
+
893
  function showerror(element){
894
  element.css("border","1px solid red");
895
  }
assets/shipment-provider-img/abf.png CHANGED
Binary file
assets/shipment-provider-img/aliexpress-standard-shipping.png ADDED
Binary file
assets/shipment-provider-img/an-post.png CHANGED
Binary file
assets/shipment-provider-img/apc.png CHANGED
Binary file
assets/shipment-provider-img/arrowxl.png CHANGED
Binary file
assets/shipment-provider-img/associated-global-systems.png CHANGED
Binary file
assets/shipment-provider-img/australia-ems.png ADDED
Binary file
assets/shipment-provider-img/australia-post.png CHANGED
Binary file
assets/shipment-provider-img/bangladesh-ems.png ADDED
Binary file
assets/shipment-provider-img/belgium-post.png ADDED
Binary file
assets/shipment-provider-img/boxberry.png CHANGED
Binary file
assets/shipment-provider-img/brazil-correios.png ADDED
Binary file
assets/shipment-provider-img/canada-post.png CHANGED
Binary file
assets/shipment-provider-img/canpar.png CHANGED
Binary file
assets/shipment-provider-img/china-post.png CHANGED
Binary file
assets/shipment-provider-img/chronopost.png CHANGED
Binary file
assets/shipment-provider-img/colis-prive.png CHANGED
Binary file
assets/shipment-provider-img/colissimo.png CHANGED
Binary file
assets/shipment-provider-img/colombia-post.png ADDED
Binary file
assets/shipment-provider-img/correios.png DELETED
Binary file
assets/shipment-provider-img/correos-chile.png CHANGED
Binary file
assets/shipment-provider-img/correos-costa-rica.png CHANGED
Binary file
assets/shipment-provider-img/costa-rica-post.png ADDED
Binary file
assets/shipment-provider-img/couriersplease.png CHANGED
Binary file
assets/shipment-provider-img/croatia-post.png ADDED
Binary file
assets/shipment-provider-img/cyprus-post.png ADDED
Binary file
assets/shipment-provider-img/dai-post.png CHANGED
Binary file
assets/shipment-provider-img/delhivery.png CHANGED
Binary file
assets/shipment-provider-img/deliv.png CHANGED
Binary file
assets/shipment-provider-img/denmark-post.png ADDED
Binary file
assets/shipment-provider-img/{fastway-couriers.png → deppon.png} RENAMED
Binary file
assets/shipment-provider-img/deutsche-post-dhl.png CHANGED
Binary file
assets/shipment-provider-img/deutsche-post.png CHANGED
Binary file
assets/shipment-provider-img/dhl-at.png CHANGED
Binary file
assets/shipment-provider-img/dhl-cz.png CHANGED
Binary file
assets/shipment-provider-img/dhl-express.png CHANGED
Binary file
assets/shipment-provider-img/dhl-freight.png ADDED
Binary file
assets/shipment-provider-img/dhl-intraship-de.png CHANGED
Binary file
assets/shipment-provider-img/dhl-se.png CHANGED
Binary file
assets/shipment-provider-img/dhl-uk.png ADDED
Binary file
assets/shipment-provider-img/dhl-us.png CHANGED
Binary file
assets/shipment-provider-img/dhlparcel-nl.png ADDED
Binary file
assets/shipment-provider-img/direct-link.png CHANGED
Binary file
assets/shipment-provider-img/dpd-at.png CHANGED
Binary file
assets/shipment-provider-img/dpd-co-uk.png CHANGED
Binary file
assets/shipment-provider-img/dpd-cz.png CHANGED
Binary file
assets/shipment-provider-img/dpd-de.png CHANGED
Binary file
assets/shipment-provider-img/dpd-ie.png CHANGED
Binary file
assets/shipment-provider-img/dpd-nl.png CHANGED
Binary file
assets/shipment-provider-img/dpd-romania.png CHANGED
Binary file
assets/shipment-provider-img/dtdc-plus.png ADDED
Binary file
assets/shipment-provider-img/dtdc.png CHANGED
Binary file
assets/shipment-provider-img/ec-firstclass.png CHANGED
Binary file
assets/shipment-provider-img/ecom-express.png CHANGED
Binary file
assets/shipment-provider-img/ems.png CHANGED
Binary file
assets/shipment-provider-img/epacket.png ADDED
Binary file
assets/shipment-provider-img/estonia-post.png ADDED
Binary file
assets/shipment-provider-img/fastway-au.png ADDED
Binary file
assets/shipment-provider-img/fastway-nz.png ADDED
Binary file
assets/shipment-provider-img/fedex.png CHANGED
Binary file
assets/shipment-provider-img/france-ems-chronopost.png ADDED
Binary file
assets/shipment-provider-img/gso.png CHANGED
Binary file
assets/shipment-provider-img/hermes.png CHANGED
Binary file
assets/shipment-provider-img/hong-kong-post.png CHANGED
Binary file
assets/shipment-provider-img/india-post.png CHANGED
Binary file
assets/shipment-provider-img/interlink.png CHANGED
Binary file
assets/shipment-provider-img/israel-post.png CHANGED
Binary file
assets/shipment-provider-img/ivory-coast-ems.png ADDED
Binary file
assets/shipment-provider-img/jp-post.png CHANGED
Binary file
assets/shipment-provider-img/korea-post.png ADDED
Binary file
assets/shipment-provider-img/la-poste.png CHANGED
Binary file
assets/shipment-provider-img/lasership.png CHANGED
Binary file
assets/shipment-provider-img/latvijas-pasts.png CHANGED
Binary file
assets/shipment-provider-img/monaco-ems.png ADDED
Binary file
assets/shipment-provider-img/mondial-relay.png CHANGED
Binary file
assets/shipment-provider-img/ninja-van.png CHANGED
Binary file
assets/shipment-provider-img/ontrac.png CHANGED
Binary file
assets/shipment-provider-img/overseas-territory-fr-ems.png ADDED
Binary file
assets/shipment-provider-img/parcelforce.png CHANGED
Binary file
assets/shipment-provider-img/portugal-post-ctt.png ADDED
Binary file
assets/shipment-provider-img/postnl.png CHANGED
Binary file
assets/shipment-provider-img/postnord-sverige-ab.png CHANGED
Binary file
assets/shipment-provider-img/royal-mail.png CHANGED
Binary file
assets/shipment-provider-img/s-f-express.png ADDED
Binary file
assets/shipment-provider-img/{bpost.png → sendle.png} RENAMED
Binary file
assets/shipment-provider-img/singapore-post.png CHANGED
Binary file
assets/shipment-provider-img/south-african-post-office.png ADDED
Binary file
assets/shipment-provider-img/speedex-courier.png ADDED
Binary file
assets/shipment-provider-img/startrack.png CHANGED
Binary file
assets/shipment-provider-img/swiss-post.png ADDED
Binary file
assets/shipment-provider-img/tnt-australia.png ADDED
Binary file
assets/shipment-provider-img/tnt-click.png ADDED
Binary file
assets/shipment-provider-img/tnt-france.png ADDED
Binary file
assets/shipment-provider-img/tnt-italy.png ADDED
Binary file
assets/shipment-provider-img/tnt-reference.png ADDED
Binary file
assets/shipment-provider-img/tnt-uk.png ADDED
Binary file
assets/shipment-provider-img/tnt.png ADDED
Binary file
assets/shipment-provider-img/ukraine-ems.png ADDED
Binary file
assets/shipment-provider-img/ukrposhta.png CHANGED
Binary file
assets/shipment-provider-img/ups-germany.png CHANGED
Binary file
assets/shipment-provider-img/ups-i-parcel.png CHANGED
Binary file
assets/shipment-provider-img/ups-se.png CHANGED
Binary file
assets/shipment-provider-img/ups.png CHANGED
Binary file
assets/shipment-provider-img/usps.png CHANGED
Binary file
includes/class-wc-advanced-shipment-tracking-admin.php CHANGED
@@ -122,46 +122,14 @@ class WC_Advanced_Shipment_Tracking_Admin {
122
 
123
  add_filter( 'woocommerce_email_title', array( $this, 'change_completed_woocommerce_email_title'), 10, 2 );
124
 
125
- // ajax add shipping providers
126
- add_action( 'wp_ajax_woocommerce_shipping_provider_add', array( $this, 'woocommerce_shipping_provider_add' ) );
127
-
128
- // Delete shipping provider via ajax function
129
- add_action( 'wp_ajax_woocommerce_shipping_provider_delete', array( $this, 'woocommerce_shipping_provider_delete' ) );
130
-
131
- add_action( 'wp_ajax_nopriv_update_sort_order', array( $this, 'update_sort_order_fun') );
132
- add_action( 'wp_ajax_update_sort_order', array( $this, 'update_sort_order_fun') );
133
-
134
- add_action( 'wp_ajax_nopriv_update_shipment_status', array( $this, 'update_shipment_status_fun') );
135
- add_action( 'wp_ajax_update_shipment_status', array( $this, 'update_shipment_status_fun') );
136
-
137
- add_action( 'wp_ajax_nopriv_add_custom_shipment_provider', array( $this, 'add_custom_shipment_provider_fun') );
138
- add_action( 'wp_ajax_add_custom_shipment_provider', array( $this, 'add_custom_shipment_provider_fun') );
139
-
140
- add_action( 'wp_ajax_nopriv_update_shipping_provider', array( $this, 'update_shipping_provider_fun') );
141
- add_action( 'wp_ajax_update_shipping_provider', array( $this, 'update_shipping_provider_fun') );
142
-
143
- add_action( 'wp_ajax_nopriv_update_shipping_provider_dropdown', array( $this, 'update_shipping_provider_dropdown_fun') );
144
- add_action( 'wp_ajax_update_shipping_provider_dropdown', array( $this, 'update_shipping_provider_dropdown_fun') );
145
-
146
- add_action( 'wp_ajax_nopriv_update_default_provider', array( $this, 'update_default_provider_fun') );
147
- add_action( 'wp_ajax_update_default_provider', array( $this, 'update_default_provider_fun') );
148
 
149
  add_action( 'wp_ajax_wc_ast_upload_csv_form_update', array( $this, 'upload_tracking_csv_fun') );
150
-
151
-
152
- add_action( 'wp_ajax_save_status_email', array( $this, 'save_status_email_fun') );
153
-
154
- add_action( 'wp_ajax_update_status_email', array( $this, 'update_status_email_fun') );
155
-
156
- add_action( 'wp_ajax_delete_status_email', array( $this, 'delete_status_email_fun') );
157
 
158
  add_action( 'wp_ajax_update_delivered_order_email_status', array( $this, 'update_delivered_order_email_status_fun') );
159
 
160
  add_action( 'wp_ajax_update_shipment_status_email_status', array( $this, 'update_shipment_status_email_status_fun') );
161
 
162
- add_action( 'admin_footer', array( $this, 'footer_function') );
163
-
164
- add_action( 'admin_init', array( $this, 'preview_emails' ) );
165
 
166
  // filter for shipment status
167
  add_filter("trackship_status_filter", array($this, "trackship_status_filter_func"), 10 , 1);
@@ -183,6 +151,27 @@ class WC_Advanced_Shipment_Tracking_Admin {
183
 
184
  add_filter( 'woocommerce_admin_order_actions', array( $this, 'add_delivered_order_status_actions_button'), 100, 2 );
185
  add_filter( 'woocommerce_admin_order_preview_actions', array( $this, 'additional_admin_order_preview_buttons_actions'), 5, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
  /*
@@ -607,8 +596,6 @@ class WC_Advanced_Shipment_Tracking_Admin {
607
  } else {
608
  echo '–';
609
  }
610
- //echo '<pre>';print_r($formatted);echo '</pre>';
611
- //echo '<pre>';print_r($shipment_status);echo '</pre>';
612
  }
613
  }
614
 
@@ -702,58 +689,52 @@ class WC_Advanced_Shipment_Tracking_Admin {
702
  $countries = $WC_Countries->get_countries();
703
 
704
  global $wpdb;
705
- $woo_shippment_table_name = $this->table;
706
-
707
- $order = isset( $_GET['order'] ) ? $_GET['order'] : 'ASC';
708
- $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'sort_order';
709
-
710
- if( $order == 'DESC' ){$inverse_order = 'ASC';$inverse_class = 'asc';}else{$inverse_order = 'DESC';$inverse_class = 'desc';}
711
 
712
-
713
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name ORDER BY `{$orderby}` {$order} " );
714
 
715
  foreach($default_shippment_providers as $key => $value){
716
  $search = array('(US)', '(UK)');
717
  $replace = array('', '');
718
- if($value->shipping_country){
719
  $country = str_replace($search, $replace, $WC_Countries->countries[$value->shipping_country]);
720
  $default_shippment_providers[$key]->country = $country;
 
 
 
 
 
 
 
 
721
  }
722
  }
723
-
724
- if(isset( $_GET['orderby'] ) && $_GET['orderby'] == 'shipping_country' && $_GET['order'] == 'ASC'){
725
- usort($default_shippment_providers, array( $this, 'sortByCountryAsc'));
726
- }
727
- if(isset( $_GET['orderby'] ) && $_GET['orderby'] == 'shipping_country' && $_GET['order'] == 'DESC'){
728
- usort($default_shippment_providers, array( $this, 'sortByCountryDesc'));
729
- }
730
-
731
  wp_enqueue_script( 'shipment_tracking_table_rows' );
732
  ?>
733
- <h3><?php _e('Advanced Shipment Tracking for WooCommerce', 'woo-advanced-shipment-tracking'); ?></h3>
734
  <div class="wrap woocommerce zorem_admin_layout">
735
  <div class="zorem_admin_content" >
736
 
737
- <input id="tab1" type="radio" name="tabs" class="tab_input" checked >
738
- <label for="tab1" class="tab_label"><?php _e('Shipping Provider', 'woo-advanced-shipment-tracking'); ?></label>
739
 
740
- <input id="tab2" type="radio" name="tabs" class="tab_input">
741
  <label for="tab2" class="tab_label"><?php _e('Settings', 'woo-advanced-shipment-tracking'); ?></label>
742
 
743
- <input id="tab4" type="radio" name="tabs" class="tab_input">
744
  <label for="tab4" class="tab_label"><?php _e('Bulk Upload', 'woo-advanced-shipment-tracking'); ?></label>
745
 
746
- <input id="tab5" type="radio" name="tabs" class="tab_input">
747
- <label for="tab5" class="tab_label"><?php _e('Email Notifications', 'woo-advanced-shipment-tracking'); ?></label>
748
 
749
- <input id="tab3" type="radio" name="tabs" class="tab_input">
750
- <label for="tab3" class="tab_label"><?php _e('TrackShip Integration', 'woo-advanced-shipment-tracking'); ?></label>
751
 
752
  <?php require_once( 'views/admin_options_shipping_provider.php' );?>
753
  <?php require_once( 'views/admin_options_settings.php' );?>
754
  <?php require_once( 'views/admin_options_trackship_integration.php' );?>
755
  <?php require_once( 'views/admin_options_bulk_upload.php' );?>
756
- <?php require_once( 'views/admin_options_email_notifications.php' );?>
757
  </div>
758
  <?php require_once( 'views/zorem_admin_sidebar.php' );?>
759
  </div>
@@ -772,11 +753,14 @@ class WC_Advanced_Shipment_Tracking_Admin {
772
  /*
773
  * get html of fields
774
  */
775
- private function get_html( $arrays ){
 
 
776
  ?>
777
  <table class="form-table">
778
  <tbody>
779
  <?php foreach( (array)$arrays as $id => $array ){
 
780
  if($array['show']){
781
  ?>
782
  <?php if($array['type'] == 'title'){ ?>
@@ -787,7 +771,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
787
  <tr valign="top" class="<?php echo $array['class']; ?>">
788
  <?php if($array['type'] != 'desc'){ ?>
789
  <th scope="row" class="titledesc" >
790
- <label for=""><?php echo $array['title']?>
791
  <?php if( isset($array['tooltip']) ){?>
792
  <span class="woocommerce-help-tip tipTip" title="<?php echo $array['tooltip']?>"></span>
793
  <?php } ?>
@@ -795,21 +779,34 @@ class WC_Advanced_Shipment_Tracking_Admin {
795
  </th>
796
  <?php } ?>
797
  <td class="forminp" <?php if($array['type'] == 'desc'){ ?> colspan=2 <?php } ?>>
798
- <?php if( $array['type'] == 'checkbox' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  ?>
800
  <span class="mdl-list__item-secondary-action">
801
  <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="<?php echo $id?>">
802
- <input type="checkbox" id="<?php echo $id?>" name="<?php echo $id?>" class="mdl-switch__input" <?php echo get_option($id) ? 'checked':''?> value="1"/>
803
  </label>
804
  </span>
805
  <?php } elseif( $array['type'] == 'multiple_checkbox' ){ ?>
806
  <?php foreach((array)$array['options'] as $key => $val ){
807
  $multi_checkbox_data = get_option($id);
808
  if(!$multi_checkbox_data){
 
809
  $multi_checkbox_data['show_in_completed'] = 1;
810
- $data_array = array(
811
- 'show_in_completed' => 1,
812
- );
813
  update_option( 'wc_ast_unclude_tracking_info', $data_array );
814
  }
815
  if(isset($multi_checkbox_data[$key])){
@@ -856,9 +853,10 @@ class WC_Advanced_Shipment_Tracking_Admin {
856
  <?php }
857
  elseif( $array['type'] == 'key_field' ){ ?>
858
  <fieldset>
859
- <input class="input-text regular-input " type="text" name="<?php echo $id?>" id="<?php echo $id?>" style="" value="<?php echo get_option($id)?>" placeholder="" readonly>
860
  <?php if($array['connected'] == true){ ?>
861
- <span class="api_connected"><label><?php _e( 'Connected', 'woo-advanced-shipment-tracking' ); ?></label><span class="dashicons dashicons-yes"></span></span>
 
862
  <?php } ?>
863
  </fieldset>
864
  <?php }
@@ -893,7 +891,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
893
  </td>
894
  </tr>
895
  <?php if(isset($array['desc'])){ ?>
896
- <tr class="<?php echo $array['class']; ?>"><td colspan="2" style="padding-top: 0;"><p class="description"><?php echo (isset($array['desc']))? $array['desc']: ''?></p></td></tr>
897
  <?php } ?>
898
  <?php } } ?>
899
  </tbody>
@@ -919,44 +917,34 @@ class WC_Advanced_Shipment_Tracking_Admin {
919
  $page_list = wp_list_pluck( get_pages(), 'post_title', 'ID' );
920
 
921
  $form_data = array(
922
- 'wc_ast_api_enabled' => array(
923
- 'type' => 'checkbox',
924
- 'title' => __( 'Enable/Disable', 'woo-advanced-shipment-tracking' ),
925
- 'desc' => '',
926
- 'show' => $show_trackship_field,
927
- 'class' => '',
928
- ),
929
  'wc_ast_api_key' => array(
930
  'type' => 'key_field',
931
- 'title' => __( 'API key', 'woo-advanced-shipment-tracking' ),
932
  'connected' => $connected,
933
  'show' => $show_trackship_field,
934
  'class' => '',
935
  ),
936
- /*'wc_ast_tracker_balance' => array(
937
- 'type' => 'label',
938
- 'title' => __( 'Tracker balance', 'woo-advanced-shipment-tracking' ),
939
- 'value' => $trackers_balance,
940
  'show' => $show_trackship_field,
941
- ),*/
 
942
  'wc_ast_status_change_to_delivered' => array(
943
  'type' => 'checkbox',
944
- 'title' => __( 'Set order status Delivered when order is delivered', 'woo-advanced-shipment-tracking' ),
945
- 'desc' => '',
946
  'show' => $show_trackship_field,
947
  'class' => '',
948
  ),
949
  'wc_ast_retry_trackship_apicall' => array(
950
  'type' => 'checkbox',
951
- 'title' => __( 'Retry Trackship Api call for failed orders', 'woo-advanced-shipment-tracking' ),
952
- 'desc' => '',
953
  'show' => $show_trackship_field,
954
  'class' => '',
955
  ),
956
  'wc_ast_trackship_description' => array(
957
  'type' => 'desc',
958
- 'title' => '',
959
- 'desc' => '',
960
  'show' => $show_trackship_description,
961
  'class' => '',
962
  ),
@@ -983,59 +971,34 @@ class WC_Advanced_Shipment_Tracking_Admin {
983
  $page_list = wp_list_pluck( get_pages(), 'post_title', 'ID' );
984
 
985
  $form_data = array(
986
- /*'wc_ast_tracking_page' => array(
987
- 'type' => 'title',
988
- 'title' => __( 'Tracking Page', 'woo-advanced-shipment-tracking' ),
989
- 'desc' => '',
990
- 'show' => $show_trackship_field,
991
- ),*/
992
  'wc_ast_trackship_page_id' => array(
993
  'type' => 'dropdown',
994
  'title' => __( 'Select Tracking Page', 'woo-advanced-shipment-tracking' ),
995
- 'options' => $page_list,
996
- 'desc' => '',
997
  'show' => $show_trackship_field,
998
  'class' => '',
999
  ),
1000
  'wc_ast_remove_trackship_branding' => array(
1001
  'type' => 'checkbox',
1002
- 'title' => __( 'Remove Trackship branding from tracking page', 'woo-advanced-shipment-tracking' ),
1003
- 'desc' => '',
1004
  'show' => $show_trackship_field,
1005
  'class' => '',
1006
  ),
1007
  'wc_ast_use_tracking_page' => array(
1008
  'type' => 'checkbox',
1009
- 'title' => __( 'Use the tracking page in the customer email/my account tracking link', 'woo-advanced-shipment-tracking' ),
1010
- 'desc' => '',
1011
  'show' => $show_trackship_field,
1012
  'class' => '',
1013
  ),
1014
  'wc_ast_select_primary_color' => array(
1015
  'type' => 'color',
1016
- 'title' => __( 'Select primary color for tracking page', 'woo-advanced-shipment-tracking' ),
1017
- 'desc' => '',
1018
  'class' => 'color_field',
1019
  'show' => $show_trackship_field,
1020
- ),
1021
- 'wc_ast_select_success_color' => array(
1022
- 'type' => 'color',
1023
- 'title' => __( 'Select success color for tracking page', 'woo-advanced-shipment-tracking' ),
1024
- 'desc' => '',
1025
- 'class' => 'color_field',
1026
- 'show' => $show_trackship_field,
1027
- ),
1028
- 'wc_ast_select_warning_color' => array(
1029
- 'type' => 'color',
1030
- 'title' => __( 'Select warning color for tracking page', 'woo-advanced-shipment-tracking' ),
1031
- 'desc' => '',
1032
- 'class' => 'color_field',
1033
- 'show' => $show_trackship_field,
1034
- ),
1035
  'wc_ast_select_border_color' => array(
1036
  'type' => 'color',
1037
- 'title' => __( 'Select content border color for tracking page', 'woo-advanced-shipment-tracking' ),
1038
- 'desc' => '',
1039
  'class' => 'color_field',
1040
  'show' => $show_trackship_field,
1041
  ),
@@ -1098,43 +1061,10 @@ class WC_Advanced_Shipment_Tracking_Admin {
1098
  $form_data = array(
1099
  'wc_ast_status_shipped' => array(
1100
  'type' => 'checkbox',
1101
- 'title' => __( 'Rename the “Completed” Order status to “Shipped”', 'woo-advanced-shipment-tracking' ),
1102
- 'desc' => '',
1103
  'show' => true,
1104
  'class' => '',
1105
  ),
1106
- 'wc_ast_change_completed_shipped' => array(
1107
- 'type' => 'checkbox',
1108
- 'title' => __( 'Rename the “Completed Order” to “Shipped Order” in email settings', 'woo-advanced-shipment-tracking' ),
1109
- 'desc' => '',
1110
- 'show' => true,
1111
- 'class' => '',
1112
- ),
1113
- 'wc_ast_status_delivered' => array(
1114
- 'type' => 'checkbox',
1115
- 'title' => __( 'Enable a New Custom order status - “Delivered”', 'woo-advanced-shipment-tracking' ),
1116
- 'tooltip' => __( 'if you enable the delivered item, you will have the option to send delivered email notifications.', 'woo-advanced-shipment-tracking' ),
1117
- 'show' => true,
1118
- 'class' => '',
1119
- ),
1120
- 'wc_ast_status_label_color' => array(
1121
- 'type' => 'color',
1122
- 'title' => __( 'Delivered Status Label color', 'woo-advanced-shipment-tracking' ),
1123
- 'desc' => '',
1124
- 'class' => 'status_label_color_th',
1125
- 'show' => true,
1126
- ),
1127
- 'wc_ast_deactivate_delivered' => array(
1128
- 'type' => 'dropdown',
1129
- 'title' => __( 'Change the "Delivered" orders to "Completed" when you deactivate the plugin', 'woo-advanced-shipment-tracking' ),
1130
- 'options' => array(
1131
- "yes" =>__( 'Yes, change all Delivered orders to Completed', 'woo-advanced-shipment-tracking' ),
1132
- "no" =>__( 'No, I will use the snippet', 'woo-advanced-shipment-tracking' ),
1133
- ),
1134
- 'desc' => sprintf(__('PLEASE NOTE - If you use the custom order status "Delivered", when you deactivate the plugin, you must register this order status in function.php in order to see these orders in the orders admin. You can find the snippet to use in functions.php %s or we can set to change all your "delivered" order to "completed".', 'woo-advanced-shipment-tracking'), '<a href="https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/code-snippets/#delivered_code" target="blank">here</a>'),
1135
- 'show' => true,
1136
- 'class' => 'status_label_color_th',
1137
- ),
1138
  'wc_ast_unclude_tracking_info' => array(
1139
  'type' => 'multiple_checkbox',
1140
  'title' => __( 'On which customer order status email to include tracking info?', 'woo-advanced-shipment-tracking' ),'options' => array(
@@ -1165,307 +1095,91 @@ class WC_Advanced_Shipment_Tracking_Admin {
1165
  );
1166
  return $form_data;
1167
 
1168
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1169
 
1170
  /*
1171
  * settings form save
1172
  */
1173
- function wc_ast_settings_form_update_callback(){
1174
-
1175
-
1176
-
1177
  if ( ! empty( $_POST ) && check_admin_referer( 'wc_ast_settings_form', 'wc_ast_settings_form' ) ) {
1178
 
1179
  $data = $this->get_settings_data();
1180
 
1181
- foreach( $data as $key => $val ){
1182
- //echo '<pre>';print_r($key);echo '</pre>';
1183
- update_option( $key, $_POST[ $key ] );
1184
- }exit;
1185
- echo json_encode( array('success' => 'true') );die();
1186
-
1187
- }
1188
- }
1189
-
1190
- /*
1191
- * Update shipment provider sort order
1192
- */
1193
- function update_sort_order_fun(){
1194
-
1195
- global $wpdb;
1196
-
1197
- if( isset( $_POST['sorting'] ) ){
1198
-
1199
- foreach($_POST['sorting'] as $key => $val ){
1200
- $data_array = array(
1201
- 'sort_order' => sanitize_text_field($val['sort_order']),
1202
- );
1203
- $where_array = array(
1204
- 'id' => $key
1205
- );
1206
-
1207
- $result = $wpdb->update( $this->table, $data_array, $where_array );
1208
-
1209
  }
1210
 
1211
- }
1212
- echo $result;exit;
1213
- }
1214
- /*
1215
- * Update shipment provider status
1216
- */
1217
- function update_shipment_status_fun(){
1218
- global $wpdb;
1219
- $woo_shippment_table_name = $this->table;
1220
-
1221
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name" );
1222
- foreach($default_shippment_providers as $dsp){
1223
- if(in_array($dsp->id, $_POST['select_custom_provider'])){
1224
- $success = $wpdb->update($woo_shippment_table_name,
1225
- array(
1226
- "display_in_order" => 1,
1227
- ),
1228
- array('id' => $dsp->id)
1229
- );
1230
- } else{
1231
- $success = $wpdb->update($woo_shippment_table_name,
1232
- array(
1233
- "display_in_order" => 0,
1234
- ),
1235
- array('id' => $dsp->id)
1236
- );
1237
- }
1238
-
1239
- }
1240
- }
1241
-
1242
- /*
1243
- * insert provider by ajax
1244
- */
1245
- public function woocommerce_shipping_provider_add(){
1246
- global $wpdb;
1247
- $data = array(
1248
- 'provider_name' => '',
1249
- 'provider_url' => '',
1250
- 'shipping_country' => '',
1251
- 'shipping_default' => '0',
1252
- 'display_in_order' => '0'
1253
- );
1254
- $wpdb->insert( $this->table, $data );
1255
- echo json_encode(
1256
- array(
1257
- "status" => 'success',
1258
- 'id' => $wpdb->insert_id
1259
- )
1260
- );
1261
- die();
1262
- }
1263
-
1264
- /*
1265
- * delet provide by ajax
1266
- */
1267
- public function woocommerce_shipping_provider_delete(){
1268
-
1269
- $provider_id = $_POST['provider_id'];
1270
- if ( ! empty( $provider_id ) ) {
1271
- global $wpdb;
1272
- $where = array(
1273
- 'id' => $provider_id,
1274
- 'shipping_default' => 0
1275
- );
1276
- $wpdb->delete( $this->table, $where );
1277
- }
1278
- die();
1279
- }
1280
-
1281
- function add_custom_shipment_provider_fun(){
1282
- global $order;
1283
- $WC_Countries = new WC_Countries();
1284
- $countries = $WC_Countries->get_countries();
1285
- global $wpdb;
1286
-
1287
- $woo_shippment_table_name = $this->table;
1288
-
1289
- if( isset( $_POST['data'] ) ){
1290
 
1291
- foreach($_POST['data'] as $key => $val ){
1292
-
1293
- $attachment = attachment_url_to_postid($val['thumb_url']);
1294
- $data_array = array(
1295
- 'shipping_country' => sanitize_text_field($val['shipping_country']),
1296
- 'provider_name' => sanitize_text_field($val['provider_name']),
1297
- 'provider_url' => sanitize_text_field($val['provider_url']),
1298
- 'custom_thumb_id' => sanitize_text_field($val['thumb_id']),
1299
- 'sort_order' => sanitize_text_field($val['sort_order']),
1300
- 'display_in_order' => 1,
1301
- );
1302
- $where_array = array(
1303
- 'id' => $key,
1304
- 'shipping_default' => '0'
1305
- );
1306
- $result = $wpdb->update( $this->table, $data_array, $where_array );
1307
-
1308
  }
 
 
1309
  }
1310
- $html = $this->get_table_body();
1311
- echo $html;exit;
1312
- }
1313
 
1314
- function update_shipping_provider_fun(){
1315
- global $order;
1316
- $WC_Countries = new WC_Countries();
1317
- $countries = $WC_Countries->get_countries();
1318
- global $wpdb;
1319
-
1320
- $data_array = array(
1321
- 'shipping_country' => sanitize_text_field($_POST['custom_provider_country']),
1322
- 'provider_name' => sanitize_text_field($_POST['custom_provider_name']),
1323
- 'custom_thumb_id' => sanitize_text_field($_POST['image_id']),
1324
- 'provider_url' => esc_url($_POST['custom_provider_url']),
1325
- 'sort_order' => sanitize_text_field($_POST['sort_order']),
1326
- );
1327
- $where_array = array(
1328
- 'id' => $_POST['provider_id'],
1329
- 'shipping_default' => '0'
1330
- );
1331
- $wpdb->update( $this->table, $data_array, $where_array );
1332
- $html = $this->get_table_body();
1333
- echo $html;exit;
1334
- }
1335
 
1336
- function get_table_body(){
1337
- global $order;
1338
- $WC_Countries = new WC_Countries();
1339
- $countries = $WC_Countries->get_countries();
1340
-
1341
- global $wpdb;
1342
- $woo_shippment_table_name = $this->table;
1343
- $order = isset( $_GET['order'] ) ? $_GET['order'] : 'ASC';
1344
- $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'sort_order';
1345
-
1346
- if( $order == 'DESC' ){$inverse_order = 'ASC';$inverse_class = 'asc';}else{$inverse_order = 'DESC';$inverse_class = 'desc';}
1347
-
1348
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name ORDER BY `{$orderby}` {$order} " );
1349
-
1350
- ?>
1351
- <tbody>
1352
- <?php foreach($default_shippment_providers as $d_s_p){ ?>
1353
- <?php
1354
- if( $d_s_p->shipping_country == '' && $d_s_p->provider_name == '' && $d_s_p->provider_url == '' ){
1355
- $wpdb->delete( $this->table, array( 'id' => $d_s_p->id ) );
1356
- continue;
1357
- }
1358
- ?>
1359
- <tr class="provider_tr <?php if($d_s_p->display_in_order != 1) { echo 'status_deactivate'; } ?> <?php if($d_s_p->shipping_default == 0) { echo 'custom_provider_tr'; } ?>">
1360
- <td class="column-columnname thumb-column on_edit_hide">
1361
- <?php if( $d_s_p->shipping_default == 1 ){ ?>
1362
- <img class="provider_thumbnail" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/<?php echo sanitize_title($d_s_p->provider_name);?>.png?v=<?php echo wc_advanced_shipment_tracking()->version;?>">
1363
- <?php } else{
1364
- $custom_thumb_id = $d_s_p->custom_thumb_id;
1365
- $image_attributes = wp_get_attachment_image_src( $custom_thumb_id , array('60','60') );
1366
- //echo '<pre>';print_r($custom_thumb_id);echo '</pre>';exit;
1367
- if($custom_thumb_id != 0){ ?>
1368
- <img class="provider_thumbnail" src="<?php echo $image_attributes[0]; ?>">
1369
- <?php } else{
1370
- ?>
1371
- <img class="provider_thumbnail" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/icon-default.png">
1372
- <?php } ?>
1373
- <?php } ?>
1374
- <span class="provider_name">
1375
- <?php echo $d_s_p->provider_name; ?>
1376
- </span>
1377
- </td>
1378
- <td class="column-columnname country_select_box on_edit_hide">
1379
- <span class="on_edit_hide">
1380
- <?php
1381
- $search = array('(US)', '(UK)');
1382
- $replace = array('', '');
1383
- echo str_replace($search, $replace, $WC_Countries->countries[$d_s_p->shipping_country]);
1384
- ?>
1385
- </span>
1386
- </td>
1387
- <td class="column-columnname url-column on_edit_hide">
1388
- <?php if ($d_s_p->provider_name == 'PostNL'){?>
1389
- <a href="https://jouw.postnl.nl/#!/overzicht" title="https://jouw.postnl.nl/#!/overzicht" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
1390
- </a>
1391
- <?php }else { ?>
1392
- <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
1393
- </a>
1394
- <?php } ?>
1395
- </td>
1396
- <td class="column-columnname status-column on_edit_hide">
1397
- <span class="mdl-list__item-secondary-action">
1398
- <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="list-switch-<?php echo $d_s_p->id; ?>">
1399
- <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'; } ?> />
1400
- </label>
1401
- </span>
1402
- </td>
1403
- <td class="column-columnname on_edit_hide td-action">
1404
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
1405
- <span class="dashicons dashicons-edit edit_provider" style="display:none"></span>
1406
- <span class="dashicons dashicons-trash remove" data-pid="<?php echo $d_s_p->id; ?>" style="display:none"></span>
1407
- <?php } ?>
1408
- <span class="dashicons dashicons-editor-justify sort-item ui-sortable-handle"></span>
1409
- <?php
1410
- $custom_thumb_id = $d_s_p->custom_thumb_id;
1411
- $image_attributes = wp_get_attachment_image_src( $custom_thumb_id );
1412
- ?>
1413
- <input type="hidden" name="data[<?php echo $d_s_p->id?>][thumb_url]" class="image_path" value="<?php echo $image_attributes[0]; ?>">
1414
- </td>
1415
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
1416
- <td class="on_edit_show" colspan="5">
1417
- <input type="text" class="text custom_provider_name" name="data[<?php echo $d_s_p->id?>][provider_name]" value="<?php echo $d_s_p->provider_name;?>" placeholder="<?php _e( 'Shipping Provider', 'woo-advanced-shipment-tracking' ); ?>"><br>
1418
-
1419
- <select class="select custom_provider_country" name="data[<?php echo $d_s_p->id?>][shipping_country]" >
1420
- <option value="" ><?php _e( 'None', 'woo-advanced-shipment-tracking' ); ?></option>
1421
- <?php foreach($countries as $key=>$val){ ?>
1422
- <option value="<?php echo $key; ?>" <?php if ( $key == $d_s_p->shipping_country ) echo 'selected'?>><?php _e( $val, 'woo-advanced-shipment-tracking'); ?></option>
1423
- <?php } ?>
1424
- </select><br>
1425
-
1426
- <input type='hidden' name='data[<?php echo $d_s_p->id?>][thumb_id]' class='image_id' placeholder="Image" value='<?php echo $custom_thumb_id; ?>' id='image_id' style="">
1427
- <input type='text' name='data[<?php echo $d_s_p->id?>][thumb_url]' class='image_path' placeholder="Image" value='<?php echo $image_attributes[0]; ?>' id='image_path' style="">
1428
- <input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload' , 'woo-advanced-shipment-tracking'); ?>" /><br>
1429
 
1430
- <input type="text" class="text 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' ); ?>">
1431
- <p><?php _e('You can add tracking number parameter like this - http://shippingprovider.com?tracking_number=%number% , %number% - parameter', 'woo-advanced-shipment-tracking'); ?></p>
1432
-
1433
- <input type="hidden" name="provider_id" class="provider_id" value="<?php echo $d_s_p->id?>">
1434
- <input type="hidden" name="sorting[<?php echo $d_s_p->id?>][sort_order]" class="sort_order" value="<?php echo $d_s_p->sort_order?>">
1435
- <input type="hidden" name="data[<?php echo $d_s_p->id?>][sort_order]" class="" value="<?php echo $d_s_p->sort_order?>"><br>
1436
- <button class="button button-primary update_provider btn_green"><?php _e( 'Update', 'woo-advanced-shipment-tracking' ); ?></button>
1437
- <a href="JavaScript:Void(0);" class="cancel_edit"><?php _e( 'Cancel' , 'woo-advanced-shipment-tracking'); ?></a>
1438
- </td>
1439
- <?php } ?>
1440
- </tr>
1441
- <?php } ?>
1442
- </tbody>
1443
- <?php
1444
- }
1445
- function update_shipping_provider_dropdown_fun(){
1446
- global $wpdb;
1447
- $woo_shippment_table_name = $this->table;
1448
- $order = isset( $_GET['order'] ) ? $_GET['order'] : 'ASC';
1449
- $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'sort_order';
1450
-
1451
- if( $order == 'DESC' ){$inverse_order = 'ASC';$inverse_class = 'asc';}else{$inverse_order = 'DESC';$inverse_class = 'desc';}
1452
-
1453
- $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name ORDER BY `{$orderby}` {$order} " ); ?>
1454
- <select name="wc_ast_default_provider" class="wc_ast_default_provider">
1455
- <option><?php _e('Please select default provider', 'woo-advanced-shipment-tracking'); ?></option>
1456
- <?php foreach( $default_shippment_providers as $d_s_p ){?>
1457
- <?php if($d_s_p->display_in_order != 1)continue;?>
1458
- <option value="<?php echo sanitize_title( $d_s_p->provider_name )?>" <?php if( $default_provider == sanitize_title( $d_s_p->provider_name ) )echo 'selected';?>><?php echo $d_s_p->provider_name?></option>
1459
- <?php } ?>
1460
- </select>
1461
- <?php
1462
- exit;
1463
- }
1464
-
1465
- function update_default_provider_fun(){
1466
- update_option("wc_ast_default_provider", $_POST['default_provider'] );
1467
- exit;
1468
- }
1469
 
1470
  function footer_function(){
1471
  $color = get_option('wc_ast_status_label_color');
@@ -1476,34 +1190,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1476
  }
1477
  </style>
1478
  <?php
1479
- }
1480
-
1481
- /**
1482
- * Preview email template.
1483
- */
1484
- public function preview_emails() {
1485
-
1486
- if ( isset( $_GET['preview_tracking_info_design'] ) ) {
1487
- if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'preview-mail' ) ) {
1488
- die( 'Security check' );
1489
- }
1490
- $mailer = WC()->mailer();
1491
-
1492
- // get the preview email subject
1493
- $email_heading = __( 'HTML email template', 'woocommerce' );
1494
- ob_start();
1495
- include 'views/html-tracking-info-design-preview.php';
1496
- $message = ob_get_clean();
1497
- // create a new email
1498
- $email = new WC_Email();
1499
-
1500
- // wrap the content with the email template and then add styles
1501
- $message = apply_filters( 'woocommerce_mail_content', $email->style_inline( $mailer->wrap_message( $email_heading, $message ) ) );
1502
-
1503
- echo $message;
1504
- exit;
1505
- }
1506
- }
1507
 
1508
  function upload_tracking_csv_fun(){
1509
 
@@ -1779,31 +1466,31 @@ class WC_Advanced_Shipment_Tracking_Admin {
1779
  function trackship_status_icon_filter_func( $html, $status ){
1780
  switch ($status) {
1781
  case "in_transit":
1782
- $html = '<i class="fa fa-chevron-circle-right icon-'.$status.'" aria-hidden="true"></i>';
1783
  break;
1784
  case "pre_transit":
1785
- $html = '<i class="fa fa-check-circle icon-'.$status.'" aria-hidden="true"></i>';
1786
  break;
1787
  case "delivered":
1788
- $html = '<i class="fa fa-check-circle icon-'.$status.'" aria-hidden="true"></i>';
1789
  break;
1790
  case "out_for_delivery":
1791
- $html = '<i class="fa fa fa-clock-o icon-'.$status.'" aria-hidden="true"></i>';
1792
  break;
1793
  case "available_for_pickup":
1794
- $html = '<i class="fa fa-check-circle icon-'.$status.'" aria-hidden="true"></i>';
1795
  break;
1796
  case "return_to_sender":
1797
- $html = '<i class="fa fa-exclamation-circle icon-'.$status.'" aria-hidden="true"></i>';
1798
  break;
1799
  case "failure":
1800
- $html = '<i class="fa fa-exclamation-circle icon-'.$status.'" aria-hidden="true"></i>';
1801
  break;
1802
  case "unknown":
1803
- $html = '<i class="fa fa-question-circle icon-'.$status.'" aria-hidden="true"></i>';
1804
  break;
1805
  case "pending_trackship":
1806
- $html = '<i class="fa fa-question-circle icon-'.$status.'" aria-hidden="true"></i>';
1807
  break;
1808
  case "INVALID_TRACKING_NUM":
1809
  $html = '<i class="fa fa-question-circle icon-'.$status.'" aria-hidden="true"></i>';
@@ -1881,9 +1568,7 @@ class WC_Advanced_Shipment_Tracking_Admin {
1881
  require_once( 'email-manager.php' );
1882
  $old_status = 'in_transit';
1883
  $new_status = 'pre_transit';
1884
- $order_id = $order->get_id();
1885
- //wc_advanced_shipment_tracking_email_class()->shippment_status_email_trigger($order->ID, $order, $old_status, $new_status);
1886
- //wc_advanced_shipment_tracking_email_class()->delivered_order_status_email_trigger($order->ID, $order);
1887
  WC()->mailer()->emails['WC_Email_Customer_Delivered_Order']->trigger( $order_id, $order );
1888
  }
1889
  /*
@@ -1924,9 +1609,9 @@ class WC_Advanced_Shipment_Tracking_Admin {
1924
  * Change completed order email title to Shipped Order
1925
  */
1926
  public function change_completed_woocommerce_email_title($email_title, $email){
1927
- $wc_ast_change_completed_shipped = get_option('wc_ast_change_completed_shipped');
1928
  // Only on backend Woocommerce Settings "Emails" tab
1929
- if($wc_ast_change_completed_shipped == 1){
1930
  if( isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'email' ) {
1931
  switch ($email->id) {
1932
  case 'customer_completed_order':
@@ -1985,4 +1670,375 @@ class WC_Advanced_Shipment_Tracking_Admin {
1985
  }
1986
  return $actions;
1987
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1988
  }
122
 
123
  add_filter( 'woocommerce_email_title', array( $this, 'change_completed_woocommerce_email_title'), 10, 2 );
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  add_action( 'wp_ajax_wc_ast_upload_csv_form_update', array( $this, 'upload_tracking_csv_fun') );
 
 
 
 
 
 
 
127
 
128
  add_action( 'wp_ajax_update_delivered_order_email_status', array( $this, 'update_delivered_order_email_status_fun') );
129
 
130
  add_action( 'wp_ajax_update_shipment_status_email_status', array( $this, 'update_shipment_status_email_status_fun') );
131
 
132
+ add_action( 'admin_footer', array( $this, 'footer_function') );
 
 
133
 
134
  // filter for shipment status
135
  add_filter("trackship_status_filter", array($this, "trackship_status_filter_func"), 10 , 1);
151
 
152
  add_filter( 'woocommerce_admin_order_actions', array( $this, 'add_delivered_order_status_actions_button'), 100, 2 );
153
  add_filter( 'woocommerce_admin_order_preview_actions', array( $this, 'additional_admin_order_preview_buttons_actions'), 5, 2 );
154
+
155
+ //Shipping Provider Action
156
+ add_action( 'wp_ajax_filter_shipiing_provider_by_status', array( $this, 'filter_shipiing_provider_by_status_fun') );
157
+
158
+ add_action( 'wp_ajax_add_custom_shipment_provider', array( $this, 'add_custom_shipment_provider_fun') );
159
+
160
+ add_action( 'wp_ajax_get_provider_details', array( $this, 'get_provider_details_fun') );
161
+
162
+ add_action( 'wp_ajax_update_custom_shipment_provider', array( $this, 'update_custom_shipment_provider_fun') );
163
+
164
+ add_action( 'wp_ajax_woocommerce_shipping_provider_delete', array( $this, 'woocommerce_shipping_provider_delete' ) );
165
+
166
+ add_action( 'wp_ajax_update_provider_status_active', array( $this, 'update_provider_status_active_fun') );
167
+
168
+ add_action( 'wp_ajax_update_provider_status_inactive', array( $this, 'update_provider_status_inactive_fun') );
169
+
170
+ add_action( 'wp_ajax_update_default_provider', array( $this, 'update_default_provider_fun') );
171
+
172
+ add_action( 'wp_ajax_update_shipment_status', array( $this, 'update_shipment_status_fun') );
173
+
174
+ add_action( 'wp_ajax_sync_providers', array( $this, 'sync_providers_fun') );
175
  }
176
 
177
  /*
596
  } else {
597
  echo '–';
598
  }
 
 
599
  }
600
  }
601
 
689
  $countries = $WC_Countries->get_countries();
690
 
691
  global $wpdb;
692
+ $woo_shippment_table_name = $this->table;
 
 
 
 
 
693
 
694
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name WHERE display_in_order = 1" );
 
695
 
696
  foreach($default_shippment_providers as $key => $value){
697
  $search = array('(US)', '(UK)');
698
  $replace = array('', '');
699
+ if($value->shipping_country && $value->shipping_country != 'Global'){
700
  $country = str_replace($search, $replace, $WC_Countries->countries[$value->shipping_country]);
701
  $default_shippment_providers[$key]->country = $country;
702
+ } elseif($value->shipping_country && $value->shipping_country == 'Global'){
703
+ $default_shippment_providers[$key]->country = 'Global';
704
+ }
705
+ }
706
+ $checked = '';
707
+ if(isset($_GET['tab'])){
708
+ if($_GET['tab'] == 'settings'){
709
+
710
  }
711
  }
 
 
 
 
 
 
 
 
712
  wp_enqueue_script( 'shipment_tracking_table_rows' );
713
  ?>
714
+ <h1 class="plugin-title"><?php _e('Advanced Shipment Tracking', 'woo-advanced-shipment-tracking'); ?></h1>
715
  <div class="wrap woocommerce zorem_admin_layout">
716
  <div class="zorem_admin_content" >
717
 
718
+ <input id="tab1" type="radio" name="tabs" class="tab_input" <?php if(!isset($_GET['tab'])){ echo 'checked'; } ?> >
719
+ <label for="tab1" class="tab_label"><?php _e('Shipping Providers', 'woo-advanced-shipment-tracking'); ?></label>
720
 
721
+ <input id="tab2" type="radio" name="tabs" class="tab_input" <?php if(isset($_GET['tab']) && ($_GET['tab'] == 'settings' || $_GET['tab'] == 'delivered-order-status')){ echo 'checked'; } ?>>
722
  <label for="tab2" class="tab_label"><?php _e('Settings', 'woo-advanced-shipment-tracking'); ?></label>
723
 
724
+ <input id="tab4" type="radio" name="tabs" class="tab_input" <?php if(isset($_GET['tab']) && $_GET['tab'] == 'bulk-upload'){ echo 'checked'; } ?>>
725
  <label for="tab4" class="tab_label"><?php _e('Bulk Upload', 'woo-advanced-shipment-tracking'); ?></label>
726
 
727
+ <!--input id="tab5" type="radio" name="tabs" class="tab_input">
728
+ <label for="tab5" class="tab_label"><?php _e('Email Notifications', 'woo-advanced-shipment-tracking'); ?></label-->
729
 
730
+ <input id="tab3" type="radio" name="tabs" class="tab_input" <?php if(isset($_GET['tab']) && ($_GET['tab'] == 'trackship' || $_GET['tab'] == 'tracking-page' || $_GET['tab'] == 'shipment-status-notifications')){ echo 'checked'; } ?>>
731
+ <label for="tab3" class="tab_label"><?php _e('TrackShip', 'woo-advanced-shipment-tracking'); ?></label>
732
 
733
  <?php require_once( 'views/admin_options_shipping_provider.php' );?>
734
  <?php require_once( 'views/admin_options_settings.php' );?>
735
  <?php require_once( 'views/admin_options_trackship_integration.php' );?>
736
  <?php require_once( 'views/admin_options_bulk_upload.php' );?>
737
+ <?php //require_once( 'views/admin_options_email_notifications.php' );?>
738
  </div>
739
  <?php require_once( 'views/zorem_admin_sidebar.php' );?>
740
  </div>
753
  /*
754
  * get html of fields
755
  */
756
+ private function get_html( $arrays ){
757
+ //delete_option('wc_ast_unclude_tracking_info');
758
+ $checked = '';
759
  ?>
760
  <table class="form-table">
761
  <tbody>
762
  <?php foreach( (array)$arrays as $id => $array ){
763
+
764
  if($array['show']){
765
  ?>
766
  <?php if($array['type'] == 'title'){ ?>
771
  <tr valign="top" class="<?php echo $array['class']; ?>">
772
  <?php if($array['type'] != 'desc'){ ?>
773
  <th scope="row" class="titledesc" >
774
+ <label for=""><?php echo $array['title']?><?php if(isset($array['title_link'])){ echo $array['title_link']; } ?>
775
  <?php if( isset($array['tooltip']) ){?>
776
  <span class="woocommerce-help-tip tipTip" title="<?php echo $array['tooltip']?>"></span>
777
  <?php } ?>
779
  </th>
780
  <?php } ?>
781
  <td class="forminp" <?php if($array['type'] == 'desc'){ ?> colspan=2 <?php } ?>>
782
+ <?php if( $array['type'] == 'checkbox' ){
783
+ if($id === 'wcast_enable_delivered_email'){
784
+ $wcast_enable_delivered_email = get_option('woocommerce_customer_delivered_order_settings');
785
+ if($wcast_enable_delivered_email['enabled'] === 'yes'){
786
+ $checked = 'checked';
787
+ } else{
788
+ $checked = '';
789
+ }
790
+ } else{
791
+ if(get_option($id)){
792
+ $checked = 'checked';
793
+ } else{
794
+ $checked = '';
795
+ }
796
+ }
797
  ?>
798
  <span class="mdl-list__item-secondary-action">
799
  <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="<?php echo $id?>">
800
+ <input type="checkbox" id="<?php echo $id?>" name="<?php echo $id?>" class="mdl-switch__input" <?php echo $checked ?> value="1"/>
801
  </label>
802
  </span>
803
  <?php } elseif( $array['type'] == 'multiple_checkbox' ){ ?>
804
  <?php foreach((array)$array['options'] as $key => $val ){
805
  $multi_checkbox_data = get_option($id);
806
  if(!$multi_checkbox_data){
807
+ $multi_checkbox_data = array();
808
  $multi_checkbox_data['show_in_completed'] = 1;
809
+ $data_array = array('show_in_completed' => 1);
 
 
810
  update_option( 'wc_ast_unclude_tracking_info', $data_array );
811
  }
812
  if(isset($multi_checkbox_data[$key])){
853
  <?php }
854
  elseif( $array['type'] == 'key_field' ){ ?>
855
  <fieldset>
856
+ <!--input class="input-text regular-input " type="text" name="<?php echo $id?>" id="<?php echo $id?>" style="" value="<?php echo get_option($id)?>" placeholder="" readonly-->
857
  <?php if($array['connected'] == true){ ?>
858
+ <a href="https://my.trackship.info/" target="_blank">
859
+ <span class="api_connected"><label><?php _e( 'Connected', 'woo-advanced-shipment-tracking' ); ?></label><span class="dashicons dashicons-yes"></span></span></a>
860
  <?php } ?>
861
  </fieldset>
862
  <?php }
891
  </td>
892
  </tr>
893
  <?php if(isset($array['desc'])){ ?>
894
+ <tr class="<?php echo $array['class']; ?>"><td colspan="2" style=""><p class="description"><?php echo (isset($array['desc']))? $array['desc']: ''?></p></td></tr>
895
  <?php } ?>
896
  <?php } } ?>
897
  </tbody>
917
  $page_list = wp_list_pluck( get_pages(), 'post_title', 'ID' );
918
 
919
  $form_data = array(
 
 
 
 
 
 
 
920
  'wc_ast_api_key' => array(
921
  'type' => 'key_field',
922
+ 'title' => __( 'TrackShip Connection Status', 'woo-advanced-shipment-tracking' ),
923
  'connected' => $connected,
924
  'show' => $show_trackship_field,
925
  'class' => '',
926
  ),
927
+ 'wc_ast_api_enabled' => array(
928
+ 'type' => 'checkbox',
929
+ 'title' => __( 'Enable/Disable', 'woo-advanced-shipment-tracking' ),
 
930
  'show' => $show_trackship_field,
931
+ 'class' => '',
932
+ ),
933
  'wc_ast_status_change_to_delivered' => array(
934
  'type' => 'checkbox',
935
+ 'title' => __( 'Set order status Delivered when order is delivered', 'woo-advanced-shipment-tracking' ),
 
936
  'show' => $show_trackship_field,
937
  'class' => '',
938
  ),
939
  'wc_ast_retry_trackship_apicall' => array(
940
  'type' => 'checkbox',
941
+ 'title' => __( 'Retry Trackship Api call for failed orders', 'woo-advanced-shipment-tracking' ),
 
942
  'show' => $show_trackship_field,
943
  'class' => '',
944
  ),
945
  'wc_ast_trackship_description' => array(
946
  'type' => 'desc',
947
+ 'title' => '',
 
948
  'show' => $show_trackship_description,
949
  'class' => '',
950
  ),
971
  $page_list = wp_list_pluck( get_pages(), 'post_title', 'ID' );
972
 
973
  $form_data = array(
 
 
 
 
 
 
974
  'wc_ast_trackship_page_id' => array(
975
  'type' => 'dropdown',
976
  'title' => __( 'Select Tracking Page', 'woo-advanced-shipment-tracking' ),
977
+ 'options' => $page_list,
 
978
  'show' => $show_trackship_field,
979
  'class' => '',
980
  ),
981
  'wc_ast_remove_trackship_branding' => array(
982
  'type' => 'checkbox',
983
+ 'title' => __( 'Remove Trackship branding from tracking page', 'woo-advanced-shipment-tracking' ),
 
984
  'show' => $show_trackship_field,
985
  'class' => '',
986
  ),
987
  'wc_ast_use_tracking_page' => array(
988
  'type' => 'checkbox',
989
+ 'title' => __( 'Use the tracking page in the customer email/my account tracking link', 'woo-advanced-shipment-tracking' ),
 
990
  'show' => $show_trackship_field,
991
  'class' => '',
992
  ),
993
  'wc_ast_select_primary_color' => array(
994
  'type' => 'color',
995
+ 'title' => __( 'Select primary color for tracking page', 'woo-advanced-shipment-tracking' ),
 
996
  'class' => 'color_field',
997
  'show' => $show_trackship_field,
998
+ ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
999
  'wc_ast_select_border_color' => array(
1000
  'type' => 'color',
1001
+ 'title' => __( 'Select content border color for tracking page', 'woo-advanced-shipment-tracking' ),
 
1002
  'class' => 'color_field',
1003
  'show' => $show_trackship_field,
1004
  ),
1061
  $form_data = array(
1062
  'wc_ast_status_shipped' => array(
1063
  'type' => 'checkbox',
1064
+ 'title' => __( 'Rename the “Completed” Order status to “Shipped”', 'woo-advanced-shipment-tracking' ),
 
1065
  'show' => true,
1066
  'class' => '',
1067
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1068
  'wc_ast_unclude_tracking_info' => array(
1069
  'type' => 'multiple_checkbox',
1070
  'title' => __( 'On which customer order status email to include tracking info?', 'woo-advanced-shipment-tracking' ),'options' => array(
1095
  );
1096
  return $form_data;
1097
 
1098
+ }
1099
+
1100
+ /*
1101
+ * get settings tab array data
1102
+ * return array
1103
+ */
1104
+ function get_delivered_data(){
1105
+ $form_data = array(
1106
+ 'wc_ast_status_delivered' => array(
1107
+ 'type' => 'checkbox',
1108
+ 'title' => __( 'Enable a New Custom order status - “Delivered”', 'woo-advanced-shipment-tracking' ),
1109
+ 'tooltip' => __( 'if you enable the delivered item, you will have the option to send delivered email notifications.', 'woo-advanced-shipment-tracking' ),
1110
+ 'show' => true,
1111
+ 'class' => '',
1112
+ ),
1113
+ 'wc_ast_status_label_color' => array(
1114
+ 'type' => 'color',
1115
+ 'title' => __( 'Delivered Status Label color', 'woo-advanced-shipment-tracking' ),
1116
+ 'class' => 'status_label_color_th',
1117
+ 'show' => true,
1118
+ ),
1119
+ 'wcast_enable_delivered_email' => array(
1120
+ 'type' => 'checkbox',
1121
+ 'title' => __( 'Delivered order status email', 'woo-advanced-shipment-tracking' ),
1122
+ 'title_link'=> "<a class='settings_edit' href='".wcast_initialise_customizer_email::get_customizer_url('customer_delivered_email')."'>".__( 'Edit', 'woo-advanced-shipment-tracking' )."</a>",
1123
+ 'class' => 'status_label_color_th',
1124
+ 'show' => true,
1125
+ ),
1126
+ 'wc_ast_deactivate_delivered' => array(
1127
+ 'type' => 'dropdown',
1128
+ 'title' => __( 'Change the "Delivered" orders to "Completed" when you deactivate the plugin', 'woo-advanced-shipment-tracking' ),
1129
+ 'options' => array(
1130
+ "yes" =>__( 'Yes, change all Delivered orders to Completed', 'woo-advanced-shipment-tracking' ),
1131
+ "no" =>__( 'No, I will use the snippet', 'woo-advanced-shipment-tracking' ),
1132
+ ),
1133
+ 'desc' => sprintf(__('PLEASE NOTE - If you use the custom order status "Delivered", when you deactivate the plugin, you must register this order status in function.php in order to see these orders in the orders admin. You can find the snippet to use in functions.php %s or we can set to change all your "delivered" order to "completed".', 'woo-advanced-shipment-tracking'), '<a href="https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/code-snippets/#delivered_code" target="blank">here</a>'),
1134
+ 'show' => true,
1135
+ 'class' => 'status_label_color_th',
1136
+ ),
1137
+ );
1138
+ return $form_data;
1139
+
1140
+ }
1141
 
1142
  /*
1143
  * settings form save
1144
  */
1145
+ function wc_ast_settings_form_update_callback(){
 
 
 
1146
  if ( ! empty( $_POST ) && check_admin_referer( 'wc_ast_settings_form', 'wc_ast_settings_form' ) ) {
1147
 
1148
  $data = $this->get_settings_data();
1149
 
1150
+ foreach( $data as $key => $val ){
1151
+ //if(isset($_POST[ $key ])){
1152
+ //echo '<pre>';print_r($_POST[ $key ]);echo '</pre>';exit;
1153
+ update_option( $key, $_POST[ $key ] );
1154
+ //}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1155
  }
1156
 
1157
+ $data = $this->get_delivered_data();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1158
 
1159
+ foreach( $data as $key => $val ){
1160
+ if($key == 'wcast_enable_delivered_email'){
1161
+ $wcast_enable_delivered_email = get_option('woocommerce_customer_delivered_order_settings');
1162
+ if($_POST['wcast_enable_delivered_email'] == 1){
1163
+ $enabled = 'yes';
1164
+ } else{
1165
+ $enabled = 'no';
1166
+ }
1167
+ $opt = array(
1168
+ 'enabled' => $enabled,
1169
+ 'subject' => $wcast_enable_delivered_email['subject'],
1170
+ 'heading' => $wcast_enable_delivered_email['heading'],
1171
+ );
1172
+ update_option( 'woocommerce_customer_delivered_order_settings', $opt );
1173
+ }
1174
+ update_option( $key, $_POST[ $key ] );
 
1175
  }
1176
+ echo json_encode( array('success' => 'true') );die();
1177
+
1178
  }
1179
+ }
 
 
1180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
 
1184
  function footer_function(){
1185
  $color = get_option('wc_ast_status_label_color');
1190
  }
1191
  </style>
1192
  <?php
1193
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1194
 
1195
  function upload_tracking_csv_fun(){
1196
 
1466
  function trackship_status_icon_filter_func( $html, $status ){
1467
  switch ($status) {
1468
  case "in_transit":
1469
+ $html = '<span class="icon-'.$status.'">';
1470
  break;
1471
  case "pre_transit":
1472
+ $html = '<span class="icon-'.$status.'">';
1473
  break;
1474
  case "delivered":
1475
+ $html = '<span class="icon-'.$status.'"></span>';
1476
  break;
1477
  case "out_for_delivery":
1478
+ $html = '<span class="icon-'.$status.'">';
1479
  break;
1480
  case "available_for_pickup":
1481
+ $html = '<span class="icon-'.$status.'">';
1482
  break;
1483
  case "return_to_sender":
1484
+ $html = '<span class="icon-'.$status.'">';
1485
  break;
1486
  case "failure":
1487
+ $html = '<span class="icon-'.$status.'">';
1488
  break;
1489
  case "unknown":
1490
+ $html = '<span class="icon-'.$status.'">';
1491
  break;
1492
  case "pending_trackship":
1493
+ $html = '<span class="icon-'.$status.'">';
1494
  break;
1495
  case "INVALID_TRACKING_NUM":
1496
  $html = '<i class="fa fa-question-circle icon-'.$status.'" aria-hidden="true"></i>';
1568
  require_once( 'email-manager.php' );
1569
  $old_status = 'in_transit';
1570
  $new_status = 'pre_transit';
1571
+ $order_id = $order->get_id();
 
 
1572
  WC()->mailer()->emails['WC_Email_Customer_Delivered_Order']->trigger( $order_id, $order );
1573
  }
1574
  /*
1609
  * Change completed order email title to Shipped Order
1610
  */
1611
  public function change_completed_woocommerce_email_title($email_title, $email){
1612
+ $wc_ast_status_shipped = get_option('wc_ast_status_shipped');
1613
  // Only on backend Woocommerce Settings "Emails" tab
1614
+ if($wc_ast_status_shipped == 1){
1615
  if( isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'email' ) {
1616
  switch ($email->id) {
1617
  case 'customer_completed_order':
1670
  }
1671
  return $actions;
1672
  }
1673
+
1674
+ public function filter_shipiing_provider_by_status_fun(){
1675
+ $status = $_POST['status'];
1676
+ global $wpdb;
1677
+ if($status == 'active'){
1678
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
1679
+ }
1680
+ if($status == 'inactive'){
1681
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 0" );
1682
+ }
1683
+ if($status == 'custom'){
1684
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 0" );
1685
+ }
1686
+ if($status == 'all'){
1687
+ $status = '';
1688
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table" );
1689
+ }
1690
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1691
+ echo $html;exit;
1692
+ }
1693
+
1694
+ public function get_provider_html($default_shippment_providers,$status){
1695
+ $WC_Countries = new WC_Countries();
1696
+ ?>
1697
+ <div class="provider_list">
1698
+ <?php
1699
+ if($default_shippment_providers){
1700
+ foreach($default_shippment_providers as $d_s_p){ ?>
1701
+ <div class="provider <?php if($d_s_p->display_in_order == 1) { echo 'active_provider'; } ?>">
1702
+ <div class="row-1">
1703
+ <div class="left-div">
1704
+ <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank">
1705
+ <?php if( $d_s_p->shipping_default == 1 ){ ?>
1706
+ <img class="provider-thumb" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/<?php echo sanitize_title($d_s_p->provider_name);?>.png?v=<?php echo wc_advanced_shipment_tracking()->version;?>">
1707
+ <?php } else{
1708
+ $custom_thumb_id = $d_s_p->custom_thumb_id;
1709
+ $image_attributes = wp_get_attachment_image_src( $custom_thumb_id , array('60','60') );
1710
+ //echo '<pre>';print_r($custom_thumb_id);echo '</pre>';exit;
1711
+ if($custom_thumb_id != 0){ ?>
1712
+ <img class="provider-thumb" src="<?php echo $image_attributes[0]; ?>">
1713
+ <?php } else{
1714
+ ?>
1715
+ <img class="provider-thumb" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/icon-default.png">
1716
+ <?php } ?>
1717
+ <?php } ?>
1718
+ </a>
1719
+ </div>
1720
+ <div class="right-div">
1721
+ <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank">
1722
+ <span class="provider_name"><?php echo $d_s_p->provider_name; ?></span>
1723
+ </a>
1724
+ <br>
1725
+ <span class="provider_country"><?php
1726
+ $search = array('(US)', '(UK)');
1727
+ $replace = array('', '');
1728
+ if($d_s_p->shipping_country && $d_s_p->shipping_country != 'Global'){
1729
+ echo str_replace($search, $replace, $WC_Countries->countries[$d_s_p->shipping_country]);
1730
+ } elseif($d_s_p->shipping_country && $d_s_p->shipping_country == 'Global'){
1731
+ echo 'Global';
1732
+ }
1733
+ ?></span>
1734
+ </div>
1735
+ </div>
1736
+ <div class="row-2">
1737
+ <div class="default-provider">
1738
+ <?php $default_provider = get_option("wc_ast_default_provider" );?>
1739
+ <label for="make_default_<?php echo $d_s_p->id; ?>" id="default_label_<?php echo $d_s_p->id; ?>" class="<?php if($d_s_p->display_in_order != 1) { echo 'disable_label'; } ?>">
1740
+ <input type="checkbox" id="make_default_<?php echo $d_s_p->id; ?>" name="make_provider_default" data-id="<?php echo $d_s_p->id; ?>" class="make_provider_default" value="<?php echo sanitize_title( $d_s_p->provider_name )?>" <?php if( $default_provider == sanitize_title( $d_s_p->provider_name ) )echo 'checked';?> <?php if($d_s_p->display_in_order != 1) { echo 'disabled'; } ?>>
1741
+ <span>default</span>
1742
+ </label>
1743
+ </div>
1744
+ <div class="provider-status">
1745
+ <?php if( $d_s_p->shipping_default == 0 ){ ?>
1746
+ <span class="dashicons dashicons-edit edit_provider" data-pid="<?php echo $d_s_p->id; ?>"></span>
1747
+ <span class="dashicons dashicons-trash remove" data-pid="<?php echo $d_s_p->id; ?>"></span>
1748
+ <?php } ?>
1749
+ <span class="mdl-list__item-secondary-action">
1750
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="list-switch-<?php echo $d_s_p->id; ?>">
1751
+ <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'; } ?> />
1752
+ </label>
1753
+ </span>
1754
+ </div>
1755
+ </div>
1756
+ </div>
1757
+ <?php } } else{
1758
+ $status = 'active';
1759
+ ?>
1760
+ <h3><?php echo sprintf(__("You don't have any %s shipping providers.", 'woo-advanced-shipment-tracking'), $status); ?></h3>
1761
+ <?php } ?>
1762
+ </div>
1763
+ <?php
1764
+ }
1765
+ /*
1766
+ * Update shipment provider status
1767
+ */
1768
+ function update_shipment_status_fun(){
1769
+ global $wpdb;
1770
+ $woo_shippment_table_name = $this->table;
1771
+ $success = $wpdb->update($woo_shippment_table_name,
1772
+ array(
1773
+ "display_in_order" => $_POST['checked'],
1774
+ ),
1775
+ array('id' => $_POST['id'])
1776
+ );
1777
+ exit;
1778
+ }
1779
+
1780
+ function update_default_provider_fun(){
1781
+ if($_POST['checked'] == 1){
1782
+ update_option("wc_ast_default_provider", $_POST['default_provider'] );
1783
+ } else{
1784
+ update_option("wc_ast_default_provider", '' );
1785
+ }
1786
+ exit;
1787
+ }
1788
+
1789
+ function add_custom_shipment_provider_fun(){
1790
+
1791
+ global $wpdb;
1792
+
1793
+ $woo_shippment_table_name = $this->table;
1794
+
1795
+ $data_array = array(
1796
+ 'shipping_country' => sanitize_text_field($_POST['shipping_country']),
1797
+ 'provider_name' => sanitize_text_field($_POST['shipping_provider']),
1798
+ 'ts_slug' => sanitize_title($_POST['shipping_provider']),
1799
+ 'provider_url' => sanitize_text_field($_POST['tracking_url']),
1800
+ 'custom_thumb_id' => sanitize_text_field($_POST['thumb_id']),
1801
+ 'display_in_order' => 1,
1802
+ 'shipping_default' => 0,
1803
+ );
1804
+ $result = $wpdb->insert( $woo_shippment_table_name, $data_array );
1805
+
1806
+ $status = 'custom';
1807
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 0" );
1808
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1809
+ echo $html;exit;
1810
+ }
1811
+
1812
+ /*
1813
+ * delet provide by ajax
1814
+ */
1815
+ public function woocommerce_shipping_provider_delete(){
1816
+
1817
+ $provider_id = $_POST['provider_id'];
1818
+ if ( ! empty( $provider_id ) ) {
1819
+ global $wpdb;
1820
+ $where = array(
1821
+ 'id' => $provider_id,
1822
+ 'shipping_default' => 0
1823
+ );
1824
+ $wpdb->delete( $this->table, $where );
1825
+ }
1826
+ $status = 'custom';
1827
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 0" );
1828
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1829
+ echo $html;exit;
1830
+ }
1831
+
1832
+ public function get_provider_details_fun(){
1833
+ $id = $_POST['provider_id'];
1834
+ global $wpdb;
1835
+ $shippment_provider = $wpdb->get_results( "SELECT * FROM $this->table WHERE id=$id" );
1836
+ $image = wp_get_attachment_url($shippment_provider[0]->custom_thumb_id);
1837
+ echo json_encode( array('id' => $shippment_provider[0]->id,'provider_name' => $shippment_provider[0]->provider_name,'provider_url' => $shippment_provider[0]->provider_url,'shipping_country' => $shippment_provider[0]->shipping_country,'custom_thumb_id' => $shippment_provider[0]->custom_thumb_id,'image' => $image) );exit;
1838
+ }
1839
+
1840
+ public function update_custom_shipment_provider_fun(){
1841
+
1842
+ global $wpdb;
1843
+ $data_array = array(
1844
+ 'shipping_country' => sanitize_text_field($_POST['shipping_country']),
1845
+ 'provider_name' => sanitize_text_field($_POST['shipping_provider']),
1846
+ 'ts_slug' => sanitize_title($_POST['shipping_provider']),
1847
+ 'custom_thumb_id' => sanitize_text_field($_POST['thumb_id']),
1848
+ 'provider_url' => esc_url($_POST['tracking_url'])
1849
+ );
1850
+ $where_array = array(
1851
+ 'id' => $_POST['provider_id'],
1852
+ );
1853
+ $wpdb->update( $this->table, $data_array, $where_array );
1854
+ $status = 'custom';
1855
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 0" );
1856
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1857
+ echo $html;exit;
1858
+ }
1859
+
1860
+ public function update_provider_status_active_fun(){
1861
+ global $wpdb;
1862
+ $data_array = array(
1863
+ 'display_in_order' => 1,
1864
+ );
1865
+ $where_array = array(
1866
+ 'display_in_order' => 0,
1867
+ );
1868
+ $wpdb->update( $this->table, $data_array, $where_array);
1869
+ $status = 'active';
1870
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
1871
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1872
+ exit;
1873
+ }
1874
+
1875
+ public function update_provider_status_inactive_fun(){
1876
+ global $wpdb;
1877
+ $data_array = array(
1878
+ 'display_in_order' => 0,
1879
+ );
1880
+ $where_array = array(
1881
+ 'display_in_order' => 1,
1882
+ );
1883
+ $status = 'inactive';
1884
+ $wpdb->update( $this->table, $data_array, $where_array);
1885
+ update_option("wc_ast_default_provider", '' );
1886
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 0" );
1887
+ $html = $this->get_provider_html($default_shippment_providers,$status);
1888
+ exit;
1889
+ }
1890
+
1891
+ public function sync_providers_fun(){
1892
+ global $wpdb;
1893
+ $wc_ast_api_key = get_option('wc_ast_api_key');
1894
+ $url = 'https://trackship.info/wp-json/WCAST/v1/Provider';
1895
+ $arg = array(
1896
+ 'body' => array(
1897
+ 'user_key' => $wc_ast_api_key
1898
+ ),
1899
+ );
1900
+ $resp = wp_remote_get( $url, $arg );
1901
+ $providers = json_decode($resp['body'],true);
1902
+
1903
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 1" );
1904
+
1905
+ foreach ( $default_shippment_providers as $key => $val ){
1906
+ $shippment_providers[ $val->provider_name ] = $val;
1907
+ }
1908
+
1909
+ foreach ( $providers as $key => $val ){
1910
+ $providers_name[ $val['provider_name'] ] = $val;
1911
+ }
1912
+
1913
+ $added = 0;
1914
+ $updated = 0;
1915
+ $deleted = 0;
1916
+ $added_html = '';
1917
+ $updated_html = '';
1918
+ $deleted_html = '';
1919
+
1920
+ foreach($providers as $provider){
1921
+
1922
+ $provider_name = $provider['shipping_provider'];
1923
+ $provider_url = $provider['provider_url'];
1924
+ $shipping_country = $provider['shipping_country'];
1925
+ $ts_slug = $provider['shipping_provider_slug'];
1926
+
1927
+ if($shippment_providers[$provider_name]){
1928
+ $db_provider_url = $shippment_providers[$provider_name]->provider_url;
1929
+ $db_shipping_country = $shippment_providers[$provider_name]->shipping_country;
1930
+ $db_ts_slug = $shippment_providers[$provider_name]->ts_slug;
1931
+ if(($db_provider_url != $provider_url) || ($db_shipping_country != $shipping_country) || ($db_ts_slug != $ts_slug)){
1932
+ $data_array = array(
1933
+ 'ts_slug' => $ts_slug,
1934
+ 'provider_url' => $provider_url,
1935
+ 'shipping_country' => $shipping_country,
1936
+ );
1937
+ $where_array = array(
1938
+ 'provider_name' => $provider_name,
1939
+ );
1940
+ $wpdb->update( $this->table, $data_array, $where_array);
1941
+ $updated_data[$updated] = array('provider_name' => $provider_name);
1942
+ $updated++;
1943
+ }
1944
+ } else{
1945
+ $img_url = $provider['img_url'];
1946
+ $img_slug = sanitize_title($provider_name);
1947
+ $img = wc_advanced_shipment_tracking()->get_plugin_path().'/assets/shipment-provider-img/'.$img_slug.'.png';
1948
+
1949
+ $ch = curl_init();
1950
+
1951
+ curl_setopt($ch, CURLOPT_HEADER, 0);
1952
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1953
+ curl_setopt($ch, CURLOPT_URL, $img_url);
1954
+
1955
+ $data = curl_exec($ch);
1956
+ curl_close($ch);
1957
+
1958
+ file_put_contents($img, $data);
1959
+
1960
+
1961
+ $data_array = array(
1962
+ 'shipping_country' => sanitize_text_field($shipping_country),
1963
+ 'provider_name' => sanitize_text_field($provider_name),
1964
+ 'ts_slug' => $ts_slug,
1965
+ 'provider_url' => sanitize_text_field($provider_url),
1966
+ 'display_in_order' => 0,
1967
+ 'shipping_default' => 1,
1968
+ );
1969
+ $result = $wpdb->insert( $this->table, $data_array );
1970
+ $added_data[$added] = array('provider_name' => $provider_name);
1971
+ $added++;
1972
+ }
1973
+ }
1974
+ foreach($default_shippment_providers as $db_provider){
1975
+ if(!is_array($providers_name[$db_provider->provider_name])){
1976
+ $where = array(
1977
+ 'provider_name' => $db_provider->provider_name,
1978
+ 'shipping_default' => 1
1979
+ );
1980
+ $wpdb->delete( $this->table, $where );
1981
+ $deleted_data[$deleted] = array('provider_name' => $db_provider->provider_name);
1982
+ $deleted++;
1983
+ }
1984
+ }
1985
+ if($added > 0){
1986
+ ob_start();
1987
+ $added_html = $this->added_html($added_data);
1988
+ $added_html = ob_get_clean();
1989
+ }
1990
+ if($updated > 0){
1991
+ ob_start();
1992
+ $updated_html = $this->updated_html($updated_data);
1993
+ $updated_html = ob_get_clean();
1994
+ }
1995
+ if($deleted > 0){
1996
+ ob_start();
1997
+ $deleted_html = $this->deleted_html($deleted_data);
1998
+ $deleted_html = ob_get_clean();
1999
+ }
2000
+
2001
+ $status = 'active';
2002
+ $default_shippment_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE display_in_order = 1" );
2003
+ ob_start();
2004
+ $html = $this->get_provider_html($default_shippment_providers,$status);
2005
+ $html = ob_get_clean();
2006
+ echo json_encode( array('added' => $added,'added_html' =>$added_html,'updated' => $updated,'updated_html' =>$updated_html,'deleted' => $deleted,'deleted_html' =>$deleted_html,'html' => $html) );exit;
2007
+ }
2008
+
2009
+ public function added_html($added_data){ ?>
2010
+ <ul class="updated_details" id="added_providers">
2011
+ <?php
2012
+ foreach ( $added_data as $added ){ ?>
2013
+ <li><?php echo $added['provider_name']; ?></li>
2014
+ <?php }
2015
+ ?>
2016
+ </ul>
2017
+ <a class="view_synch_details" id="view_added_details" href="javaScript:void(0);" style="display: block;"><?php _e( 'view details', 'woo-advanced-shipment-tracking'); ?></a>
2018
+ <a class="view_synch_details" id="hide_added_details" href="javaScript:void(0);" style="display: none;"><?php _e( 'hide details', 'woo-advanced-shipment-tracking'); ?></a>
2019
+ <?php }
2020
+
2021
+ public function updated_html($updated_data){ ?>
2022
+ <ul class="updated_details" id="updated_providers">
2023
+ <?php
2024
+ foreach ( $updated_data as $updated ){ ?>
2025
+ <li><?php echo $updated['provider_name']; ?></li>
2026
+ <?php }
2027
+ ?>
2028
+ </ul>
2029
+ <a class="view_synch_details" id="view_updated_details" href="javaScript:void(0);" style="display: block;"><?php _e( 'view details', 'woo-advanced-shipment-tracking'); ?></a>
2030
+ <a class="view_synch_details" id="hide_updated_details" href="javaScript:void(0);" style="display: none;"><?php _e( 'hide details', 'woo-advanced-shipment-tracking'); ?></a>
2031
+ <?php }
2032
+
2033
+ public function deleted_html($deleted_data){ ?>
2034
+ <ul class="updated_details" id="deleted_providers">
2035
+ <?php
2036
+ foreach ( $deleted_data as $deleted ){ ?>
2037
+ <li><?php echo $deleted['provider_name']; ?></li>
2038
+ <?php }
2039
+ ?>
2040
+ </ul>
2041
+ <a class="view_synch_details" id="view_deleted_details" href="javaScript:void(0);" style="display: block;"><?php _e( 'view details', 'woo-advanced-shipment-tracking'); ?></a>
2042
+ <a class="view_synch_details" id="hide_deleted_details" href="javaScript:void(0);" style="display: none;"><?php _e( 'hide details', 'woo-advanced-shipment-tracking'); ?></a>
2043
+ <?php }
2044
  }
includes/class-wc-advanced-shipment-tracking-api-call.php CHANGED
@@ -22,7 +22,7 @@ class WC_Advanced_Shipment_Tracking_Api_Call {
22
  $tracking_items = $order->get_meta( '_wc_shipment_tracking_items', true );
23
 
24
  $shipment_status = get_post_meta( $order_id, "shipment_status", true);
25
- //echo '<pre>';print_r($shipment_status);echo '</pre>';exit;
26
  if( $tracking_items ){
27
  foreach( ( array )$tracking_items as $key => $val ){
28
  if($shipment_status[$key]['status'] == 'delivered')continue;
22
  $tracking_items = $order->get_meta( '_wc_shipment_tracking_items', true );
23
 
24
  $shipment_status = get_post_meta( $order_id, "shipment_status", true);
25
+ //echo '<pre>';print_r($tracking_items);echo '</pre>';exit;
26
  if( $tracking_items ){
27
  foreach( ( array )$tracking_items as $key => $val ){
28
  if($shipment_status[$key]['status'] == 'delivered')continue;
includes/class-wc-advanced-shipment-tracking-front.php CHANGED
@@ -57,7 +57,7 @@ class WC_Advanced_Shipment_Tracking_Front {
57
  $border_color = get_option('wc_ast_select_border_color');
58
  ?>
59
  <style>
60
- <?php if($success_color){ ?>
61
  .bg-success{
62
  background-color:<?php echo $success_color; ?> !important;
63
  }
@@ -67,6 +67,9 @@ class WC_Advanced_Shipment_Tracking_Front {
67
  .text-success{
68
  color: <?php echo $success_color; ?> !important;
69
  }
 
 
 
70
  <?php } ?>
71
  <?php if($warning_color){ ?>
72
  .bg-warning{
@@ -78,7 +81,7 @@ class WC_Advanced_Shipment_Tracking_Front {
78
  .text-warning{
79
  color: <?php echo $warning_color; ?> !important;
80
  }
81
- <?php } ?>
82
  <?php if($primary_color){ ?>
83
  .bg-secondary{
84
  background-color:<?php echo $primary_color; ?> !important;
@@ -89,6 +92,15 @@ class WC_Advanced_Shipment_Tracking_Front {
89
  .text-secondary{
90
  color: <?php echo $primary_color; ?> !important;
91
  }
 
 
 
 
 
 
 
 
 
92
  <?php } ?>
93
  <?php if($border_color){ ?>
94
  .col.tracking-detail{
@@ -126,10 +138,6 @@ class WC_Advanced_Shipment_Tracking_Front {
126
  }
127
  ?>
128
 
129
- <div id="demo-toast-example" class="mdl-js-snackbar mdl-snackbar">
130
- <div class="mdl-snackbar__text"></div>
131
- <button class="mdl-snackbar__action" type="button"></button>
132
- </div>
133
  <?php
134
  if(!isset($order_id)){
135
  ?>
@@ -147,6 +155,74 @@ class WC_Advanced_Shipment_Tracking_Front {
147
  </div>
148
  <?php
149
  } else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  $num = 1;
151
  $total_trackings = sizeof($tracking_items);
152
  foreach($tracking_items as $item){
@@ -183,6 +259,17 @@ class WC_Advanced_Shipment_Tracking_Front {
183
  $day = date("l", $unixTimestamp);
184
  if(!empty($tracking_detail_org)){
185
  //echo '<pre>';print_r($tracking_detail_org);echo '</pre>';
 
 
 
 
 
 
 
 
 
 
 
186
  ?>
187
 
188
  <div class="tracking-detail col">
@@ -190,15 +277,35 @@ class WC_Advanced_Shipment_Tracking_Front {
190
  <p class="shipment_heading"><?php
191
  echo sprintf(__("Shipment - %s (out of %s)", 'woo-advanced-shipment-tracking'), $num , $total_trackings); ?></p>
192
  <?php } ?>
193
- <h1 class="shipment_status_heading text-secondary"><?php echo apply_filters("trackship_status_filter",$tracker->ep_status);?></h1>
194
- <div class="status-section">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  <div class="tracker-progress-bar tracker-progress-bar-with-dots">
196
  <div class="progress">
197
- <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php if($tracker->ep_status == "in_transit") { echo 'width:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'width:66%';} elseif($tracker->ep_status == "delivered") { echo 'width:100%'; } ?>"></div>
198
  </div>
199
- <div class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
200
- <span class="dot state-0"></span>
201
- <span class="state-label state-0 <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
202
  <?php
203
  if($tracker->ep_status == "unknown"){
204
  echo apply_filters("trackship_status_filter",'unknown');
@@ -207,20 +314,14 @@ class WC_Advanced_Shipment_Tracking_Front {
207
  }
208
  ?>
209
  </span>
210
- <?php
211
- if($tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "delivered") {
212
- echo '<span class="dot state-1"></span>';
213
- }
214
- ?>
215
  <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
216
  <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
217
  </span>
218
- <?php
219
- if($tracker->ep_status == "delivered" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup") {
220
- echo '<span class="dot state-2"></span>';
221
- }
222
- ?>
223
- <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } ?>">
224
  <?php
225
  if($tracker->ep_status == "return_to_sender"){
226
  echo apply_filters("trackship_status_filter",'return_to_sender');
@@ -231,95 +332,96 @@ class WC_Advanced_Shipment_Tracking_Front {
231
  }
232
  ?>
233
  </span>
234
- <?php
235
- if($tracker->ep_status == "delivered") {
236
- echo '<span class="dot state-3"></span>';
237
- }
238
- ?>
239
  <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
240
  <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
241
  </span>
242
  </div>
243
  </div>
244
- </div>
245
- <div class="tracker-top-level">
246
- <div class="col-md col-md-6 pb-6 pb-md-0 est-delivery-date-container">
247
- <?php
248
- if($tracker->est_delivery_date){
249
- ?>
250
- <div class="text-muted">
251
- <?php _e( 'Estimated Delivery Date', 'woo-advanced-shipment-tracking' ); ?>
252
- </div>
253
- <h1 class="est-delivery-date text-secondary"><?php echo $day; ?>, <?php echo date('M d', strtotime($tracker->est_delivery_date)); ?></h1>
254
- <?php } else{ ?>
255
- <div class="text-muted">
256
- <?php _e( 'No Estimated Delivery Date', 'woo-advanced-shipment-tracking' ); ?>
257
- </div>
258
- <?php } ?>
259
  </div>
260
- <div class="col-md col-md-6">
261
- <div class="mb-2 mt-6 mt-md-0"><?php echo $tracker->carrier; ?></div>
262
- <div class="tracking-code text-secondary text-truncate font-weight-bold font-size-h5">
263
- <?php echo $tracker->tracking_code; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  </div>
265
- </div>
266
- </div>
267
  <div class="shipment_progress_div">
268
  <div class="shipment_progress_heading_div">
269
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
270
- <div class="col-md col-md-6">
271
- <h2 class="font-weight-bold text-secondary py-2 mb-3"><?php _e( 'Shipment Progress', 'woo-advanced-shipment-tracking' ); ?></h2>
272
- </div>
273
- <div class="col-md col-md-6">
274
- <p class="small text-right"><span class="text-muted"><?php _e( 'Last Updated:', 'woo-advanced-shipment-tracking' ); ?></span> <strong> <?php echo date('F d g:iA', strtotime($tracker->ep_updated_at)); ?></strong></p>
275
- </div>
276
  <?php } ?>
277
  </div>
278
- <div class="">
279
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
280
- <ul class="tracking-details list-unstyled mb-4 border border-light">
281
- <?php } ?>
282
- <?php
283
- $i=0;
284
- foreach($trackind_detail_by_status_rev as $key=>$status_detail){
285
-
286
- ?>
287
- <!--li class="px-3 py-2 mb-3 font-weight-bold bg-gray-100 text-secondary">
288
- <?php echo date("F d, Y",strtotime($status_detail->datetime)); ?>
289
- </li-->
290
- <?php //foreach($date_detail as $time=>$time_detail){
291
- $bg_class = '';
292
- if ($i % 2 == 0){
293
- $bg_class = 'bg-gray-100';
294
- }
295
- ?>
296
- <li class="d-flex align-items-center mb-0 <?php echo $bg_class; ?>">
297
- <div class="font-size-h3 px-3 px-lg-4 <?php if($status_detail->status_detail == "arrived_at_destination" || $status_detail->status_detail == "arrived_at_pickup_location"){ echo 'ep-icon-theme1-delivered text-success'; } elseif($status_detail->status_detail == "out_for_delivery" || $status_detail->status_detail == "available_for_pickup"){ echo 'ep-icon-theme1-clock text-secondary'; } elseif($status_detail->status_detail == "label_created"){ echo 'ep-icon-theme1-barcode text-secondary'; } elseif($status_detail->status_detail == "failure"){ echo 'ep-icon-theme1-exclamation text-warning'; } elseif($status_detail->status_detail == "return"){ echo 'ep-icon-theme1-back-arrow text-warning'; } else{ echo 'ep-icon-theme1-default';} ?> "></div>
298
- <div class="tracking-details-date text-gray-300 font-size-h5 text-center">
299
- <?php echo date("F d, Y",strtotime($status_detail->datetime)); ?>
300
- </div>
301
- <div class="tracking-details-time text-gray-300 font-size-h5 text-center">
302
- <?php echo date("g:i a", strtotime($status_detail->datetime)); ?>
303
- </div>
304
-
305
- <div>
306
- <div class="font-size-h5">
307
- <strong><?php echo $status_detail->description; ?></strong>
308
- </div>
309
- <div class="text-gray-300">
310
- <?php echo $status_detail->tracking_location->city; if($status_detail->tracking_location->city) echo ',';?>
311
- <?php echo $status_detail->tracking_location->state; ?>
312
- <?php echo $status_detail->tracking_location->zip; ?>
313
- <?php echo $status_detail->tracking_location->country; ?>
314
- </div>
315
- </div>
316
- </li>
317
- <?php //} ?>
318
- <?php $i++; } ?>
319
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
320
- </ul>
321
- <?php } ?>
322
- </div>
323
  </div>
324
  </div>
325
  <?php } else{ ?>
@@ -335,7 +437,6 @@ class WC_Advanced_Shipment_Tracking_Front {
335
  <div class="trackship_branding">
336
  <p>Shipment Tracking info by <a href="https://trackship.info" title="TrackShip" target="blank">TrackShip</a></p>
337
  </div>
338
- <?php ?>
339
  <?php } ?>
340
  <?php } }
341
 
@@ -470,6 +571,16 @@ class WC_Advanced_Shipment_Tracking_Front {
470
  $trackind_detail_by_status_rev = array_reverse($trackind_detail_by_status);
471
  }
472
 
 
 
 
 
 
 
 
 
 
 
473
  $unixTimestamp = strtotime($decoded_data[0]->est_delivery_date);
474
  //Get the day of the week using PHP's date function.
475
  $day = date("l", $unixTimestamp);
@@ -480,15 +591,35 @@ class WC_Advanced_Shipment_Tracking_Front {
480
  <p class="shipment_heading"><?php
481
  echo sprintf(__("Shipment - %s (out of %s)", 'woo-advanced-shipment-tracking'), $num , $total_trackings); ?></p>
482
  <?php } ?>
483
- <h1 class="shipment_status_heading text-secondary"><?php echo apply_filters("trackship_status_filter",$tracker->ep_status);?></h1>
484
- <div class="status-section">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  <div class="tracker-progress-bar tracker-progress-bar-with-dots">
486
  <div class="progress">
487
- <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php if($tracker->ep_status == "in_transit") { echo 'width:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'width:66%';} elseif($tracker->ep_status == "delivered") { echo 'width:100%'; } ?>"></div>
488
  </div>
489
- <div class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
490
- <span class="dot state-0"></span>
491
- <span class="state-label state-0 <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
492
  <?php
493
  if($tracker->ep_status == "unknown"){
494
  echo apply_filters("trackship_status_filter",'unknown');
@@ -497,20 +628,14 @@ class WC_Advanced_Shipment_Tracking_Front {
497
  }
498
  ?>
499
  </span>
500
- <?php
501
- if($tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "delivered") {
502
- echo '<span class="dot state-1"></span>';
503
- }
504
- ?>
505
  <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
506
  <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
507
  </span>
508
- <?php
509
- if($tracker->ep_status == "delivered" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup") {
510
- echo '<span class="dot state-2"></span>';
511
- }
512
- ?>
513
- <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } ?>">
514
  <?php
515
  if($tracker->ep_status == "return_to_sender"){
516
  echo apply_filters("trackship_status_filter",'return_to_sender');
@@ -521,97 +646,98 @@ class WC_Advanced_Shipment_Tracking_Front {
521
  }
522
  ?>
523
  </span>
524
- <?php
525
- if($tracker->ep_status == "delivered") {
526
- echo '<span class="dot state-3"></span>';
527
- }
528
- ?>
529
  <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
530
  <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
531
  </span>
532
  </div>
533
  </div>
534
- </div>
535
- <div class="tracker-top-level">
536
- <div class="col-md col-md-6 pb-6 pb-md-0 est-delivery-date-container">
537
- <?php
538
- if($tracker->est_delivery_date){
539
- ?>
540
- <div class="text-muted">
541
- <?php _e( 'Estimated Delivery Date', 'woo-advanced-shipment-tracking' ); ?>
542
- </div>
543
- <h1 class="est-delivery-date text-secondary"><?php echo $day; ?>, <?php echo date('M d', strtotime($tracker->est_delivery_date)); ?></h1>
544
- <?php } else{ ?>
545
- <div class="text-muted">
546
- <?php _e( 'No Estimated Delivery Date', 'woo-advanced-shipment-tracking' ); ?>
547
- </div>
548
- <?php } ?>
549
  </div>
550
- <div class="col-md col-md-6">
551
- <div class="mb-2 mt-6 mt-md-0"><?php echo $tracker->carrier; ?></div>
552
- <div class="tracking-code text-secondary text-truncate font-weight-bold font-size-h5">
553
- <?php echo $tracker->tracking_code; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  </div>
555
- </div>
556
- </div>
557
  <div class="shipment_progress_div">
558
  <div class="shipment_progress_heading_div">
559
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
560
- <div class="col-md col-md-6">
561
- <h2 class="font-weight-bold text-secondary py-2 mb-3"><?php _e( 'Shipment Progress', 'woo-advanced-shipment-tracking' ); ?></h2>
562
- </div>
563
- <div class="col-md col-md-6">
564
- <p class="small text-right"><span class="text-muted"><?php _e( 'Last Updated:', 'woo-advanced-shipment-tracking' ); ?></span> <strong> <?php echo date('F d g:iA', strtotime($tracker->ep_updated_at)); ?></strong></p>
565
- </div>
566
  <?php } ?>
567
  </div>
568
- <div class="">
569
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
570
- <ul class="tracking-details list-unstyled mb-4 border border-light">
571
- <?php } ?>
572
- <?php
573
- $i=0;
574
- foreach($trackind_detail_by_status_rev as $key=>$status_detail){
575
-
576
- ?>
577
- <!--li class="px-3 py-2 mb-3 font-weight-bold bg-gray-100 text-secondary">
578
- <?php echo date("F d, Y",strtotime($status_detail->datetime)); ?>
579
- </li-->
580
- <?php //foreach($date_detail as $time=>$time_detail){
581
- $bg_class = '';
582
- if ($i % 2 == 0){
583
- $bg_class = 'bg-gray-100';
584
- }
585
- ?>
586
- <li class="d-flex align-items-center mb-0 <?php echo $bg_class; ?>">
587
- <div class="font-size-h3 px-3 px-lg-4 <?php if($status_detail->status_detail == "arrived_at_destination" || $status_detail->status_detail == "arrived_at_pickup_location"){ echo 'ep-icon-theme1-delivered text-success'; } elseif($status_detail->status_detail == "out_for_delivery" || $status_detail->status_detail == "available_for_pickup"){ echo 'ep-icon-theme1-clock text-secondary'; } elseif($status_detail->status_detail == "label_created"){ echo 'ep-icon-theme1-barcode text-secondary'; } elseif($status_detail->status_detail == "failure"){ echo 'ep-icon-theme1-exclamation text-warning'; } elseif($status_detail->status_detail == "return"){ echo 'ep-icon-theme1-back-arrow text-warning'; } else{ echo 'ep-icon-theme1-default';} ?> "></div>
588
- <div class="tracking-details-date text-gray-300 font-size-h5 text-center">
589
- <?php echo date("F d, Y",strtotime($status_detail->datetime)); ?>
590
- </div>
591
- <div class="tracking-details-time text-gray-300 font-size-h5 text-center">
592
- <?php echo date("g:i a", strtotime($status_detail->datetime)); ?>
593
- </div>
594
-
595
- <div>
596
- <div class="font-size-h5">
597
- <strong><?php echo $status_detail->description; ?></strong>
598
- </div>
599
- <div class="text-gray-300">
600
- <?php echo $status_detail->tracking_location->city; if($status_detail->tracking_location->city) echo ',';?>
601
- <?php echo $status_detail->tracking_location->state; ?>
602
- <?php echo $status_detail->tracking_location->zip; ?>
603
- <?php echo $status_detail->tracking_location->country; ?>
604
- </div>
605
- </div>
606
- </li>
607
- <?php //} ?>
608
- <?php $i++; } ?>
609
- <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
610
- </ul>
611
- <?php } ?>
612
- </div>
613
  </div>
614
- </div>
615
  <?php } else{ ?>
616
  <div class="tracking-detail col">
617
  <h1 class="shipment_status_heading text-secondary text-center"><?php _e( 'Tracking&nbsp;#&nbsp;'.$tracking_number, 'woo-advanced-shipment-tracking' ); ?></h1>
@@ -648,4 +774,145 @@ class WC_Advanced_Shipment_Tracking_Front {
648
  // print final date and time
649
  return $date;
650
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
  }
57
  $border_color = get_option('wc_ast_select_border_color');
58
  ?>
59
  <style>
60
+ <?php /*if($success_color){ ?>
61
  .bg-success{
62
  background-color:<?php echo $success_color; ?> !important;
63
  }
67
  .text-success{
68
  color: <?php echo $success_color; ?> !important;
69
  }
70
+ .progress-bar.bg-success:before{
71
+ background-color: <?php echo $success_color; ?>;
72
+ }
73
  <?php } ?>
74
  <?php if($warning_color){ ?>
75
  .bg-warning{
81
  .text-warning{
82
  color: <?php echo $warning_color; ?> !important;
83
  }
84
+ <?php } */?>
85
  <?php if($primary_color){ ?>
86
  .bg-secondary{
87
  background-color:<?php echo $primary_color; ?> !important;
92
  .text-secondary{
93
  color: <?php echo $primary_color; ?> !important;
94
  }
95
+ .progress-bar.bg-secondary:before{
96
+ background-color: <?php echo $primary_color; ?>;
97
+ }
98
+ .tracking-number{
99
+ color: <?php echo $primary_color; ?> !important;
100
+ }
101
+ .view_table_rows,.hide_table_rows{
102
+ color: <?php echo $primary_color; ?> !important;
103
+ }
104
  <?php } ?>
105
  <?php if($border_color){ ?>
106
  .col.tracking-detail{
138
  }
139
  ?>
140
 
 
 
 
 
141
  <?php
142
  if(!isset($order_id)){
143
  ?>
155
  </div>
156
  <?php
157
  } else{
158
+ if ( is_plugin_active( 'custom-order-numbers-for-woocommerce/custom-order-numbers-for-woocommerce.php' ) ) {
159
+ $alg_wc_custom_order_numbers_enabled = get_option('alg_wc_custom_order_numbers_enabled');
160
+ if($alg_wc_custom_order_numbers_enabled == 'yes'){
161
+ $args = array(
162
+ 'post_type' => 'shop_order',
163
+ 'posts_per_page' => '1',
164
+ 'meta_query' => array(
165
+ 'relation' => 'AND',
166
+ array(
167
+ 'key' => '_alg_wc_custom_order_number',
168
+ 'value' => $order_id
169
+ ),
170
+ ),
171
+ 'post_status' => array('wc-pending', 'wc-processing', 'wc-on-hold', 'wc-completed', 'wc-delivered', 'wc-cancelled', 'wc-refunded', 'wc-failed','wc-bit-payment') ,
172
+ );
173
+ $posts = get_posts( $args );
174
+ $my_query = new WP_Query( $args );
175
+
176
+ if( $my_query->have_posts() ) {
177
+ while( $my_query->have_posts()) {
178
+ $my_query->the_post();
179
+ if(get_the_ID()){
180
+ $order_id = get_the_ID();
181
+ }
182
+ } // end while
183
+ } // end if
184
+ wp_reset_postdata();
185
+ }
186
+ }
187
+
188
+ if ( is_plugin_active( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php' ) ) {
189
+
190
+ $s_order_id = wc_sequential_order_numbers()->find_order_by_order_number( $order_id );
191
+ if($s_order_id){
192
+ $order_id = $s_order_id;
193
+ }
194
+ }
195
+
196
+ if ( is_plugin_active( 'wp-lister-amazon/wp-lister-amazon.php' ) ) {
197
+ $wpla_use_amazon_order_number = get_option( 'wpla_use_amazon_order_number' );
198
+ if($wpla_use_amazon_order_number == 1){
199
+ $args = array(
200
+ 'post_type' => 'shop_order',
201
+ 'posts_per_page' => '1',
202
+ 'meta_query' => array(
203
+ 'relation' => 'AND',
204
+ array(
205
+ 'key' => '_wpla_amazon_order_id',
206
+ 'value' => $order_id
207
+ ),
208
+ ),
209
+ 'post_status' => array('wc-pending', 'wc-processing', 'wc-on-hold', 'wc-completed', 'wc-delivered', 'wc-cancelled', 'wc-refunded', 'wc-failed','wc-bit-payment') ,
210
+ );
211
+ $posts = get_posts( $args );
212
+ $my_query = new WP_Query( $args );
213
+
214
+ if( $my_query->have_posts() ) {
215
+ while( $my_query->have_posts()) {
216
+ $my_query->the_post();
217
+ if(get_the_ID()){
218
+ $order_id = get_the_ID();
219
+ }
220
+ } // end while
221
+ } // end if
222
+ wp_reset_postdata();
223
+ }
224
+ }
225
+
226
  $num = 1;
227
  $total_trackings = sizeof($tracking_items);
228
  foreach($tracking_items as $item){
259
  $day = date("l", $unixTimestamp);
260
  if(!empty($tracking_detail_org)){
261
  //echo '<pre>';print_r($tracking_detail_org);echo '</pre>';
262
+
263
+ if($tracker->ep_status == "unknown"){ $state0_class = 'unknown'; } else{ $state0_class = 'pre_transit'; }
264
+ if($tracker->ep_status == "return_to_sender" ){
265
+ $state2_class = 'return_to_sender';
266
+ } elseif($tracker->ep_status == "failure"){
267
+ $state2_class = 'failure';
268
+ } elseif($tracker->ep_status == "available_for_pickup"){
269
+ $state2_class = 'available_for_pickup';
270
+ } else{
271
+ $state2_class = 'out_for_delivery';
272
+ }
273
  ?>
274
 
275
  <div class="tracking-detail col">
277
  <p class="shipment_heading"><?php
278
  echo sprintf(__("Shipment - %s (out of %s)", 'woo-advanced-shipment-tracking'), $num , $total_trackings); ?></p>
279
  <?php } ?>
280
+ <div class="tracking-header">
281
+ <div class="col-md col-md-6">
282
+ <?php _e( 'Order: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">#<?php echo $order_id; ?></span><br/>
283
+ <?php _e( 'Tracking: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">#<?php echo $tracker->tracking_code; ?></span>
284
+ <h1 class="shipment_status_heading <?php if($tracker->ep_status == "delivered") { echo 'text-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure") { echo 'text-success'; } else{ echo 'text-secondary'; } ?>"><?php echo apply_filters("trackship_status_filter",$tracker->ep_status);?></h1>
285
+ </div>
286
+ <div class="col-md col-md-6">
287
+ <?php
288
+ if($tracker->est_delivery_date){
289
+ ?>
290
+ <div class="text-muted text-right">
291
+ <?php _e( 'Estimated Delivery Date: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number"><?php echo $day; ?>, <?php echo date('M d', strtotime($tracker->est_delivery_date)); ?></span>
292
+ </div>
293
+ <?php } else{ ?>
294
+ <div class="text-muted text-right">
295
+ <?php _e( 'Estimated Delivery Date: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">N/A</span>
296
+ </div>
297
+ <?php } ?>
298
+ </div>
299
+ </div>
300
+
301
+ <div class="status-section desktop-section">
302
  <div class="tracker-progress-bar tracker-progress-bar-with-dots">
303
  <div class="progress">
304
+ <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php /*if($tracker->ep_status == "in_transit") { echo 'width:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'width:66%';} elseif($tracker->ep_status == "delivered") { echo 'width:100%'; }*/ ?>"></div>
305
  </div>
306
+ <div style="background-color: transparent;" class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
307
+ <span class="dot state-0 <?php echo $state0_class?> <?php if($tracker->ep_status =="pre_transit"){ echo ' current-state'; } else{ echo 'past-state';} ?>"></span>
308
+ <span class="state-label <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
309
  <?php
310
  if($tracker->ep_status == "unknown"){
311
  echo apply_filters("trackship_status_filter",'unknown');
314
  }
315
  ?>
316
  </span>
317
+
318
+ <span class="dot state-1 in_transit <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>"></span>
 
 
 
319
  <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
320
  <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
321
  </span>
322
+
323
+ <span class="dot state-2 <?php echo $state2_class; if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo ' current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo ' future-state'; } else{ echo ' past-state'; } ?>"></span>
324
+ <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
 
 
 
325
  <?php
326
  if($tracker->ep_status == "return_to_sender"){
327
  echo apply_filters("trackship_status_filter",'return_to_sender');
332
  }
333
  ?>
334
  </span>
335
+
336
+ <span class="dot state-3 delivered <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>"></span>
 
 
 
337
  <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
338
  <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
339
  </span>
340
  </div>
341
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  </div>
343
+
344
+ <div class="status-section mobile-section">
345
+ <div class="tracker-progress-bar tracker-progress-bar-with-dots">
346
+ <div class="progress">
347
+ <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php /*if($tracker->ep_status == "in_transit") { echo 'height:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'height:66%';} elseif($tracker->ep_status == "delivered") { echo 'height:100%'; }*/ ?>"></div>
348
+ </div>
349
+ <div style="background-color: transparent;" class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
350
+
351
+ <div class="dot-div">
352
+ <span class="dot state-0 <?php echo $state0_class?> <?php if($tracker->ep_status =="pre_transit"){ echo ' current-state'; } else{ echo 'past-state';} ?>"></span>
353
+ <span class="state-label <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
354
+ <?php
355
+ if($tracker->ep_status == "unknown"){
356
+ echo apply_filters("trackship_status_filter",'unknown');
357
+ } else{
358
+ echo apply_filters("trackship_status_filter",'pre_transit');
359
+ }
360
+ ?>
361
+ </span>
362
+ </div>
363
+
364
+ <div class="dot-div">
365
+ <span class="dot state-1 in_transit <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>"></span>
366
+ <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
367
+ <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
368
+ </span>
369
+ </div>
370
+
371
+ <div class="dot-div">
372
+ <span class="dot state-2 <?php echo $state2_class; if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo ' current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo ' future-state'; } else{ echo ' past-state'; } ?>"></span>
373
+ <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } else{ echo ' past-state'; } ?>">
374
+ <?php
375
+ if($tracker->ep_status == "return_to_sender"){
376
+ echo apply_filters("trackship_status_filter",'return_to_sender');
377
+ } elseif($tracker->ep_status == "failure"){
378
+ echo apply_filters("trackship_status_filter",'failure');
379
+ } else{
380
+ echo apply_filters("trackship_status_filter",'out_for_delivery');
381
+ }
382
+ ?>
383
+ </span>
384
+ </div>
385
+
386
+ <div class="dot-div">
387
+ <span class="dot state-3 delivered <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>"></span>
388
+ <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
389
+ <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
390
+ </span>
391
+ </div>
392
+
393
+ </div>
394
  </div>
395
+ </div>
396
+
397
  <div class="shipment_progress_div">
398
  <div class="shipment_progress_heading_div">
399
+ <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
400
+ <h4 class="tracking-number h4-heading" style=""><?php _e( 'Tracking Details', 'woo-advanced-shipment-tracking' ); ?></h4>
 
 
 
 
 
401
  <?php } ?>
402
  </div>
403
+ <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){
404
+ //echo '<pre>';print_r($trackind_detail_by_status_rev);echo '</pre>';
405
+ ?>
406
+ <table class="tracking-table">
407
+ <tbody>
408
+ <?php
409
+ $i=0;
410
+ foreach($trackind_detail_by_status_rev as $key=>$status_detail){ ?>
411
+ <tr>
412
+ <td><?php echo date("F d, Y",strtotime($status_detail->datetime)); ?> <?php echo date("g:i a", strtotime($status_detail->datetime)); ?></td>
413
+ <td><?php echo apply_filters("trackship_status_filter",$key);?></td>
414
+ <td><?php echo $status_detail->message; ?></td>
415
+ </tr>
416
+ <?php }
417
+ ?>
418
+ </tbody>
419
+ </table>
420
+ <?php if(count($trackind_detail_by_status_rev) > 2){ ?>
421
+
422
+ <a class="view_table_rows" href="javaScript:void(0);"><?php _e( 'view more', 'woo-advanced-shipment-tracking' ); ?></a>
423
+ <a class="hide_table_rows" href="javaScript:void(0);"><?php _e( 'view less', 'woo-advanced-shipment-tracking' ); ?></a>
424
+ <?php } } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  </div>
426
  </div>
427
  <?php } else{ ?>
437
  <div class="trackship_branding">
438
  <p>Shipment Tracking info by <a href="https://trackship.info" title="TrackShip" target="blank">TrackShip</a></p>
439
  </div>
 
440
  <?php } ?>
441
  <?php } }
442
 
571
  $trackind_detail_by_status_rev = array_reverse($trackind_detail_by_status);
572
  }
573
 
574
+ if($tracker->ep_status == "unknown"){ $state0_class = 'unknown'; } else{ $state0_class = 'pre_transit'; }
575
+ if($tracker->ep_status == "return_to_sender" ){
576
+ $state2_class = 'return_to_sender';
577
+ } elseif($tracker->ep_status == "failure"){
578
+ $state2_class = 'failure';
579
+ } elseif($tracker->ep_status == "available_for_pickup"){
580
+ $state2_class = 'available_for_pickup';
581
+ } else{
582
+ $state2_class = 'out_for_delivery';
583
+ }
584
  $unixTimestamp = strtotime($decoded_data[0]->est_delivery_date);
585
  //Get the day of the week using PHP's date function.
586
  $day = date("l", $unixTimestamp);
591
  <p class="shipment_heading"><?php
592
  echo sprintf(__("Shipment - %s (out of %s)", 'woo-advanced-shipment-tracking'), $num , $total_trackings); ?></p>
593
  <?php } ?>
594
+ <div class="tracking-header">
595
+ <div class="col-md col-md-6">
596
+ <?php _e( 'Order: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">#<?php echo $order_id; ?></span><br/>
597
+ <?php _e( 'Tracking: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">#<?php echo $tracker->tracking_code; ?></span>
598
+ <h1 class="shipment_status_heading <?php if($tracker->ep_status == "delivered") { echo 'text-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure") { echo 'text-success'; } else{ echo 'text-secondary'; } ?>"><?php echo apply_filters("trackship_status_filter",$tracker->ep_status);?></h1>
599
+ </div>
600
+ <div class="col-md col-md-6">
601
+ <?php
602
+ if($tracker->est_delivery_date){
603
+ ?>
604
+ <div class="text-muted text-right">
605
+ <?php _e( 'Estimated Delivery Date: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number"><?php echo $day; ?>, <?php echo date('M d', strtotime($tracker->est_delivery_date)); ?></span>
606
+ </div>
607
+ <?php } else{ ?>
608
+ <div class="text-muted text-right">
609
+ <?php _e( 'Estimated Delivery Date: ', 'woo-advanced-shipment-tracking' ); ?><span class="tracking-number">N/A</span>
610
+ </div>
611
+ <?php } ?>
612
+ </div>
613
+ </div>
614
+
615
+ <div class="status-section desktop-section">
616
  <div class="tracker-progress-bar tracker-progress-bar-with-dots">
617
  <div class="progress">
618
+ <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php /*if($tracker->ep_status == "in_transit") { echo 'width:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'width:66%';} elseif($tracker->ep_status == "delivered") { echo 'width:100%'; }*/ ?>"></div>
619
  </div>
620
+ <div style="background-color: transparent;" class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
621
+ <span class="dot state-0 <?php echo $state0_class?> <?php if($tracker->ep_status =="pre_transit"){ echo ' current-state'; } else{ echo 'past-state';} ?>"></span>
622
+ <span class="state-label <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
623
  <?php
624
  if($tracker->ep_status == "unknown"){
625
  echo apply_filters("trackship_status_filter",'unknown');
628
  }
629
  ?>
630
  </span>
631
+
632
+ <span class="dot state-1 in_transit <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>"></span>
 
 
 
633
  <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
634
  <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
635
  </span>
636
+
637
+ <span class="dot state-2 <?php echo $state2_class; if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo ' current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo ' future-state'; } else{ echo ' past-state'; } ?>"></span>
638
+ <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
 
 
 
639
  <?php
640
  if($tracker->ep_status == "return_to_sender"){
641
  echo apply_filters("trackship_status_filter",'return_to_sender');
646
  }
647
  ?>
648
  </span>
649
+
650
+ <span class="dot state-3 delivered <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>"></span>
 
 
 
651
  <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
652
  <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
653
  </span>
654
  </div>
655
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
656
  </div>
657
+
658
+ <div class="status-section mobile-section">
659
+ <div class="tracker-progress-bar tracker-progress-bar-with-dots">
660
+ <div class="progress">
661
+ <div class="progress-bar <?php if($tracker->ep_status == "delivered") { echo 'bg-success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'bg-warning'; } else{ echo 'bg-secondary';} ?>" style="<?php /*if($tracker->ep_status == "in_transit") { echo 'height:33%;'; } elseif($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'height:66%';} elseif($tracker->ep_status == "delivered") { echo 'height:100%'; }*/ ?>"></div>
662
+ </div>
663
+ <div style="background-color: transparent;" class="<?php if($tracker->ep_status == "delivered") { echo 'success'; } elseif($tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure" || $tracker->ep_status == "unknown") { echo 'warning'; } else{ echo 'secondary';} ?>">
664
+
665
+ <div class="dot-div">
666
+ <span class="dot state-0 <?php echo $state0_class?> <?php if($tracker->ep_status =="pre_transit"){ echo ' current-state'; } else{ echo 'past-state';} ?>"></span>
667
+ <span class="state-label <?php if($tracker->ep_status =="pre_transit"){ echo 'current-state'; } else{ echo 'past-state';} ?>">
668
+ <?php
669
+ if($tracker->ep_status == "unknown"){
670
+ echo apply_filters("trackship_status_filter",'unknown');
671
+ } else{
672
+ echo apply_filters("trackship_status_filter",'pre_transit');
673
+ }
674
+ ?>
675
+ </span>
676
+ </div>
677
+
678
+ <div class="dot-div">
679
+ <span class="dot state-1 in_transit <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>"></span>
680
+ <span class="state-label state-1 <?php if($tracker->ep_status == "in_transit"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit"){ echo 'future-state'; } else{ echo 'past-state'; } ?>">
681
+ <?php echo apply_filters("trackship_status_filter",'in_transit'); ?>
682
+ </span>
683
+ </div>
684
+
685
+ <div class="dot-div">
686
+ <span class="dot state-2 <?php echo $state2_class; if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo ' current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo ' future-state'; } else{ echo ' past-state'; } ?>"></span>
687
+ <span class="state-label state-2 <?php if($tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "failure" || $tracker->ep_status == "return_to_sender"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit"){ echo 'future-state'; } else{ echo ' past-state'; } ?>">
688
+ <?php
689
+ if($tracker->ep_status == "return_to_sender"){
690
+ echo apply_filters("trackship_status_filter",'return_to_sender');
691
+ } elseif($tracker->ep_status == "failure"){
692
+ echo apply_filters("trackship_status_filter",'failure');
693
+ } else{
694
+ echo apply_filters("trackship_status_filter",'out_for_delivery');
695
+ }
696
+ ?>
697
+ </span>
698
+ </div>
699
+
700
+ <div class="dot-div">
701
+ <span class="dot state-3 delivered <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>"></span>
702
+ <span class="state-label state-3 <?php if($tracker->ep_status == "delivered"){ echo 'current-state'; } elseif($tracker->ep_status == "pre_transit" || $tracker->ep_status == "in_transit" || $tracker->ep_status == "out_for_delivery" || $tracker->ep_status == "available_for_pickup" || $tracker->ep_status == "return_to_sender" || $tracker->ep_status == "failure"){ echo 'future-state'; }?>">
703
+ <?php echo apply_filters("trackship_status_filter",'delivered'); ?>
704
+ </span>
705
+ </div>
706
+
707
+ </div>
708
  </div>
709
+ </div>
710
+
711
  <div class="shipment_progress_div">
712
  <div class="shipment_progress_heading_div">
713
+ <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){?>
714
+ <h4 class="tracking-number h4-heading" style=""><?php _e( 'Tracking Details', 'woo-advanced-shipment-tracking' ); ?></h4>
 
 
 
 
 
715
  <?php } ?>
716
  </div>
717
+ <?php if( sizeof($trackind_detail_by_status_rev) > 0 ){
718
+ //echo '<pre>';print_r($trackind_detail_by_status_rev);echo '</pre>';
719
+ ?>
720
+ <table class="tracking-table">
721
+ <tbody>
722
+ <?php
723
+ $i=0;
724
+ foreach($trackind_detail_by_status_rev as $key=>$status_detail){ ?>
725
+ <tr>
726
+ <td><?php echo date("F d, Y",strtotime($status_detail->datetime)); ?> <?php echo date("g:i a", strtotime($status_detail->datetime)); ?></td>
727
+ <td><?php echo apply_filters("trackship_status_filter",$key);?></td>
728
+ <td><?php echo $status_detail->message; ?></td>
729
+ </tr>
730
+ <?php }
731
+ ?>
732
+ </tbody>
733
+ </table>
734
+ <?php if(count($trackind_detail_by_status_rev) > 2){ ?>
735
+
736
+ <a class="view_table_rows" href="javaScript:void(0);"><?php _e( 'view more', 'woo-advanced-shipment-tracking' ); ?></a>
737
+ <a class="hide_table_rows" href="javaScript:void(0);"><?php _e( 'view less', 'woo-advanced-shipment-tracking' ); ?></a>
738
+ <?php } } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  </div>
740
+ </div>
741
  <?php } else{ ?>
742
  <div class="tracking-detail col">
743
  <h1 class="shipment_status_heading text-secondary text-center"><?php _e( 'Tracking&nbsp;#&nbsp;'.$tracking_number, 'woo-advanced-shipment-tracking' ); ?></h1>
774
  // print final date and time
775
  return $date;
776
  }
777
+
778
+ function preview_tracking_page(){
779
+ get_header();
780
+
781
+ $wc_ast_api_key = get_option('wc_ast_api_key');
782
+ $primary_color = get_option('wc_ast_select_primary_color');
783
+ $border_color = get_option('wc_ast_select_border_color');
784
+ ?>
785
+ <style>
786
+ <?php if($primary_color){ ?>
787
+ .bg-secondary{
788
+ background-color:<?php echo $primary_color; ?> !important;
789
+ }
790
+ .tracker-progress-bar-with-dots .secondary .dot {
791
+ border-color: <?php echo $primary_color; ?>;
792
+ }
793
+ .text-secondary{
794
+ color: <?php echo $primary_color; ?> !important;
795
+ }
796
+ .progress-bar.bg-secondary:before{
797
+ background-color: <?php echo $primary_color; ?>;
798
+ }
799
+ .tracking-number{
800
+ color: <?php echo $primary_color; ?> !important;
801
+ }
802
+ .view_table_rows,.hide_table_rows{
803
+ color: <?php echo $primary_color; ?> !important;
804
+ }
805
+ <?php } ?>
806
+ <?php if($border_color){ ?>
807
+ .col.tracking-detail{
808
+ border: 1px solid <?php echo $border_color; ?>;
809
+ }
810
+ <?php } ?>
811
+ </style>
812
+ <div class="tracking-detail col">
813
+ <div class="tracking-header">
814
+ <div class="col-md col-md-6">
815
+ Order: <span class="tracking-number">#4542</span><br>
816
+ Tracking: <span class="tracking-number">#9405511899561468285343</span>
817
+ <h1 class="shipment_status_heading text-success">Delivered</h1>
818
+ </div>
819
+ <div class="col-md col-md-6">
820
+ <div class="text-muted text-right">
821
+ Estimated Delivery Date: <span class="tracking-number">Friday, Jun 28</span>
822
+ </div>
823
+ </div>
824
+ </div>
825
+ <div class="status-section desktop-section">
826
+ <div class="tracker-progress-bar tracker-progress-bar-with-dots">
827
+ <div class="progress">
828
+ <div class="progress-bar bg-success" style=""></div>
829
+ </div>
830
+ <div style="background-color: transparent;" class="success">
831
+ <span class="dot state-0 pre_transit past-state"></span>
832
+ <span class="state-label past-state">
833
+ Pre Transit
834
+ </span>
835
+ <span class="dot state-1 in_transit past-state"></span>
836
+ <span class="state-label state-1 past-state">
837
+ In Transit
838
+ </span>
839
+ <span class="dot state-2 out_for_delivery past-state"></span>
840
+ <span class="state-label state-2 past-state">
841
+ Out for delivery
842
+ </span>
843
+ <span class="dot state-3 delivered current-state"></span>
844
+ <span class="state-label state-3 current-state">
845
+ Delivered </span>
846
+ </div>
847
+ </div>
848
+ </div>
849
+ <div class="status-section mobile-section">
850
+ <div class="tracker-progress-bar tracker-progress-bar-with-dots">
851
+ <div class="progress">
852
+ <div class="progress-bar bg-success" style=""></div>
853
+ </div>
854
+ <div style="background-color: transparent;" class="success">
855
+ <div class="dot-div">
856
+ <span class="dot state-0 pre_transit past-state"></span>
857
+ <span class="state-label past-state">
858
+ Pre Transit
859
+ </span>
860
+ </div>
861
+ <div class="dot-div">
862
+ <span class="dot state-1 in_transit past-state"></span>
863
+ <span class="state-label state-1 past-state">
864
+ In Transit
865
+ </span>
866
+ </div>
867
+ <div class="dot-div">
868
+ <span class="dot state-2 out_for_delivery past-state"></span>
869
+ <span class="state-label state-2 past-state">
870
+ Out for delivery
871
+ </span>
872
+ </div>
873
+ <div class="dot-div">
874
+ <span class="dot state-3 delivered current-state"></span>
875
+ <span class="state-label state-3 current-state">
876
+ Delivered </span>
877
+ </div>
878
+ </div>
879
+ </div>
880
+ </div>
881
+ <div class="shipment_progress_div">
882
+ <div class="shipment_progress_heading_div">
883
+ <h4 class="tracking-number h4-heading">Tracking Details</h4>
884
+ </div>
885
+ <table class="tracking-table">
886
+ <tbody>
887
+ <tr>
888
+ <td>June 28, 2019 1:46 pm</td>
889
+ <td>Delivered</td>
890
+ <td>Delivered, Garage or Other Location at Address</td>
891
+ </tr>
892
+ <tr>
893
+ <td>June 28, 2019 8:31 am</td>
894
+ <td>Out for delivery</td>
895
+ <td>Out for Delivery</td>
896
+ </tr>
897
+ <tr style="display: none;">
898
+ <td>June 28, 2019 8:21 am</td>
899
+ <td>In Transit</td>
900
+ <td>Sorting Complete</td>
901
+ </tr>
902
+ </tbody>
903
+ </table>
904
+ <a class="view_table_rows" href="javaScript:void(0);" style="display: inline;">view more</a>
905
+ <a class="hide_table_rows" href="javaScript:void(0);" style="display: none;">view less</a>
906
+ </div>
907
+ </div>
908
+ <?php
909
+ $remove_trackship_branding = get_option('wc_ast_remove_trackship_branding');
910
+ if($remove_trackship_branding != 1){ ?>
911
+ <div class="trackship_branding">
912
+ <p>Shipment Tracking info by <a href="https://trackship.info" title="TrackShip" target="blank">TrackShip</a></p>
913
+ </div>
914
+ <?php }
915
+ get_footer();
916
+ exit;
917
+ }
918
  }
includes/class-wc-advanced-shipment-tracking-install.php CHANGED
@@ -54,9 +54,9 @@ class WC_Advanced_Shipment_Tracking_Install {
54
 
55
 
56
  add_action( 'init', array( $this, 'update_database_check'));
57
- //require_once( 'vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php' );
58
- //add_action( 'admin_init', array( 'PAnD', 'init' ) );
59
- //add_action( 'admin_notices', array( $this, 'admin_notice_after_update' ) );
60
  }
61
 
62
  /**
@@ -102,6 +102,7 @@ class WC_Advanced_Shipment_Tracking_Install {
102
  $sql = "CREATE TABLE $woo_shippment_table_name (
103
  id mediumint(9) NOT NULL AUTO_INCREMENT,
104
  provider_name varchar(500) DEFAULT '' NOT NULL,
 
105
  provider_url varchar(500) DEFAULT '' NOT NULL,
106
  shipping_country varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
107
  shipping_default tinyint(4) NOT NULL DEFAULT '0',
@@ -120,12 +121,13 @@ class WC_Advanced_Shipment_Tracking_Install {
120
  $shipping_provider['provider_name'];
121
  $success = $wpdb->insert($woo_shippment_table_name, array(
122
  "provider_name" => $shipping_provider['provider_name'],
 
123
  "provider_url" => $shipping_provider['provider_url'],
124
  "shipping_country" => $shipping_provider['shipping_country'],
125
  "shipping_default" => $shipping_provider['shipping_default'],
126
  ));
127
  }
128
- update_option( 'wc_advanced_shipment_tracking', '2.6');
129
  }
130
  }
131
  /**
@@ -137,13 +139,15 @@ class WC_Advanced_Shipment_Tracking_Install {
137
  $providers = array(
138
  0 => array (
139
  "provider_name" => 'Australia Post',
 
140
  "provider_url" => 'http://auspost.com.au/track/track.html?id=%number%',
141
  "shipping_country" => 'AU',
142
  "shipping_default" => '1'
143
  ),
144
 
145
  1 => array (
146
- "provider_name" => 'Fastway Couriers',
 
147
  "provider_url" => 'http://www.fastway.com.au/courier-services/track-your-parcel?l=%number%',
148
  "shipping_country" => 'AU',
149
  "shipping_default" => '1'
@@ -151,13 +155,15 @@ class WC_Advanced_Shipment_Tracking_Install {
151
 
152
  2 => array (
153
  "provider_name" => 'post.at',
 
154
  "provider_url" => 'http://www.post.at/sendungsverfolgung.php?pnum1=%number%',
155
  "shipping_country" => 'AT',
156
  "shipping_default" => '1'
157
  ),
158
 
159
  3 => array (
160
- "provider_name" => 'dhl.at',
 
161
  "provider_url" => 'http://www.dhl.at/content/at/de/express/sendungsverfolgung.html?brand=DHL&AWB=%number%',
162
  "shipping_country" => 'AT',
163
  "shipping_default" => '1'
@@ -165,20 +171,23 @@ class WC_Advanced_Shipment_Tracking_Install {
165
 
166
  4 => array (
167
  "provider_name" => 'DPD.at',
 
168
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?locale=de_AT&query=%number%',
169
  "shipping_country" => 'AT',
170
  "shipping_default" => '1'
171
  ),
172
 
173
  5 => array (
174
- "provider_name" => 'Correios',
 
175
  "provider_url" => 'http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=%number%',
176
  "shipping_country" => 'BR',
177
  "shipping_default" => '1'
178
  ),
179
 
180
  6 => array (
181
- "provider_name" => 'bpost',
 
182
  "provider_url" => 'https://track.bpost.be/btr/web/#/search?itemCode=%number%',
183
  "shipping_country" => 'BE',
184
  "shipping_default" => '1'
@@ -186,435 +195,725 @@ class WC_Advanced_Shipment_Tracking_Install {
186
 
187
  7 => array (
188
  "provider_name" => 'Canada Post',
 
189
  "provider_url" => 'http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?trackingNumber=%number%',
190
  "shipping_country" => 'CA',
191
  "shipping_default" => '1'
192
  ),
193
 
194
- 10 => array (
195
- "provider_name" => 'DHL.cz',
 
196
  "provider_url" => 'http://www.dhl.cz/cs/express/sledovani_zasilek.html?AWB=%number%',
197
  "shipping_country" => 'CZ',
198
  "shipping_default" => '1'
199
  ),
200
 
201
- 11 => array (
202
  "provider_name" => 'DPD.cz',
 
203
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?locale=cs_CZ&query=%number%',
204
  "shipping_country" => 'CZ',
205
  "shipping_default" => '1'
206
  ),
207
 
208
- 13 => array (
209
  "provider_name" => 'Colissimo',
210
- "provider_url" => 'http://www.colissimo.fr/portail_colissimo/suivre.do?language=fr_FR&colispart=%number%',
 
211
  "shipping_country" => 'FR',
212
  "shipping_default" => '1'
213
  ),
214
 
215
- 14 => array (
216
  "provider_name" => 'DHL Intraship (DE)',
 
217
  "provider_url" => 'http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%number%&rfn=&extendedSearch=true',
218
  "shipping_country" => 'DE',
219
  "shipping_default" => '1'
220
  ),
221
 
222
- 15 => array (
223
  "provider_name" => 'Hermes',
 
224
  "provider_url" => 'https://tracking.hermesworld.com/?TrackID=%number%',
225
  "shipping_country" => 'DE',
226
  "shipping_default" => '1'
227
  ),
228
 
229
- 16 => array (
230
  "provider_name" => 'Deutsche Post DHL',
 
231
  "provider_url" => 'http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%number%',
232
  "shipping_country" => 'DE',
233
  "shipping_default" => '1'
234
  ),
235
 
236
- 17 => array (
237
  "provider_name" => 'UPS Germany',
 
238
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=de_DE&InquiryNumber1=%number%',
239
  "shipping_country" => 'DE',
240
  "shipping_default" => '1'
241
  ),
242
 
243
- 18 => array (
244
  "provider_name" => 'DPD.de',
 
245
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?query=%number%&locale=en_DE',
246
  "shipping_country" => 'DE',
247
  "shipping_default" => '1'
248
  ),
249
 
250
- 19 => array (
251
  "provider_name" => 'DPD.ie',
 
252
  "provider_url" => 'http://www2.dpd.ie/Services/QuickTrack/tabid/222/ConsignmentID/%number%/Default.aspx',
253
  "shipping_country" => 'IE',
254
  "shipping_default" => '1'
255
  ),
256
 
257
- 20 => array (
258
- "provider_name" => 'An Post',
259
- "provider_url" => 'https://track.anpost.ie/TrackingResults.aspx?rtt=1&items=%number%',
260
- "shipping_country" => 'IE',
261
- "shipping_default" => '1'
262
- ),
263
-
264
- 20 => array (
265
  "provider_name" => 'DHL Express',
 
266
  "provider_url" => 'http://www.dhl.it/it/express/ricerca.html?AWB=%number%&brand=DHL',
267
- "shipping_country" => 'IT',
268
  "shipping_default" => '1'
269
  ),
270
 
271
- 22 => array (
272
  "provider_name" => 'PostNL',
 
273
  "provider_url" => 'https://mijnpakket.postnl.nl/Claim?Barcode=%number%&Postalcode=%2$s&Foreign=False&ShowAnonymousLayover=False&CustomerServiceClaim=False',
274
  "shipping_country" => 'NL',
275
  "shipping_default" => '1'
276
  ),
277
 
278
- 23 => array (
279
  "provider_name" => 'DPD.NL',
 
280
  "provider_url" => 'http://track.dpdnl.nl/?parcelnumber=%number%',
281
  "shipping_country" => 'NL',
282
  "shipping_default" => '1'
283
  ),
284
 
285
- 26 => array (
286
- "provider_name" => 'Fastways',
287
- "provider_url" => 'http://www.fastway.co.nz/courier-services/track-your-parcel?l=%number%',
 
288
  "shipping_country" => 'NZ',
289
  "shipping_default" => '1'
290
  ),
291
 
292
- 29 => array (
293
  "provider_name" => 'DPD Romania',
 
294
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?query=%number%&locale=ro_RO',
295
  "shipping_country" => 'RO',
296
  "shipping_default" => '1'
297
  ),
298
 
299
- 32 => array (
300
  "provider_name" => 'PostNord Sverige AB',
 
301
  "provider_url" => 'http://www.postnord.se/sv/verktyg/sok/Sidor/spara-brev-paket-och-pall.aspx?search=%number%',
302
  "shipping_country" => 'SE',
303
  "shipping_default" => '1'
304
  ),
305
 
306
- 33 => array (
307
- "provider_name" => 'DHL.se',
 
308
  "provider_url" => 'http://www.dhl.se/content/se/sv/express/godssoekning.shtml?brand=DHL&AWB=%number%',
309
  "shipping_country" => 'SE',
310
  "shipping_default" => '1'
311
  ),
312
 
313
- 35 => array (
314
  "provider_name" => 'UPS.se',
 
315
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/track?track=yes&loc=sv_SE&trackNums=%number%',
316
  "shipping_country" => 'SE',
317
  "shipping_default" => '1'
318
  ),
319
 
320
- 38 => array (
321
- "provider_name" => 'DHL',
 
322
  "provider_url" => 'http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=%number%',
323
  "shipping_country" => 'GB',
324
  "shipping_default" => '1'
325
  ),
326
 
327
- 39 => array (
328
  "provider_name" => 'DPD.co.uk',
 
329
  "provider_url" => 'http://www.dpd.co.uk/tracking/trackingSearch.do?search.searchType=0&search.parcelNumber=%number%',
330
  "shipping_country" => 'GB',
331
  "shipping_default" => '1'
332
  ),
333
 
334
- 40 => array (
335
  "provider_name" => 'InterLink',
 
336
  "provider_url" => 'http://www.interlinkexpress.com/apps/tracking/?reference=%number%&postcode=%2$s#results',
337
  "shipping_country" => 'GB',
338
  "shipping_default" => '1'
339
  ),
340
 
341
- 41 => array (
342
  "provider_name" => 'ParcelForce',
 
343
  "provider_url" => 'http://www.parcelforce.com/portal/pw/track?trackNumber=%number%',
344
  "shipping_country" => 'GB',
345
  "shipping_default" => '1'
346
  ),
347
 
348
- 42 => array (
349
  "provider_name" => 'Royal Mail',
 
350
  "provider_url" => 'https://www.royalmail.com/track-your-item/?trackNumber=%number%',
351
  "shipping_country" => 'GB',
352
  "shipping_default" => '1'
353
  ),
354
 
355
- 45 => array (
356
  "provider_name" => 'Fedex',
 
357
  "provider_url" => 'http://www.fedex.com/Tracking?action=track&tracknumbers=%number%',
358
  "shipping_country" => 'US',
359
  "shipping_default" => '1'
360
  ),
361
 
362
- 46 => array (
363
  "provider_name" => 'FedEx Sameday',
 
364
  "provider_url" => 'https://www.fedexsameday.com/fdx_dotracking_ua.aspx?tracknum=%number%',
365
  "shipping_country" => 'US',
366
  "shipping_default" => '1'
367
  ),
368
 
369
- 47 => array (
370
  "provider_name" => 'OnTrac',
 
371
  "provider_url" => 'http://www.ontrac.com/trackingdetail.asp?tracking=%number%',
372
  "shipping_country" => 'US',
373
  "shipping_default" => '1'
374
  ),
375
 
376
- 48 => array (
377
  "provider_name" => 'UPS',
 
378
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=%number%',
379
  "shipping_country" => 'US',
380
  "shipping_default" => '1'
381
  ),
382
 
383
- 49 => array (
384
  "provider_name" => 'USPS',
 
385
  "provider_url" => 'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=%number%',
386
  "shipping_country" => 'US',
387
  "shipping_default" => '1'
388
  ),
389
 
390
- 50 => array (
391
  "provider_name" => 'DHL US',
 
392
  "provider_url" => 'https://www.logistics.dhl/us-en/home/tracking/tracking-ecommerce.html?tracking-id=%number%',
393
  "shipping_country" => 'US',
394
  "shipping_default" => '1'
395
  ),
396
 
397
- 51 => array (
398
  "provider_name" => 'LaserShip',
 
399
  "provider_url" => 'https://www.lasership.com/track.php?track_number_input=%number%',
400
  "shipping_country" => 'US',
401
  "shipping_default" => '1'
402
  ),
403
- 52 => array (
404
  "provider_name" => 'GSO',
 
405
  "provider_url" => 'https://www.gso.com/tracking',
406
  "shipping_country" => 'US',
407
  "shipping_default" => '1'
408
  ),
409
- 53 => array (
410
  "provider_name" => 'ABF',
 
411
  "provider_url" => 'https://arcb.com/tools/tracking.html',
412
  "shipping_country" => 'IN',
413
  "shipping_default" => '1'
414
  ),
415
- 54 => array (
416
  "provider_name" => 'Associated Global Systems',
 
417
  "provider_url" => 'https://tracking.agsystems.com/',
418
  "shipping_country" => 'US',
419
  "shipping_default" => '1'
420
  ),
421
- 55 => array (
422
  "provider_name" => 'APC',
 
423
  "provider_url" => 'https://us.mytracking.net/APC/track/TrackDetails.aspx?t=%number%',
424
  "shipping_country" => 'US',
425
  "shipping_default" => '1'
426
  ),
427
- 56 => array (
428
  "provider_name" => 'ArrowXL',
 
429
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
430
  "shipping_country" => 'GB',
431
  "shipping_default" => '1'
432
  ),
433
- 57 => array (
434
  "provider_name" => 'Dai Post',
 
435
  "provider_url" => 'https://daiglobaltrack.com/tracking.aspx?custtracknbr=%number%',
436
  "shipping_country" => 'AU',
437
  "shipping_default" => '1'
438
  ),
439
- 59 => array (
440
  "provider_name" => 'Deliv',
 
441
  "provider_url" => 'https://tracking.deliv.co/',
442
  "shipping_country" => 'US',
443
  "shipping_default" => '1'
444
  ),
445
- 60 => array (
446
  "provider_name" => 'India Post',
 
447
  "provider_url" => 'https://www.indiapost.gov.in/_layouts/15/dop.portal.tracking/trackconsignment.aspx',
448
  "shipping_country" => 'IN',
449
  "shipping_default" => '1'
450
  ),
451
- 61 => array (
452
  "provider_name" => 'Israel Post',
 
453
  "provider_url" => 'https://mypost.israelpost.co.il/itemtrace?itemcode=%number%',
454
  "shipping_country" => 'IL',
455
  "shipping_default" => '1'
456
  ),
457
- 62 => array (
458
  "provider_name" => 'Boxberry',
 
459
  "provider_url" => 'https://boxberry.ru/tracking/',
460
  "shipping_country" => 'RU',
461
  "shipping_default" => '1'
462
  ),
463
- 63 => array (
464
  "provider_name" => 'Canpar',
 
465
  "provider_url" => 'https://www.canpar.ca/en/track/tracking.jsp',
466
  "shipping_country" => 'CA',
467
  "shipping_default" => '1'
468
  ),
469
- 64 => array (
470
  "provider_name" => 'China Post',
 
471
  "provider_url" => 'http://parcelsapp.com/en/tracking/%number%',
472
  "shipping_country" => 'CN',
473
  "shipping_default" => '1'
474
  ),
475
- 65 => array (
476
  "provider_name" => 'Chronopost',
 
477
  "provider_url" => 'https://www.chronopost.fr/fr/chrono_suivi_search?listeNumerosLT=%number%',
478
  "shipping_country" => 'FR',
479
  "shipping_default" => '1'
480
  ),
481
- 66 => array (
482
  "provider_name" => 'Colis Privé',
 
483
  "provider_url" => 'https://www.colisprive.fr/',
484
  "shipping_country" => 'FR',
485
  "shipping_default" => '1'
486
  ),
487
- 67 => array (
488
  "provider_name" => 'Correos Chile',
489
- "provider_url" => 'https://www.correos.cl/SitePages/seguimiento/seguimiento.aspx?envio=%number%',
 
490
  "shipping_country" => 'CL',
491
  "shipping_default" => '1'
492
  ),
493
- 68 => array (
494
  "provider_name" => 'Correos Costa Rica',
 
495
  "provider_url" => 'https://www.correos.go.cr/rastreo/consulta_envios/rastreo.aspx',
496
  "shipping_country" => 'CR',
497
  "shipping_default" => '1'
498
  ),
499
- 69 => array (
500
  "provider_name" => 'CouriersPlease',
 
501
  "provider_url" => 'https://www.couriersplease.com.au/tools-track/no/%number%',
502
  "shipping_country" => 'AU',
503
  "shipping_default" => '1'
504
  ),
505
- 70 => array (
506
  "provider_name" => 'Delhivery',
 
507
  "provider_url" => 'https://www.delhivery.com/track/package/%number%',
508
  "shipping_country" => 'IN',
509
  "shipping_default" => '1'
510
  ),
511
- 71 => array (
512
  "provider_name" => 'Deutsche Post',
 
513
  "provider_url" => 'https://www.deutschepost.de/sendung/simpleQuery.html',
514
  "shipping_country" => 'DE',
515
  "shipping_default" => '1'
516
  ),
517
- 72 => array (
518
  "provider_name" => 'Direct Link',
 
519
  "provider_url" => 'https://tracking.directlink.com/?itemNumber=%number%',
520
  "shipping_country" => 'DE',
521
  "shipping_default" => '1'
522
  ),
523
- 73 => array (
524
  "provider_name" => 'EC Firstclass',
 
525
  "provider_url" => 'http://www.ec-firstclass.org/Details.aspx',
526
  "shipping_country" => 'US',
527
  "shipping_default" => '1'
528
  ),
529
- 74 => array (
530
  "provider_name" => 'Ecom Express',
 
531
  "provider_url" => 'https://ecomexpress.in/tracking/?tflag=0&awb_field=%number%',
532
  "shipping_country" => 'IN',
533
  "shipping_default" => '1'
534
  ),
535
- 75 => array (
536
  "provider_name" => 'EMS',
 
537
  "provider_url" => 'https://www.ems.post/en/global-network/tracking',
538
  "shipping_country" => 'CN',
539
  "shipping_default" => '1'
540
  ),
541
- 77 => array (
542
  "provider_name" => 'Hong Kong Post',
 
543
  "provider_url" => 'https://www.hongkongpost.hk/en/mail_tracking/index.html',
544
  "shipping_country" => 'HK',
545
  "shipping_default" => '1'
546
  ),
547
- 78 => array (
548
  "provider_name" => 'JP Post',
 
549
  "provider_url" => 'https://trackings.post.japanpost.jp/services/srv/sequenceNoSearch/?requestNo=%number%&count=100&sequenceNoSearch.x=94&sequenceNoSearch.y=10&locale=en',
550
  "shipping_country" => 'JP',
551
  "shipping_default" => '1'
552
  ),
553
- 79 => array (
554
  "provider_name" => 'La Poste',
 
555
  "provider_url" => 'https://www.laposte.fr/particulier/outils/en/track-a-parcel',
556
  "shipping_country" => 'FR',
557
  "shipping_default" => '1'
558
  ),
559
- 80 => array (
560
  "provider_name" => 'Latvijas Pasts',
 
561
  "provider_url" => 'https://www.pasts.lv/en/Category/Tracking_of_Postal_Items/',
562
  "shipping_country" => 'LV',
563
  "shipping_default" => '1'
564
  ),
565
- 81 => array (
566
  "provider_name" => 'Ninja Van',
 
567
  "provider_url" => 'https://www.ninjavan.co/en-sg/?tracking_id=%number%',
568
  "shipping_country" => 'SG',
569
  "shipping_default" => '1'
570
  ),
571
- 82 => array (
572
  "provider_name" => 'Singapore Post',
 
573
  "provider_url" => 'https://www.singpost.com/track-items',
574
  "shipping_country" => 'SG',
575
  "shipping_default" => '1'
576
  ),
577
- 83 => array (
578
  "provider_name" => 'StarTrack',
 
579
  "provider_url" => 'https://sttrackandtrace.startrack.com.au/%number%',
580
  "shipping_country" => 'AU',
581
  "shipping_default" => '1'
582
  ),
583
- 84 => array (
584
  "provider_name" => 'Ukrposhta',
 
585
  "provider_url" => 'http://ukrposhta.ua/en/vidslidkuvati-forma-poshuku',
586
  "shipping_country" => 'UA',
587
  "shipping_default" => '1'
588
  ),
589
- 85 => array (
590
  "provider_name" => 'UPS i-parcel',
 
591
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
592
  "shipping_country" => 'US',
593
  "shipping_default" => '1'
594
  ),
595
- 86 => array (
596
  "provider_name" => 'DTDC',
 
597
  "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=%number%&TrkType2=awb_no',
598
  "shipping_country" => 'IN',
599
  "shipping_default" => '1'
600
  ),
601
- 87 => array (
602
  "provider_name" => 'DHL Parcel',
 
603
  "provider_url" => 'https://www.logistics.dhl/us-en/home/tracking/tracking-ecommerce.html?tracking-id=%number%',
604
  "shipping_country" => 'US',
605
  "shipping_default" => '1'
606
  ),
607
- 88 => array (
608
  "provider_name" => 'An Post',
 
609
  "provider_url" => 'https://www.anpost.com/Post-Parcels/Track/History?item=%number%',
610
  "shipping_country" => 'IE',
611
  "shipping_default" => '1'
612
  ),
613
- 89 => array (
614
  "provider_name" => 'Mondial Relay',
615
- "provider_url" => 'https://www.mondialrelay.fr/suivi-de-colis?codeMarque=CC&numeroExpedition=%number%',
 
616
  "shipping_country" => 'FR',
617
  "shipping_default" => '1'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  ),
619
  );
620
  return $providers;
@@ -772,26 +1071,383 @@ class WC_Advanced_Shipment_Tracking_Install {
772
  ));
773
  update_option( 'wc_advanced_shipment_tracking', '2.7');
774
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  }
776
  }
777
  /*
778
  * Display admin notice on plugin install or update
779
  */
780
  public function admin_notice_after_update(){
781
- if ( ! PAnD::is_admin_notice_active( 'disable-done-notice-forever-1.9.2.4' ) ) {
782
  return;
783
  }
784
  ?>
785
- <div data-dismissible="disable-done-notice-forever-1.9.2.4" class="updated notice notice-success is-dismissible">
786
  <p>
787
  <?php
788
  printf(
789
- esc_html__( '%1$s %2$s.' ),
790
- esc_html__( 'Now, you can change (and preview) the style of the shipment tracking display on order email and customer account. setup your design', 'woo-advanced-shipment-tracking' ),
791
  sprintf(
792
- '<a href="%s">%s</a>',
793
- esc_url( admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' ) ),
794
- esc_html__( 'Settings', 'woo-advanced-shipment-tracking' )
795
  )
796
  );
797
  ?>
54
 
55
 
56
  add_action( 'init', array( $this, 'update_database_check'));
57
+ require_once( 'vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php' );
58
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
59
+ add_action( 'admin_notices', array( $this, 'admin_notice_after_update' ) );
60
  }
61
 
62
  /**
102
  $sql = "CREATE TABLE $woo_shippment_table_name (
103
  id mediumint(9) NOT NULL AUTO_INCREMENT,
104
  provider_name varchar(500) DEFAULT '' NOT NULL,
105
+ ts_slug text NULL DEFAULT NULL,
106
  provider_url varchar(500) DEFAULT '' NOT NULL,
107
  shipping_country varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
108
  shipping_default tinyint(4) NOT NULL DEFAULT '0',
121
  $shipping_provider['provider_name'];
122
  $success = $wpdb->insert($woo_shippment_table_name, array(
123
  "provider_name" => $shipping_provider['provider_name'],
124
+ "ts_slug" => $shipping_provider['ts_slug'],
125
  "provider_url" => $shipping_provider['provider_url'],
126
  "shipping_country" => $shipping_provider['shipping_country'],
127
  "shipping_default" => $shipping_provider['shipping_default'],
128
  ));
129
  }
130
+ update_option( 'wc_advanced_shipment_tracking', '2.9');
131
  }
132
  }
133
  /**
139
  $providers = array(
140
  0 => array (
141
  "provider_name" => 'Australia Post',
142
+ "ts_slug" => 'australia-post',
143
  "provider_url" => 'http://auspost.com.au/track/track.html?id=%number%',
144
  "shipping_country" => 'AU',
145
  "shipping_default" => '1'
146
  ),
147
 
148
  1 => array (
149
+ "provider_name" => 'Fastway AU',
150
+ "ts_slug" => 'fastway-au',
151
  "provider_url" => 'http://www.fastway.com.au/courier-services/track-your-parcel?l=%number%',
152
  "shipping_country" => 'AU',
153
  "shipping_default" => '1'
155
 
156
  2 => array (
157
  "provider_name" => 'post.at',
158
+ "ts_slug" => 'post-at',
159
  "provider_url" => 'http://www.post.at/sendungsverfolgung.php?pnum1=%number%',
160
  "shipping_country" => 'AT',
161
  "shipping_default" => '1'
162
  ),
163
 
164
  3 => array (
165
+ "provider_name" => 'DHL at',
166
+ "ts_slug" => 'dhl-at',
167
  "provider_url" => 'http://www.dhl.at/content/at/de/express/sendungsverfolgung.html?brand=DHL&AWB=%number%',
168
  "shipping_country" => 'AT',
169
  "shipping_default" => '1'
171
 
172
  4 => array (
173
  "provider_name" => 'DPD.at',
174
+ "ts_slug" => 'dpd-at',
175
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?locale=de_AT&query=%number%',
176
  "shipping_country" => 'AT',
177
  "shipping_default" => '1'
178
  ),
179
 
180
  5 => array (
181
+ "provider_name" => 'Brazil Correios',
182
+ "ts_slug" => 'brazil-correios',
183
  "provider_url" => 'http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=%number%',
184
  "shipping_country" => 'BR',
185
  "shipping_default" => '1'
186
  ),
187
 
188
  6 => array (
189
+ "provider_name" => 'Belgium Post',
190
+ "ts_slug" => 'belgium-post',
191
  "provider_url" => 'https://track.bpost.be/btr/web/#/search?itemCode=%number%',
192
  "shipping_country" => 'BE',
193
  "shipping_default" => '1'
195
 
196
  7 => array (
197
  "provider_name" => 'Canada Post',
198
+ "ts_slug" => 'canada-post',
199
  "provider_url" => 'http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?trackingNumber=%number%',
200
  "shipping_country" => 'CA',
201
  "shipping_default" => '1'
202
  ),
203
 
204
+ 8 => array (
205
+ "provider_name" => 'DHL cz',
206
+ "ts_slug" => 'dhl-cz',
207
  "provider_url" => 'http://www.dhl.cz/cs/express/sledovani_zasilek.html?AWB=%number%',
208
  "shipping_country" => 'CZ',
209
  "shipping_default" => '1'
210
  ),
211
 
212
+ 9 => array (
213
  "provider_name" => 'DPD.cz',
214
+ "ts_slug" => 'dpd-cz',
215
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?locale=cs_CZ&query=%number%',
216
  "shipping_country" => 'CZ',
217
  "shipping_default" => '1'
218
  ),
219
 
220
+ 10 => array (
221
  "provider_name" => 'Colissimo',
222
+ "ts_slug" => 'colissimo',
223
+ "provider_url" => 'https://www.laposte.fr/outils/suivre-vos-envois?code=%number%',
224
  "shipping_country" => 'FR',
225
  "shipping_default" => '1'
226
  ),
227
 
228
+ 11 => array (
229
  "provider_name" => 'DHL Intraship (DE)',
230
+ "ts_slug" => 'dhl-intraship-de',
231
  "provider_url" => 'http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%number%&rfn=&extendedSearch=true',
232
  "shipping_country" => 'DE',
233
  "shipping_default" => '1'
234
  ),
235
 
236
+ 12 => array (
237
  "provider_name" => 'Hermes',
238
+ "ts_slug" => 'hermes',
239
  "provider_url" => 'https://tracking.hermesworld.com/?TrackID=%number%',
240
  "shipping_country" => 'DE',
241
  "shipping_default" => '1'
242
  ),
243
 
244
+ 13 => array (
245
  "provider_name" => 'Deutsche Post DHL',
246
+ "ts_slug" => 'deutsche-post-dhl',
247
  "provider_url" => 'http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%number%',
248
  "shipping_country" => 'DE',
249
  "shipping_default" => '1'
250
  ),
251
 
252
+ 14 => array (
253
  "provider_name" => 'UPS Germany',
254
+ "ts_slug" => 'ups-germany',
255
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=de_DE&InquiryNumber1=%number%',
256
  "shipping_country" => 'DE',
257
  "shipping_default" => '1'
258
  ),
259
 
260
+ 15 => array (
261
  "provider_name" => 'DPD.de',
262
+ "ts_slug" => 'dpd-de',
263
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?query=%number%&locale=en_DE',
264
  "shipping_country" => 'DE',
265
  "shipping_default" => '1'
266
  ),
267
 
268
+ 16 => array (
269
  "provider_name" => 'DPD.ie',
270
+ "ts_slug" => 'dpd-ie',
271
  "provider_url" => 'http://www2.dpd.ie/Services/QuickTrack/tabid/222/ConsignmentID/%number%/Default.aspx',
272
  "shipping_country" => 'IE',
273
  "shipping_default" => '1'
274
  ),
275
 
276
+ 17 => array (
 
 
 
 
 
 
 
277
  "provider_name" => 'DHL Express',
278
+ "ts_slug" => 'dhl-express',
279
  "provider_url" => 'http://www.dhl.it/it/express/ricerca.html?AWB=%number%&brand=DHL',
280
+ "shipping_country" => 'Global',
281
  "shipping_default" => '1'
282
  ),
283
 
284
+ 18 => array (
285
  "provider_name" => 'PostNL',
286
+ "ts_slug" => 'postnl',
287
  "provider_url" => 'https://mijnpakket.postnl.nl/Claim?Barcode=%number%&Postalcode=%2$s&Foreign=False&ShowAnonymousLayover=False&CustomerServiceClaim=False',
288
  "shipping_country" => 'NL',
289
  "shipping_default" => '1'
290
  ),
291
 
292
+ 19 => array (
293
  "provider_name" => 'DPD.NL',
294
+ "ts_slug" => 'dpd-nl',
295
  "provider_url" => 'http://track.dpdnl.nl/?parcelnumber=%number%',
296
  "shipping_country" => 'NL',
297
  "shipping_default" => '1'
298
  ),
299
 
300
+ 20 => array (
301
+ "provider_name" => 'Fastway NZ',
302
+ "ts_slug" => 'fastway-nz',
303
+ "provider_url" => 'https://www.fastway.co.nz/tools/track?l=%number%',
304
  "shipping_country" => 'NZ',
305
  "shipping_default" => '1'
306
  ),
307
 
308
+ 21 => array (
309
  "provider_name" => 'DPD Romania',
310
+ "ts_slug" => 'dpd-romania',
311
  "provider_url" => 'https://tracking.dpd.de/parcelstatus?query=%number%&locale=ro_RO',
312
  "shipping_country" => 'RO',
313
  "shipping_default" => '1'
314
  ),
315
 
316
+ 22 => array (
317
  "provider_name" => 'PostNord Sverige AB',
318
+ "ts_slug" => 'postnord-sverige-ab',
319
  "provider_url" => 'http://www.postnord.se/sv/verktyg/sok/Sidor/spara-brev-paket-och-pall.aspx?search=%number%',
320
  "shipping_country" => 'SE',
321
  "shipping_default" => '1'
322
  ),
323
 
324
+ 23 => array (
325
+ "provider_name" => 'DHL se',
326
+ "ts_slug" => 'dhl-se',
327
  "provider_url" => 'http://www.dhl.se/content/se/sv/express/godssoekning.shtml?brand=DHL&AWB=%number%',
328
  "shipping_country" => 'SE',
329
  "shipping_default" => '1'
330
  ),
331
 
332
+ 24 => array (
333
  "provider_name" => 'UPS.se',
334
+ "ts_slug" => 'ups-se',
335
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/track?track=yes&loc=sv_SE&trackNums=%number%',
336
  "shipping_country" => 'SE',
337
  "shipping_default" => '1'
338
  ),
339
 
340
+ 25 => array (
341
+ "provider_name" => 'DHL uk',
342
+ "ts_slug" => 'dhl-uk',
343
  "provider_url" => 'http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=%number%',
344
  "shipping_country" => 'GB',
345
  "shipping_default" => '1'
346
  ),
347
 
348
+ 26 => array (
349
  "provider_name" => 'DPD.co.uk',
350
+ "ts_slug" => 'dpd-co-uk',
351
  "provider_url" => 'http://www.dpd.co.uk/tracking/trackingSearch.do?search.searchType=0&search.parcelNumber=%number%',
352
  "shipping_country" => 'GB',
353
  "shipping_default" => '1'
354
  ),
355
 
356
+ 27 => array (
357
  "provider_name" => 'InterLink',
358
+ "ts_slug" => 'interlink',
359
  "provider_url" => 'http://www.interlinkexpress.com/apps/tracking/?reference=%number%&postcode=%2$s#results',
360
  "shipping_country" => 'GB',
361
  "shipping_default" => '1'
362
  ),
363
 
364
+ 28 => array (
365
  "provider_name" => 'ParcelForce',
366
+ "ts_slug" => 'parcelforce',
367
  "provider_url" => 'http://www.parcelforce.com/portal/pw/track?trackNumber=%number%',
368
  "shipping_country" => 'GB',
369
  "shipping_default" => '1'
370
  ),
371
 
372
+ 29 => array (
373
  "provider_name" => 'Royal Mail',
374
+ "ts_slug" => 'royal-mail',
375
  "provider_url" => 'https://www.royalmail.com/track-your-item/?trackNumber=%number%',
376
  "shipping_country" => 'GB',
377
  "shipping_default" => '1'
378
  ),
379
 
380
+ 30 => array (
381
  "provider_name" => 'Fedex',
382
+ "ts_slug" => 'fedex',
383
  "provider_url" => 'http://www.fedex.com/Tracking?action=track&tracknumbers=%number%',
384
  "shipping_country" => 'US',
385
  "shipping_default" => '1'
386
  ),
387
 
388
+ 31 => array (
389
  "provider_name" => 'FedEx Sameday',
390
+ "ts_slug" => 'fedex-sameday',
391
  "provider_url" => 'https://www.fedexsameday.com/fdx_dotracking_ua.aspx?tracknum=%number%',
392
  "shipping_country" => 'US',
393
  "shipping_default" => '1'
394
  ),
395
 
396
+ 32 => array (
397
  "provider_name" => 'OnTrac',
398
+ "ts_slug" => 'ontrac',
399
  "provider_url" => 'http://www.ontrac.com/trackingdetail.asp?tracking=%number%',
400
  "shipping_country" => 'US',
401
  "shipping_default" => '1'
402
  ),
403
 
404
+ 33 => array (
405
  "provider_name" => 'UPS',
406
+ "ts_slug" => 'ups',
407
  "provider_url" => 'http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=%number%',
408
  "shipping_country" => 'US',
409
  "shipping_default" => '1'
410
  ),
411
 
412
+ 34 => array (
413
  "provider_name" => 'USPS',
414
+ "ts_slug" => 'usps',
415
  "provider_url" => 'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=%number%',
416
  "shipping_country" => 'US',
417
  "shipping_default" => '1'
418
  ),
419
 
420
+ 35 => array (
421
  "provider_name" => 'DHL US',
422
+ "ts_slug" => 'dhl-us',
423
  "provider_url" => 'https://www.logistics.dhl/us-en/home/tracking/tracking-ecommerce.html?tracking-id=%number%',
424
  "shipping_country" => 'US',
425
  "shipping_default" => '1'
426
  ),
427
 
428
+ 36 => array (
429
  "provider_name" => 'LaserShip',
430
+ "ts_slug" => 'lasership',
431
  "provider_url" => 'https://www.lasership.com/track.php?track_number_input=%number%',
432
  "shipping_country" => 'US',
433
  "shipping_default" => '1'
434
  ),
435
+ 37 => array (
436
  "provider_name" => 'GSO',
437
+ "ts_slug" => 'gso',
438
  "provider_url" => 'https://www.gso.com/tracking',
439
  "shipping_country" => 'US',
440
  "shipping_default" => '1'
441
  ),
442
+ 38 => array (
443
  "provider_name" => 'ABF',
444
+ "ts_slug" => 'abf',
445
  "provider_url" => 'https://arcb.com/tools/tracking.html',
446
  "shipping_country" => 'IN',
447
  "shipping_default" => '1'
448
  ),
449
+ 39 => array (
450
  "provider_name" => 'Associated Global Systems',
451
+ "ts_slug" => 'associated-global-systems',
452
  "provider_url" => 'https://tracking.agsystems.com/',
453
  "shipping_country" => 'US',
454
  "shipping_default" => '1'
455
  ),
456
+ 40 => array (
457
  "provider_name" => 'APC',
458
+ "ts_slug" => 'apc',
459
  "provider_url" => 'https://us.mytracking.net/APC/track/TrackDetails.aspx?t=%number%',
460
  "shipping_country" => 'US',
461
  "shipping_default" => '1'
462
  ),
463
+ 41 => array (
464
  "provider_name" => 'ArrowXL',
465
+ "ts_slug" => 'arrowxl',
466
  "provider_url" => 'https://askaxl.co.uk/tracking?upi=%number%',
467
  "shipping_country" => 'GB',
468
  "shipping_default" => '1'
469
  ),
470
+ 42 => array (
471
  "provider_name" => 'Dai Post',
472
+ "ts_slug" => 'dai-post',
473
  "provider_url" => 'https://daiglobaltrack.com/tracking.aspx?custtracknbr=%number%',
474
  "shipping_country" => 'AU',
475
  "shipping_default" => '1'
476
  ),
477
+ 43 => array (
478
  "provider_name" => 'Deliv',
479
+ "ts_slug" => 'deliv',
480
  "provider_url" => 'https://tracking.deliv.co/',
481
  "shipping_country" => 'US',
482
  "shipping_default" => '1'
483
  ),
484
+ 44 => array (
485
  "provider_name" => 'India Post',
486
+ "ts_slug" => 'india-post',
487
  "provider_url" => 'https://www.indiapost.gov.in/_layouts/15/dop.portal.tracking/trackconsignment.aspx',
488
  "shipping_country" => 'IN',
489
  "shipping_default" => '1'
490
  ),
491
+ 45 => array (
492
  "provider_name" => 'Israel Post',
493
+ "ts_slug" => 'israel-post',
494
  "provider_url" => 'https://mypost.israelpost.co.il/itemtrace?itemcode=%number%',
495
  "shipping_country" => 'IL',
496
  "shipping_default" => '1'
497
  ),
498
+ 46 => array (
499
  "provider_name" => 'Boxberry',
500
+ "ts_slug" => 'boxberry',
501
  "provider_url" => 'https://boxberry.ru/tracking/',
502
  "shipping_country" => 'RU',
503
  "shipping_default" => '1'
504
  ),
505
+ 47 => array (
506
  "provider_name" => 'Canpar',
507
+ "ts_slug" => 'canpar',
508
  "provider_url" => 'https://www.canpar.ca/en/track/tracking.jsp',
509
  "shipping_country" => 'CA',
510
  "shipping_default" => '1'
511
  ),
512
+ 48 => array (
513
  "provider_name" => 'China Post',
514
+ "ts_slug" => 'china-post',
515
  "provider_url" => 'http://parcelsapp.com/en/tracking/%number%',
516
  "shipping_country" => 'CN',
517
  "shipping_default" => '1'
518
  ),
519
+ 49 => array (
520
  "provider_name" => 'Chronopost',
521
+ "ts_slug" => 'chronopost',
522
  "provider_url" => 'https://www.chronopost.fr/fr/chrono_suivi_search?listeNumerosLT=%number%',
523
  "shipping_country" => 'FR',
524
  "shipping_default" => '1'
525
  ),
526
+ 50 => array (
527
  "provider_name" => 'Colis Privé',
528
+ "ts_slug" => 'colis-prive',
529
  "provider_url" => 'https://www.colisprive.fr/',
530
  "shipping_country" => 'FR',
531
  "shipping_default" => '1'
532
  ),
533
+ 51 => array (
534
  "provider_name" => 'Correos Chile',
535
+ "ts_slug" => 'correos-chile',
536
+ "provider_url" => 'https://seguimientoenvio.correos.cl/home/index/%number%',
537
  "shipping_country" => 'CL',
538
  "shipping_default" => '1'
539
  ),
540
+ 52 => array (
541
  "provider_name" => 'Correos Costa Rica',
542
+ "ts_slug" => 'correos-costa-rica',
543
  "provider_url" => 'https://www.correos.go.cr/rastreo/consulta_envios/rastreo.aspx',
544
  "shipping_country" => 'CR',
545
  "shipping_default" => '1'
546
  ),
547
+ 53 => array (
548
  "provider_name" => 'CouriersPlease',
549
+ "ts_slug" => 'couriersplease',
550
  "provider_url" => 'https://www.couriersplease.com.au/tools-track/no/%number%',
551
  "shipping_country" => 'AU',
552
  "shipping_default" => '1'
553
  ),
554
+ 54 => array (
555
  "provider_name" => 'Delhivery',
556
+ "ts_slug" => 'delhivery',
557
  "provider_url" => 'https://www.delhivery.com/track/package/%number%',
558
  "shipping_country" => 'IN',
559
  "shipping_default" => '1'
560
  ),
561
+ 55 => array (
562
  "provider_name" => 'Deutsche Post',
563
+ "ts_slug" => 'deutsche-post',
564
  "provider_url" => 'https://www.deutschepost.de/sendung/simpleQuery.html',
565
  "shipping_country" => 'DE',
566
  "shipping_default" => '1'
567
  ),
568
+ 56 => array (
569
  "provider_name" => 'Direct Link',
570
+ "ts_slug" => 'direct-link',
571
  "provider_url" => 'https://tracking.directlink.com/?itemNumber=%number%',
572
  "shipping_country" => 'DE',
573
  "shipping_default" => '1'
574
  ),
575
+ 57 => array (
576
  "provider_name" => 'EC Firstclass',
577
+ "ts_slug" => 'ec-firstclass',
578
  "provider_url" => 'http://www.ec-firstclass.org/Details.aspx',
579
  "shipping_country" => 'US',
580
  "shipping_default" => '1'
581
  ),
582
+ 58 => array (
583
  "provider_name" => 'Ecom Express',
584
+ "ts_slug" => 'ecom-express',
585
  "provider_url" => 'https://ecomexpress.in/tracking/?tflag=0&awb_field=%number%',
586
  "shipping_country" => 'IN',
587
  "shipping_default" => '1'
588
  ),
589
+ 59 => array (
590
  "provider_name" => 'EMS',
591
+ "ts_slug" => 'ems',
592
  "provider_url" => 'https://www.ems.post/en/global-network/tracking',
593
  "shipping_country" => 'CN',
594
  "shipping_default" => '1'
595
  ),
596
+ 60 => array (
597
  "provider_name" => 'Hong Kong Post',
598
+ "ts_slug" => 'hong-kong-post',
599
  "provider_url" => 'https://www.hongkongpost.hk/en/mail_tracking/index.html',
600
  "shipping_country" => 'HK',
601
  "shipping_default" => '1'
602
  ),
603
+ 61 => array (
604
  "provider_name" => 'JP Post',
605
+ "ts_slug" => 'jp-post',
606
  "provider_url" => 'https://trackings.post.japanpost.jp/services/srv/sequenceNoSearch/?requestNo=%number%&count=100&sequenceNoSearch.x=94&sequenceNoSearch.y=10&locale=en',
607
  "shipping_country" => 'JP',
608
  "shipping_default" => '1'
609
  ),
610
+ 62 => array (
611
  "provider_name" => 'La Poste',
612
+ "ts_slug" => 'la-poste',
613
  "provider_url" => 'https://www.laposte.fr/particulier/outils/en/track-a-parcel',
614
  "shipping_country" => 'FR',
615
  "shipping_default" => '1'
616
  ),
617
+ 63 => array (
618
  "provider_name" => 'Latvijas Pasts',
619
+ "ts_slug" => 'latvijas-pasts',
620
  "provider_url" => 'https://www.pasts.lv/en/Category/Tracking_of_Postal_Items/',
621
  "shipping_country" => 'LV',
622
  "shipping_default" => '1'
623
  ),
624
+ 64 => array (
625
  "provider_name" => 'Ninja Van',
626
+ "ts_slug" => 'ninja-van',
627
  "provider_url" => 'https://www.ninjavan.co/en-sg/?tracking_id=%number%',
628
  "shipping_country" => 'SG',
629
  "shipping_default" => '1'
630
  ),
631
+ 65 => array (
632
  "provider_name" => 'Singapore Post',
633
+ "ts_slug" => 'singapore-post',
634
  "provider_url" => 'https://www.singpost.com/track-items',
635
  "shipping_country" => 'SG',
636
  "shipping_default" => '1'
637
  ),
638
+ 66 => array (
639
  "provider_name" => 'StarTrack',
640
+ "ts_slug" => 'startrack',
641
  "provider_url" => 'https://sttrackandtrace.startrack.com.au/%number%',
642
  "shipping_country" => 'AU',
643
  "shipping_default" => '1'
644
  ),
645
+ 67 => array (
646
  "provider_name" => 'Ukrposhta',
647
+ "ts_slug" => 'ukrposhta',
648
  "provider_url" => 'http://ukrposhta.ua/en/vidslidkuvati-forma-poshuku',
649
  "shipping_country" => 'UA',
650
  "shipping_default" => '1'
651
  ),
652
+ 68 => array (
653
  "provider_name" => 'UPS i-parcel',
654
+ "ts_slug" => 'ups-i-parcel',
655
  "provider_url" => 'https://tracking.i-parcel.com/?TrackingNumber=%number%',
656
  "shipping_country" => 'US',
657
  "shipping_default" => '1'
658
  ),
659
+ 69 => array (
660
  "provider_name" => 'DTDC',
661
+ "ts_slug" => 'dtdc',
662
  "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=%number%&TrkType2=awb_no',
663
  "shipping_country" => 'IN',
664
  "shipping_default" => '1'
665
  ),
666
+ 70 => array (
667
  "provider_name" => 'DHL Parcel',
668
+ "ts_slug" => 'dhl-parcel',
669
  "provider_url" => 'https://www.logistics.dhl/us-en/home/tracking/tracking-ecommerce.html?tracking-id=%number%',
670
  "shipping_country" => 'US',
671
  "shipping_default" => '1'
672
  ),
673
+ 71 => array (
674
  "provider_name" => 'An Post',
675
+ "ts_slug" => 'an-post',
676
  "provider_url" => 'https://www.anpost.com/Post-Parcels/Track/History?item=%number%',
677
  "shipping_country" => 'IE',
678
  "shipping_default" => '1'
679
  ),
680
+ 72 => array (
681
  "provider_name" => 'Mondial Relay',
682
+ "ts_slug" => 'mondial-relay',
683
+ "provider_url" => 'https://www.mondialrelay.fr/suivi-de-colis?numeroExpedition=%number%',
684
  "shipping_country" => 'FR',
685
  "shipping_default" => '1'
686
+ ),
687
+ 73 => array (
688
+ "provider_name" => 'Swiss Post',
689
+ "ts_slug" => 'swiss-post',
690
+ "provider_url" => 'https://service.post.ch/EasyTrack/submitParcelData.do?p_language=en&formattedParcelCodes=%number%',
691
+ "shipping_country" => 'CH',
692
+ "shipping_default" => '1'
693
+ ),
694
+ 74 => array (
695
+ "provider_name" => 'S.F Express',
696
+ "ts_slug" => 's-f-express',
697
+ "provider_url" => 'http://www.sf-express.com/cn/en/dynamic_function/waybill/#search/bill-number/%number%',
698
+ "shipping_country" => 'CN',
699
+ "shipping_default" => '1'
700
+ ),
701
+ 75 => array (
702
+ "provider_name" => 'ePacket',
703
+ "ts_slug" => 'epacket',
704
+ "provider_url" => 'http://www.ems.com.cn/english.html',
705
+ "shipping_country" => 'CN',
706
+ "shipping_default" => '1'
707
+ ),
708
+ 76 => array (
709
+ "provider_name" => 'DTDC Plus',
710
+ "ts_slug" => 'dtdc-plus',
711
+ "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=&TrkType2=awb_no',
712
+ "shipping_country" => 'IN',
713
+ "shipping_default" => '1'
714
+ ),
715
+ 77 => array (
716
+ "provider_name" => 'DHLParcel NL',
717
+ "ts_slug" => 'dhlparcel-nl',
718
+ "provider_url" => 'https://www.logistics.dhl/nl-en/home/tracking/tracking-parcel.html?tracking-id=%number%',
719
+ "shipping_country" => 'NL',
720
+ "shipping_default" => '1'
721
+ ),
722
+ 78 => array (
723
+ "provider_name" => 'TNT',
724
+ "ts_slug" => 'tnt',
725
+ "provider_url" => 'https://www.tnt.com/?searchType=con&cons=%number%',
726
+ "shipping_country" => 'US',
727
+ "shipping_default" => '1'
728
+ ),
729
+ 79 => array (
730
+ "provider_name" => 'Australia EMS',
731
+ "ts_slug" => 'australia-ems',
732
+ "provider_url" => 'https://auspost.com.au/mypost/track/#/details/%number%',
733
+ "shipping_country" => 'AU',
734
+ "shipping_default" => '1'
735
+ ),
736
+ 80 => array (
737
+ "provider_name" => 'Bangladesh EMS',
738
+ "ts_slug" => 'bangladesh-ems',
739
+ "provider_url" => 'http://www.bangladeshpost.gov.bd/tracking.html',
740
+ "shipping_country" => 'BD',
741
+ "shipping_default" => '1'
742
+ ),
743
+ 81 => array (
744
+ "provider_name" => 'Colombia Post',
745
+ "ts_slug" => 'colombia-post',
746
+ "provider_url" => 'http://www.4-72.com.co/',
747
+ "shipping_country" => 'CO',
748
+ "shipping_default" => '1'
749
+ ),
750
+ 82 => array (
751
+ "provider_name" => 'Costa Rica Post',
752
+ "ts_slug" => 'costa-rica-post',
753
+ "provider_url" => 'https://www.correos.go.cr/rastreo/consulta_envios/',
754
+ "shipping_country" => 'CR',
755
+ "shipping_default" => '1'
756
+ ),
757
+ 83 => array (
758
+ "provider_name" => 'Croatia Post',
759
+ "ts_slug" => 'croatia-post',
760
+ "provider_url" => 'https://www.posta.hr/tracktrace.aspx?broj=%number%',
761
+ "shipping_country" => 'HR',
762
+ "shipping_default" => '1'
763
+ ),
764
+ 84 => array (
765
+ "provider_name" => 'Cyprus Post',
766
+ "ts_slug" => 'cyprus-post',
767
+ "provider_url" => 'https://www.cypruspost.post/en/track-n-trace-results?code=%number%',
768
+ "shipping_country" => 'CY',
769
+ "shipping_default" => '1'
770
+ ),
771
+ 85 => array (
772
+ "provider_name" => 'Denmark Post',
773
+ "ts_slug" => 'denmark-post',
774
+ "provider_url" => 'https://www.postnord.dk/en/track-and-trace#dynamicloading=true&shipmentid=%number%',
775
+ "shipping_country" => 'DK',
776
+ "shipping_default" => '1'
777
+ ),
778
+ 86 => array (
779
+ "provider_name" => 'Estonia Post',
780
+ "ts_slug" => 'estonia-post',
781
+ "provider_url" => 'https://www.omniva.ee/private/track_and_trace',
782
+ "shipping_country" => 'EE',
783
+ "shipping_default" => '1'
784
+ ),
785
+ 87 => array (
786
+ "provider_name" => 'France EMS - Chronopost',
787
+ "ts_slug" => 'france-ems-chronopost',
788
+ "provider_url" => 'https://www.chronopost.fr/tracking-no-cms/suivi-page?listeNumerosLT=%number%',
789
+ "shipping_country" => 'FR',
790
+ "shipping_default" => '1'
791
+ ),
792
+ 88 => array (
793
+ "provider_name" => 'Ivory Coast EMS',
794
+ "ts_slug" => 'ivory-coast-ems',
795
+ "provider_url" => 'https://laposte.ci.post/tracking-colis?identifiant=%number%',
796
+ "shipping_country" => 'CI',
797
+ "shipping_default" => '1'
798
+ ),
799
+ 89 => array (
800
+ "provider_name" => 'Korea Post',
801
+ "ts_slug" => 'korea-post',
802
+ "provider_url" => 'https://service.epost.go.kr/trace.RetrieveEmsRigiTraceList.comm?ems_gubun=E&sid1=&POST_CODE=%number%',
803
+ "shipping_country" => 'KR',
804
+ "shipping_default" => '1'
805
+ ),
806
+ 90 => array (
807
+ "provider_name" => 'Monaco EMS',
808
+ "ts_slug" => 'monaco-ems',
809
+ "provider_url" => 'http://www.lapostemonaco.mc',
810
+ "shipping_country" => 'MC',
811
+ "shipping_default" => '1'
812
+ ),
813
+ 91 => array (
814
+ "provider_name" => 'Overseas Territory FR EMS',
815
+ "ts_slug" => 'overseas-territory-fr-ems',
816
+ "provider_url" => 'https://www.chronopost.fr/tracking-no-cms/suivi-page?listeNumerosLT=%number%',
817
+ "shipping_country" => 'FR',
818
+ "shipping_default" => '1'
819
+ ),
820
+ 92 => array (
821
+ "provider_name" => 'Portugal Post - CTT',
822
+ "ts_slug" => 'portugal-post-ctt',
823
+ "provider_url" => 'http://www.ctt.pt/feapl_2/app/open/objectSearch/objectSearch.jspx',
824
+ "shipping_country" => 'PT',
825
+ "shipping_default" => '1'
826
+ ),
827
+ 93 => array (
828
+ "provider_name" => 'South African Post Office',
829
+ "ts_slug" => 'south-african-post-office',
830
+ "provider_url" => 'http://www.southafricanpostoffice.post/index.html',
831
+ "shipping_country" => 'ZA',
832
+ "shipping_default" => '1'
833
+ ),
834
+ 94 => array (
835
+ "provider_name" => 'Ukraine EMS',
836
+ "ts_slug" => 'ukraine-ems',
837
+ "provider_url" => 'http://dpsz.ua/en/track/ems',
838
+ "shipping_country" => 'UA',
839
+ "shipping_default" => '1'
840
+ ),
841
+ 95 => array (
842
+ "provider_name" => 'TNT Italy',
843
+ "ts_slug" => 'tnt-italy',
844
+ "provider_url" => 'https://www.tnt.it/tracking/Tracking.do',
845
+ "shipping_country" => 'IT',
846
+ "shipping_default" => '1'
847
+ ),
848
+ 96 => array (
849
+ "provider_name" => 'TNT France',
850
+ "ts_slug" => 'tnt-france',
851
+ "provider_url" => 'https://www.tnt.fr/public/suivi_colis/recherche/visubontransport.do',
852
+ "shipping_country" => 'FR',
853
+ "shipping_default" => '1'
854
+ ),
855
+ 97 => array (
856
+ "provider_name" => 'TNT UK',
857
+ "ts_slug" => 'tnt-uk',
858
+ "provider_url" => 'https://www.tnt.com/?searchType=con&cons=%number%',
859
+ "shipping_country" => 'GB',
860
+ "shipping_default" => '1'
861
+ ),
862
+ 98 => array (
863
+ "provider_name" => 'Aliexpress Standard Shipping',
864
+ "ts_slug" => 'aliexpress-standard-shipping',
865
+ "provider_url" => 'https://global.cainiao.com/detail.htm?mailNoList=LP00139185155139',
866
+ "shipping_country" => 'Global',
867
+ "shipping_default" => '1'
868
+ ),
869
+ 99 => array (
870
+ "provider_name" => 'Speedex Courier',
871
+ "ts_slug" => 'speedex-courier',
872
+ "provider_url" => 'http://www.speedexcourier.com/',
873
+ "shipping_country" => 'US',
874
+ "shipping_default" => '1'
875
+ ),
876
+ 100 => array (
877
+ "provider_name" => 'TNT Reference',
878
+ "ts_slug" => 'tnt-reference',
879
+ "provider_url" => 'https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=%number%',
880
+ "shipping_country" => 'GB',
881
+ "shipping_default" => '1'
882
+ ),
883
+ 101 => array (
884
+ "provider_name" => 'TNT Click',
885
+ "ts_slug" => 'tnt-click',
886
+ "provider_url" => 'https://www.tnt-click.it/',
887
+ "shipping_country" => 'IT',
888
+ "shipping_default" => '1'
889
+ ),
890
+ 102 => array (
891
+ "provider_name" => 'TNT Australia',
892
+ "ts_slug" => 'tnt-australia',
893
+ "provider_url" => 'https://www.tnt.com/express/en_au/site/shipping-tools/tracking.html?respCountry=au&respLang=en&cons=%number%',
894
+ "shipping_country" => 'AU',
895
+ "shipping_default" => '1'
896
+ ),
897
+ 103 => array (
898
+ "provider_name" => 'DHL Freight',
899
+ "ts_slug" => 'dhl-freight',
900
+ "provider_url" => 'https://www.logistics.dhl/global-en/home/tracking/tracking-freight.html?tracking-id=%number%',
901
+ "shipping_country" => 'Global',
902
+ "shipping_default" => '1'
903
+ ),
904
+ 104 => array (
905
+ "provider_name" => 'Sendle',
906
+ "ts_slug" => 'sendle',
907
+ "provider_url" => 'https://track.sendle.com/tracking?ref=%number%',
908
+ "shipping_country" => 'AU',
909
+ "shipping_default" => '1'
910
+ ),
911
+ 105 => array (
912
+ "provider_name" => 'Deppon',
913
+ "ts_slug" => 'deppon',
914
+ "provider_url" => 'https://www.deppon.com/en/toTrack.action',
915
+ "shipping_country" => 'CN',
916
+ "shipping_default" => '1',
917
  ),
918
  );
919
  return $providers;
1071
  ));
1072
  update_option( 'wc_advanced_shipment_tracking', '2.7');
1073
  }
1074
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'2.8', '<') ){
1075
+ global $wpdb;
1076
+ $woo_shippment_table_name = $wpdb->prefix . 'woo_shippment_provider';
1077
+
1078
+ $data_array = array( 'provider_url' => 'https://www.mondialrelay.fr/suivi-de-colis?numeroExpedition=%number%');
1079
+ $where_array = array( 'provider_name' => 'Mondial Relay' );
1080
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1081
+
1082
+ $data_array = array( 'provider_name' => 'Brazil Correios');
1083
+ $where_array = array( 'provider_name' => 'Correios' );
1084
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1085
+
1086
+ $data_array = array( 'provider_name' => 'DHL at');
1087
+ $where_array = array( 'provider_name' => 'DHL.at' );
1088
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1089
+
1090
+ $data_array = array( 'provider_name' => 'DHL cz');
1091
+ $where_array = array( 'provider_name' => 'DHL.cz' );
1092
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1093
+
1094
+ $data_array = array( 'provider_name' => 'DHL se');
1095
+ $where_array = array( 'provider_name' => 'DHL.se' );
1096
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1097
+
1098
+ $data_array = array( 'provider_name' => 'DHL uk');
1099
+ $where_array = array( 'provider_name' => 'DHL' );
1100
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1101
+
1102
+ $data_array = array( 'provider_name' => 'Belgium Post');
1103
+ $where_array = array( 'provider_name' => 'bpost' );
1104
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1105
+
1106
+ $data_array = array( 'shipping_country' => 'Global');
1107
+ $where_array = array( 'provider_name' => 'DHL Express' );
1108
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1109
+
1110
+ $data_array = array( 'shipping_country' => 'Global');
1111
+ $where_array = array( 'provider_name' => 'Aliexpress Standard Shipping' );
1112
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1113
+
1114
+ $data_array = array( 'provider_url' => 'https://www.laposte.fr/outils/suivre-vos-envois?code=%number%');
1115
+ $where_array = array( 'provider_name' => 'La Poste' );
1116
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1117
+
1118
+ $data_array = array( 'provider_url' => 'https://www.laposte.fr/outils/suivre-vos-envois?code=%number%');
1119
+ $where_array = array( 'provider_name' => 'Colissimo' );
1120
+ $result = $wpdb->update( $woo_shippment_table_name, $data_array, $where_array );
1121
+
1122
+ $providers = array (
1123
+ 1 => array (
1124
+ "provider_name" => 'Swiss Post',
1125
+ "provider_url" => 'https://service.post.ch/EasyTrack/submitParcelData.do?p_language=en&formattedParcelCodes=%number%',
1126
+ "shipping_country" => 'CH',
1127
+ "shipping_default" => '1',
1128
+ "display_in_order" => 0,
1129
+ ),
1130
+ 2 => array (
1131
+ "provider_name" => 'S.F Express',
1132
+ "provider_url" => 'http://www.sf-express.com/cn/en/dynamic_function/waybill/#search/bill-number/%number%',
1133
+ "shipping_country" => 'CN',
1134
+ "shipping_default" => '1',
1135
+ "display_in_order" => 0,
1136
+ ),
1137
+ 3 => array (
1138
+ "provider_name" => 'ePacket',
1139
+ "provider_url" => 'http://www.ems.com.cn/english.html',
1140
+ "shipping_country" => 'CN',
1141
+ "shipping_default" => '1',
1142
+ "display_in_order" => 0,
1143
+ ),
1144
+ 4 => array (
1145
+ "provider_name" => 'DTDC Plus',
1146
+ "provider_url" => 'http://www.dtdc.in/tracking/tracking_results.asp?Ttype=awb_no&strCnno=&TrkType2=awb_no',
1147
+ "shipping_country" => 'IN',
1148
+ "shipping_default" => '1',
1149
+ "display_in_order" => 0,
1150
+ ),
1151
+ 5 => array (
1152
+ "provider_name" => 'DHLParcel NL',
1153
+ "provider_url" => 'https://www.logistics.dhl/nl-en/home/tracking/tracking-parcel.html?tracking-id=%number%',
1154
+ "shipping_country" => 'NL',
1155
+ "shipping_default" => '1',
1156
+ "display_in_order" => 0,
1157
+ ),
1158
+ 6 => array (
1159
+ "provider_name" => 'TNT',
1160
+ "provider_url" => 'https://www.tnt.com/?searchType=con&cons=%number%',
1161
+ "shipping_country" => 'US',
1162
+ "shipping_default" => '1',
1163
+ "display_in_order" => 0,
1164
+ ),
1165
+ 7 => array (
1166
+ "provider_name" => 'Australia EMS',
1167
+ "provider_url" => 'https://auspost.com.au/mypost/track/#/details/%number%',
1168
+ "shipping_country" => 'AU',
1169
+ "shipping_default" => '1',
1170
+ "display_in_order" => 0,
1171
+ ),
1172
+ 8 => array (
1173
+ "provider_name" => 'Bangladesh EMS',
1174
+ "provider_url" => 'http://www.bangladeshpost.gov.bd/tracking.html',
1175
+ "shipping_country" => 'BD',
1176
+ "shipping_default" => '1',
1177
+ "display_in_order" => 0,
1178
+ ),
1179
+ 9 => array (
1180
+ "provider_name" => 'Colombia Post',
1181
+ "provider_url" => 'http://www.4-72.com.co/',
1182
+ "shipping_country" => 'CO',
1183
+ "shipping_default" => '1',
1184
+ "display_in_order" => 0,
1185
+ ),
1186
+ 10 => array (
1187
+ "provider_name" => 'Costa Rica Post',
1188
+ "provider_url" => 'https://www.correos.go.cr/rastreo/consulta_envios/',
1189
+ "shipping_country" => 'CR',
1190
+ "shipping_default" => '1',
1191
+ "display_in_order" => 0,
1192
+ ),
1193
+ 11 => array (
1194
+ "provider_name" => 'Croatia Post',
1195
+ "provider_url" => 'https://www.posta.hr/tracktrace.aspx?broj=%number%',
1196
+ "shipping_country" => 'HR',
1197
+ "shipping_default" => '1',
1198
+ "display_in_order" => 0,
1199
+ ),
1200
+ 12 => array (
1201
+ "provider_name" => 'Cyprus Post',
1202
+ "provider_url" => 'https://www.cypruspost.post/en/track-n-trace-results?code=%number%',
1203
+ "shipping_country" => 'CY',
1204
+ "shipping_default" => '1',
1205
+ "display_in_order" => 0,
1206
+ ),
1207
+ 13 => array (
1208
+ "provider_name" => 'Denmark Post',
1209
+ "provider_url" => 'https://www.postnord.dk/en/track-and-trace#dynamicloading=true&shipmentid=%number%',
1210
+ "shipping_country" => 'DK',
1211
+ "shipping_default" => '1',
1212
+ "display_in_order" => 0,
1213
+ ),
1214
+ 14 => array (
1215
+ "provider_name" => 'Estonia Post',
1216
+ "provider_url" => 'https://www.omniva.ee/private/track_and_trace',
1217
+ "shipping_country" => 'EE',
1218
+ "shipping_default" => '1',
1219
+ "display_in_order" => 0,
1220
+ ),
1221
+ 15 => array (
1222
+ "provider_name" => 'France EMS - Chronopost',
1223
+ "provider_url" => 'https://www.chronopost.fr/tracking-no-cms/suivi-page?listeNumerosLT=%number%',
1224
+ "shipping_country" => 'FR',
1225
+ "shipping_default" => '1',
1226
+ "display_in_order" => 0,
1227
+ ),
1228
+ 16 => array (
1229
+ "provider_name" => 'Ivory Coast EMS',
1230
+ "provider_url" => 'https://laposte.ci.post/tracking-colis?identifiant=%number%',
1231
+ "shipping_country" => 'CI',
1232
+ "shipping_default" => '1',
1233
+ "display_in_order" => 0,
1234
+ ),
1235
+ 17 => array (
1236
+ "provider_name" => 'Korea Post',
1237
+ "provider_url" => 'https://service.epost.go.kr/trace.RetrieveEmsRigiTraceList.comm?ems_gubun=E&sid1=&POST_CODE=%number%',
1238
+ "shipping_country" => 'KR',
1239
+ "shipping_default" => '1',
1240
+ "display_in_order" => 0,
1241
+ ),
1242
+ 18 => array (
1243
+ "provider_name" => 'Monaco EMS',
1244
+ "provider_url" => 'http://www.lapostemonaco.mc',
1245
+ "shipping_country" => 'MC',
1246
+ "shipping_default" => '1',
1247
+ "display_in_order" => 0,
1248
+ ),
1249
+ 19 => array (
1250
+ "provider_name" => 'Overseas Territory FR EMS',
1251
+ "provider_url" => 'https://www.chronopost.fr/tracking-no-cms/suivi-page?listeNumerosLT=%number%',
1252
+ "shipping_country" => 'FR',
1253
+ "shipping_default" => '1',
1254
+ "display_in_order" => 0,
1255
+ ),
1256
+ 20 => array (
1257
+ "provider_name" => 'Portugal Post - CTT',
1258
+ "provider_url" => 'http://www.ctt.pt/feapl_2/app/open/objectSearch/objectSearch.jspx',
1259
+ "shipping_country" => 'PT',
1260
+ "shipping_default" => '1',
1261
+ "display_in_order" => 0,
1262
+ ),
1263
+ 21 => array (
1264
+ "provider_name" => 'South African Post Office',
1265
+ "provider_url" => 'http://www.southafricanpostoffice.post/index.html',
1266
+ "shipping_country" => 'ZA',
1267
+ "shipping_default" => '1',
1268
+ "display_in_order" => 0,
1269
+ ),
1270
+ 22 => array (
1271
+ "provider_name" => 'Ukraine EMS',
1272
+ "provider_url" => 'http://dpsz.ua/en/track/ems',
1273
+ "shipping_country" => 'UA',
1274
+ "shipping_default" => '1',
1275
+ "display_in_order" => 0,
1276
+ ),
1277
+ 23 => array (
1278
+ "provider_name" => 'TNT Italy',
1279
+ "provider_url" => 'https://www.tnt.it/tracking/Tracking.do',
1280
+ "shipping_country" => 'IT',
1281
+ "shipping_default" => '1',
1282
+ "display_in_order" => 0,
1283
+ ),
1284
+ 24 => array (
1285
+ "provider_name" => 'TNT France',
1286
+ "provider_url" => 'https://www.tnt.fr/public/suivi_colis/recherche/visubontransport.do',
1287
+ "shipping_country" => 'FR',
1288
+ "shipping_default" => '1',
1289
+ "display_in_order" => 0,
1290
+ ),
1291
+ 25 => array (
1292
+ "provider_name" => 'TNT UK',
1293
+ "provider_url" => 'https://www.tnt.com/?searchType=con&cons=%number%',
1294
+ "shipping_country" => 'GB',
1295
+ "shipping_default" => '1',
1296
+ "display_in_order" => 0,
1297
+ ),
1298
+ 26 => array (
1299
+ "provider_name" => 'Aliexpress Standard Shipping',
1300
+ "provider_url" => 'https://global.cainiao.com/detail.htm?mailNoList=LP00139185155139',
1301
+ "shipping_country" => 'Global',
1302
+ "shipping_default" => '1',
1303
+ "display_in_order" => 0,
1304
+ ),
1305
+ 27 => array (
1306
+ "provider_name" => 'Speedex Courier',
1307
+ "provider_url" => 'http://www.speedexcourier.com/',
1308
+ "shipping_country" => 'US',
1309
+ "shipping_default" => '1',
1310
+ "display_in_order" => 0,
1311
+ ),
1312
+ 28 => array (
1313
+ "provider_name" => 'TNT Reference',
1314
+ "provider_url" => 'https://www.tnt.com/express/en_gb/site/shipping-tools/tracking.html?searchType=con&cons=%number%',
1315
+ "shipping_country" => 'GB',
1316
+ "shipping_default" => '1',
1317
+ "display_in_order" => 0,
1318
+ ),
1319
+ 29 => array (
1320
+ "provider_name" => 'TNT Click',
1321
+ "provider_url" => 'https://www.tnt-click.it/',
1322
+ "shipping_country" => 'IT',
1323
+ "shipping_default" => '1',
1324
+ "display_in_order" => 0,
1325
+ ),
1326
+ 30 => array (
1327
+ "provider_name" => 'TNT Australia',
1328
+ "provider_url" => 'https://www.tnt.com/express/en_au/site/shipping-tools/tracking.html?respCountry=au&respLang=en&cons=%number%',
1329
+ "shipping_country" => 'AU',
1330
+ "shipping_default" => '1',
1331
+ "display_in_order" => 0,
1332
+ ),
1333
+ );
1334
+
1335
+ foreach($providers as $provider){
1336
+ $success = $wpdb->insert($woo_shippment_table_name, array(
1337
+ "provider_name" => $provider['provider_name'],
1338
+ "provider_url" => $provider['provider_url'],
1339
+ "shipping_country" => $provider['shipping_country'],
1340
+ "shipping_default" => $provider['shipping_default'],
1341
+ "display_in_order" => $provider['display_in_order'],
1342
+ ));
1343
+ }
1344
+ update_option( 'wc_advanced_shipment_tracking', '2.8');
1345
+ }
1346
+
1347
+ if(version_compare(get_option( 'wc_advanced_shipment_tracking' ),'2.9', '<') ){
1348
+ global $wpdb;
1349
+ $results = $wpdb->get_row( "SELECT * FROM {$this->table} LIMIT 1");
1350
+ if(!isset($results->ts_slug)) {
1351
+ $res = $wpdb->query( sprintf( "ALTER TABLE %s ADD ts_slug text NULL DEFAULT NULL AFTER provider_name", $this->table) );
1352
+ }
1353
+
1354
+ $providers = $this->provider_list();
1355
+ foreach($providers as $provider){
1356
+
1357
+ $data_array = array(
1358
+ 'ts_slug' => sanitize_title($provider['provider_name']),
1359
+ );
1360
+ $where_array = array(
1361
+ 'provider_name' => $provider['provider_name']
1362
+ );
1363
+ $result = $wpdb->update( $this->table, $data_array, $where_array );
1364
+
1365
+ }
1366
+
1367
+ $new_providers = array (
1368
+ 1 => array (
1369
+ "provider_name" => 'DHL Freight',
1370
+ "ts_slug" => 'dhl-freight',
1371
+ "provider_url" => 'https://www.logistics.dhl/global-en/home/tracking/tracking-freight.html?tracking-id=%number%',
1372
+ "shipping_country" => 'Global',
1373
+ "shipping_default" => '1',
1374
+ "display_in_order" => 0,
1375
+ ),
1376
+ 2 => array (
1377
+ "provider_name" => 'Sendle',
1378
+ "ts_slug" => 'sendle',
1379
+ "provider_url" => 'https://track.sendle.com/tracking?ref=%number%',
1380
+ "shipping_country" => 'AU',
1381
+ "shipping_default" => '1',
1382
+ "display_in_order" => 0,
1383
+ ),
1384
+ 3 => array (
1385
+ "provider_name" => 'Deppon',
1386
+ "ts_slug" => 'deppon',
1387
+ "provider_url" => 'https://www.deppon.com/en/toTrack.action',
1388
+ "shipping_country" => 'CN',
1389
+ "shipping_default" => '1',
1390
+ "display_in_order" => 0,
1391
+ ),
1392
+ );
1393
+
1394
+ foreach($new_providers as $provider){
1395
+ $success = $wpdb->insert($this->table, array(
1396
+ "provider_name" => $provider['provider_name'],
1397
+ "ts_slug" => $provider['ts_slug'],
1398
+ "provider_url" => $provider['provider_url'],
1399
+ "shipping_country" => $provider['shipping_country'],
1400
+ "shipping_default" => $provider['shipping_default'],
1401
+ "display_in_order" => $provider['display_in_order'],
1402
+ ));
1403
+ }
1404
+
1405
+ $data_array = array( 'provider_url' => 'https://seguimientoenvio.correos.cl/home/index/%number%');
1406
+ $where_array = array( 'provider_name' => 'Correos Chile' );
1407
+ $result = $wpdb->update( $this->table, $data_array, $where_array );
1408
+
1409
+ $data_array = array( 'provider_name' => 'Fastway AU' , 'ts_slug' => 'fastway-au');
1410
+ $where_array = array( 'provider_name' => 'Fastway Couriers' );
1411
+ $result = $wpdb->update( $this->table, $data_array, $where_array );
1412
+
1413
+ $data_array = array( 'provider_name' => 'Fastway NZ', 'provider_url' => 'https://www.fastway.co.nz/tools/track?l=%number%', 'ts_slug' => 'fastway-nz');
1414
+ $where_array = array( 'provider_name' => 'Fastways' );
1415
+ $result = $wpdb->update( $this->table, $data_array, $where_array );
1416
+
1417
+ $custom_providers = $wpdb->get_results( "SELECT * FROM $this->table WHERE shipping_default = 0" );
1418
+
1419
+ foreach($custom_providers as $custom){
1420
+ $data_array = array(
1421
+ 'ts_slug' => sanitize_title($custom->provider_name),
1422
+ );
1423
+ $where_array = array(
1424
+ 'provider_name' => $custom->provider_name
1425
+ );
1426
+ $result = $wpdb->update( $this->table, $data_array, $where_array );
1427
+ }
1428
+
1429
+ update_option( 'wc_advanced_shipment_tracking', '2.9');
1430
+ }
1431
  }
1432
  }
1433
  /*
1434
  * Display admin notice on plugin install or update
1435
  */
1436
  public function admin_notice_after_update(){
1437
+ if ( ! PAnD::is_admin_notice_active( 'disable-done-notice-forever' ) ) {
1438
  return;
1439
  }
1440
  ?>
1441
+ <div data-dismissible="disable-done-notice-forever" class="updated notice notice-success is-dismissible">
1442
  <p>
1443
  <?php
1444
  printf(
1445
+ //esc_html__( '%1$s %2$s.' ),
1446
+ esc_html__( 'We added many improvements to %1$s, please help and give us a review :) Thanks!', 'woo-advanced-shipment-tracking' ),
1447
  sprintf(
1448
+ '<a href="%s" target="blank">%s</a>',
1449
+ esc_url( 'https://wordpress.org/support/plugin/woo-advanced-shipment-tracking/reviews/#new-post' ),
1450
+ esc_html__( 'Advanced Shipment Tracking', 'woo-advanced-shipment-tracking' )
1451
  )
1452
  );
1453
  ?>
includes/class-wc-advanced-shipment-tracking.php CHANGED
@@ -188,7 +188,9 @@ class WC_Advanced_Shipment_Tracking_Actions {
188
  $data = $shipment_status[$key];
189
  $status = $data["status"];
190
  $status_date = $data['status_date'];
191
- $est_delivery_date = $data["est_delivery_date"];
 
 
192
  if( $status != 'delivered' && $status != 'return_to_sender' && !empty($est_delivery_date) ){
193
  $has_est_delivery = true;
194
  }
@@ -239,7 +241,15 @@ class WC_Advanced_Shipment_Tracking_Actions {
239
 
240
  $shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name" );
241
 
242
- $default_provider = get_option("wc_ast_default_provider" );
 
 
 
 
 
 
 
 
243
 
244
  echo '<div id="tracking-items">';
245
  if ( count( $tracking_items ) > 0 ) {
@@ -262,8 +272,8 @@ class WC_Advanced_Shipment_Tracking_Actions {
262
  $shippment_providers_by_country = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name WHERE shipping_country = '$country' AND display_in_order = 1" );
263
  foreach ( $shippment_providers_by_country as $providers ) {
264
  //echo '<pre>';print_r($providers);echo '</pre>';
265
- $selected = ( $default_provider == esc_attr( sanitize_title( $providers->provider_name ) ) ) ? 'selected' : '';
266
- echo '<option value="' . esc_attr( sanitize_title( $providers->provider_name ) ) . '" '.$selected. '>' . esc_html( $providers->provider_name ) . '</option>';
267
  }
268
  echo '</optgroup>';
269
  }
@@ -301,6 +311,13 @@ class WC_Advanced_Shipment_Tracking_Actions {
301
  'class' => 'date-picker-field',
302
  'value' => date_i18n( __( 'Y-m-d', 'woo-advanced-shipment-tracking' ), current_time( 'timestamp' ) ),
303
  ) );
 
 
 
 
 
 
 
304
 
305
  echo '<button class="button button-primary button-save-form">' . __( 'Save Tracking', 'woo-advanced-shipment-tracking' ) . '</button>';
306
  echo '<p class="preview_tracking_link">' . __( 'Preview:', 'woo-advanced-shipment-tracking' ) . ' <a href="" target="_blank">' . __( 'Click here to track shipment', 'woo-advanced-shipment-tracking' ) . '</a></p>';
@@ -367,15 +384,20 @@ class WC_Advanced_Shipment_Tracking_Actions {
367
  *
368
  * Function for saving tracking items
369
  */
370
- public function save_meta_box( $post_id, $post ) {
 
371
  if ( isset( $_POST['tracking_number'] ) && $_POST['tracking_provider'] != '' && strlen( $_POST['tracking_number'] ) > 0 ) {
372
  $tracking_number = str_replace(' ', '', $_POST['tracking_number']);
373
  $args = array(
374
  'tracking_provider' => $_POST['tracking_provider'],
375
- 'tracking_number' => wc_clean( $tracking_number ),
376
- 'date_shipped' => wc_clean( $_POST['date_shipped'] ),
377
  );
378
-
 
 
 
 
379
  $this->add_tracking_item( $post_id, $args );
380
  }
381
  }
@@ -412,12 +434,19 @@ class WC_Advanced_Shipment_Tracking_Actions {
412
  $order_id = wc_clean( $_POST['order_id'] );
413
  $args = array(
414
  'tracking_provider' => $_POST['tracking_provider'],
415
- 'tracking_number' => wc_clean( $tracking_number ),
416
  'date_shipped' => wc_clean( $_POST['date_shipped'] ),
417
  );
418
 
419
  $tracking_item = $this->add_tracking_item( $order_id, $args );
420
-
 
 
 
 
 
 
 
421
  $this->display_html_tracking_item_for_meta_box( $order_id, $tracking_item );
422
  }
423
 
@@ -725,6 +754,7 @@ class WC_Advanced_Shipment_Tracking_Actions {
725
  $tracking_items[] = $tracking_item;
726
 
727
  $this->save_tracking_items( $order_id, $tracking_items );
 
728
  if( !empty($tracking_item['status_shipped'] )){
729
  $order = new WC_Order( $order_id );
730
  $order->update_status('completed');
@@ -875,7 +905,7 @@ class WC_Advanced_Shipment_Tracking_Actions {
875
 
876
  if($new_status == 'delivered'){
877
  wc_advanced_shipment_tracking_email_class()->delivered_shippment_status_email_trigger($order_id, $order, $old_status, $new_status);
878
- } elseif($new_status == 'pre_transit' || $new_status == 'in_transit' || $new_status == 'out_for_delivery' || $new_status == 'available_for_pickup' || $new_status == 'return_to_sender'){
879
  wc_advanced_shipment_tracking_email_class()->shippment_status_email_trigger($order_id, $order, $old_status, $new_status);
880
  }
881
  }
188
  $data = $shipment_status[$key];
189
  $status = $data["status"];
190
  $status_date = $data['status_date'];
191
+ if(!empty($data["est_delivery_date"])){
192
+ $est_delivery_date = $data["est_delivery_date"];
193
+ }
194
  if( $status != 'delivered' && $status != 'return_to_sender' && !empty($est_delivery_date) ){
195
  $has_est_delivery = true;
196
  }
241
 
242
  $shippment_providers = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name" );
243
 
244
+ $default_provider = get_option("wc_ast_default_provider" );
245
+
246
+ $wc_ast_status_shipped = get_option('wc_ast_status_shipped');
247
+ if($wc_ast_status_shipped == 1){
248
+ $change_order_status_label = 'Change order to Shipped?';
249
+ } else{
250
+ $change_order_status_label = 'Change order to Completed?';
251
+ }
252
+
253
 
254
  echo '<div id="tracking-items">';
255
  if ( count( $tracking_items ) > 0 ) {
272
  $shippment_providers_by_country = $wpdb->get_results( "SELECT * FROM $woo_shippment_table_name WHERE shipping_country = '$country' AND display_in_order = 1" );
273
  foreach ( $shippment_providers_by_country as $providers ) {
274
  //echo '<pre>';print_r($providers);echo '</pre>';
275
+ $selected = ( $default_provider == esc_attr( $providers->ts_slug ) ) ? 'selected' : '';
276
+ echo '<option value="' . esc_attr( $providers->ts_slug ) . '" '.$selected. '>' . esc_html( $providers->provider_name ) . '</option>';
277
  }
278
  echo '</optgroup>';
279
  }
311
  'class' => 'date-picker-field',
312
  'value' => date_i18n( __( 'Y-m-d', 'woo-advanced-shipment-tracking' ), current_time( 'timestamp' ) ),
313
  ) );
314
+
315
+ woocommerce_wp_checkbox( array(
316
+ 'id' => 'change_order_to_shipped',
317
+ 'label' => __( $change_order_status_label, 'woo-advanced-shipment-tracking' ),
318
+ 'description' => '',
319
+ 'value' => '',
320
+ ) );
321
 
322
  echo '<button class="button button-primary button-save-form">' . __( 'Save Tracking', 'woo-advanced-shipment-tracking' ) . '</button>';
323
  echo '<p class="preview_tracking_link">' . __( 'Preview:', 'woo-advanced-shipment-tracking' ) . ' <a href="" target="_blank">' . __( 'Click here to track shipment', 'woo-advanced-shipment-tracking' ) . '</a></p>';
384
  *
385
  * Function for saving tracking items
386
  */
387
+ public function save_meta_box( $post_id, $post ) {
388
+
389
  if ( isset( $_POST['tracking_number'] ) && $_POST['tracking_provider'] != '' && strlen( $_POST['tracking_number'] ) > 0 ) {
390
  $tracking_number = str_replace(' ', '', $_POST['tracking_number']);
391
  $args = array(
392
  'tracking_provider' => $_POST['tracking_provider'],
393
+ 'tracking_number' => wc_clean( $_POST['tracking_number'] ),
394
+ 'date_shipped' => wc_clean( $_POST['date_shipped'] ),
395
  );
396
+ if($_POST['change_order_to_shipped'] == 'yes'){
397
+ $_POST['order_status'] = 'wc-completed';
398
+ //$order = new WC_Order($post_id);
399
+ //$order->update_status('completed');
400
+ }
401
  $this->add_tracking_item( $post_id, $args );
402
  }
403
  }
434
  $order_id = wc_clean( $_POST['order_id'] );
435
  $args = array(
436
  'tracking_provider' => $_POST['tracking_provider'],
437
+ 'tracking_number' => wc_clean( $_POST['tracking_number'] ),
438
  'date_shipped' => wc_clean( $_POST['date_shipped'] ),
439
  );
440
 
441
  $tracking_item = $this->add_tracking_item( $order_id, $args );
442
+
443
+ if($_POST['change_order_to_shipped'] == 'yes'){
444
+ $order = new WC_Order($order_id);
445
+ $order->update_status('completed');
446
+ $ast_admin = WC_Advanced_Shipment_Tracking_Admin::get_instance();
447
+ $ast_admin->trigger_woocommerce_order_status_completed( $order_id );
448
+ }
449
+
450
  $this->display_html_tracking_item_for_meta_box( $order_id, $tracking_item );
451
  }
452
 
754
  $tracking_items[] = $tracking_item;
755
 
756
  $this->save_tracking_items( $order_id, $tracking_items );
757
+
758
  if( !empty($tracking_item['status_shipped'] )){
759
  $order = new WC_Order( $order_id );
760
  $order->update_status('completed');
905
 
906
  if($new_status == 'delivered'){
907
  wc_advanced_shipment_tracking_email_class()->delivered_shippment_status_email_trigger($order_id, $order, $old_status, $new_status);
908
+ } elseif($new_status == 'failure' || $new_status == 'in_transit' || $new_status == 'out_for_delivery' || $new_status == 'available_for_pickup' || $new_status == 'return_to_sender'){
909
  wc_advanced_shipment_tracking_email_class()->shippment_status_email_trigger($order_id, $order, $old_status, $new_status);
910
  }
911
  }
includes/customizer/class-wc-availableforpickup-email-customizer.php CHANGED
@@ -49,6 +49,7 @@ class wcast_availableforpickup_customizer_email {
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
52
  // Send variables to Javascript
53
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
54
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -88,12 +89,12 @@ class wcast_availableforpickup_customizer_email {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-availableforpickup-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_availableforpickup_customizer_email::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -105,8 +106,8 @@ class wcast_availableforpickup_customizer_email {
105
  * @access public
106
  * @return string
107
  */
108
- public static function get_email_settings_page_url() {
109
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
110
  }
111
 
112
  public function wcast_generate_defaults() {
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
52
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
53
  // Send variables to Javascript
54
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
55
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
  $customizer_url = add_query_arg( array(
94
  'wcast-customizer' => '1',
95
  'email' => $email,
96
  'url' => urlencode( add_query_arg( array( 'wcast-availableforpickup-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
97
+ 'return' => urlencode( wcast_availableforpickup_customizer_email::get_email_settings_page_url($return_tab) ),
98
  ), admin_url( 'customize.php' ) );
99
 
100
  return $customizer_url;
106
  * @access public
107
  * @return string
108
  */
109
+ public static function get_email_settings_page_url($return_tab) {
110
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
111
  }
112
 
113
  public function wcast_generate_defaults() {
includes/customizer/class-wc-delivered-email-customizer.php CHANGED
@@ -51,6 +51,7 @@ class wcast_delivered_customizer_email {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
54
  // Send variables to Javascript
55
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
56
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -88,12 +89,12 @@ class wcast_delivered_customizer_email {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-delivered-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_delivered_customizer_email::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -104,8 +105,8 @@ class wcast_delivered_customizer_email {
104
  * @access public
105
  * @return string
106
  */
107
- public static function get_email_settings_page_url() {
108
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
109
  }
110
 
111
  public function wcast_generate_defaults() {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
54
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
55
  // Send variables to Javascript
56
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
57
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
  $customizer_url = add_query_arg( array(
94
  'wcast-customizer' => '1',
95
  'email' => $email,
96
  'url' => urlencode( add_query_arg( array( 'wcast-delivered-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
97
+ 'return' => urlencode( wcast_delivered_customizer_email::get_email_settings_page_url($return_tab) ),
98
  ), admin_url( 'customize.php' ) );
99
 
100
  return $customizer_url;
105
  * @access public
106
  * @return string
107
  */
108
+ public static function get_email_settings_page_url($return_tab) {
109
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
110
  }
111
 
112
  public function wcast_generate_defaults() {
includes/customizer/class-wc-email-customizer.php CHANGED
@@ -46,6 +46,7 @@ class wcast_initialise_customizer_email {
46
 
47
  public function enqueue_preview_scripts() {
48
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
49
  // Send variables to Javascript
50
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
51
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
46
 
47
  public function enqueue_preview_scripts() {
48
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
49
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
50
  // Send variables to Javascript
51
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
52
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
includes/customizer/{class-wc-pretransit-email-customizer.php → class-wc-failure-email-customizer.php} RENAMED
@@ -7,7 +7,7 @@
7
  /**
8
  * Adds the individual sections, settings, and controls to the theme customizer
9
  */
10
- class wcast_pretransit_customizer_email {
11
  // Get our default values
12
  public function __construct() {
13
  // Get our Customizer defaults
@@ -20,7 +20,7 @@ class wcast_pretransit_customizer_email {
20
  add_action( 'customize_register', array( $this, 'wcast_register_sample_default_controls' ) );
21
 
22
  // Only proceed if this is own request.
23
- if ( ! wcast_pretransit_customizer_email::is_own_customizer_request() && ! wcast_pretransit_customizer_email::is_own_preview_request() ) {
24
  return;
25
  }
26
  add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_panels' ) );
@@ -49,6 +49,7 @@ class wcast_pretransit_customizer_email {
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
52
  // Send variables to Javascript
53
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
54
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -71,7 +72,7 @@ class wcast_pretransit_customizer_email {
71
  * @return bool
72
  */
73
  public static function is_own_preview_request() {
74
- return isset( $_REQUEST['wcast-pretransit-email-customizer-preview'] ) && '1' === $_REQUEST['wcast-pretransit-email-customizer-preview'];
75
  }
76
  /**
77
  * Checks to see if we are opening our custom customizer controls
@@ -80,18 +81,18 @@ class wcast_pretransit_customizer_email {
80
  * @return bool
81
  */
82
  public static function is_own_customizer_request() {
83
- return isset( $_REQUEST['email'] ) && $_REQUEST['email'] === 'customer_pretransit_email';
84
  }
85
  /**
86
  * Get Customizer URL
87
  *
88
  */
89
- public static function get_customizer_url($email) {
90
  $customizer_url = add_query_arg( array(
91
  'wcast-customizer' => '1',
92
  'email' => $email,
93
- 'url' => urlencode( add_query_arg( array( 'wcast-pretransit-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
94
- 'return' => urlencode( wcast_pretransit_customizer_email::get_email_settings_page_url() ),
95
  ), admin_url( 'customize.php' ) );
96
 
97
  return $customizer_url;
@@ -102,22 +103,22 @@ class wcast_pretransit_customizer_email {
102
  * @access public
103
  * @return string
104
  */
105
- public static function get_email_settings_page_url() {
106
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
107
  }
108
 
109
  public function wcast_generate_defaults() {
110
  $customizer_defaults = array(
111
- 'wcast_pretransit_email_subject' => __( 'Your order #{order_number} is pre transit', 'woo-advanced-shipment-tracking' ),
112
- 'wcast_pretransit_email_heading' => __( 'Pre Transit', 'woo-advanced-shipment-tracking' ),
113
- 'wcast_pretransit_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is pre transit", 'woo-advanced-shipment-tracking' ),
114
- 'wcast_enable_pretransit_email' => '',
115
- 'wcast_pretransit_email_to' => '{customer_email}',
116
- 'wcast_pretransit_show_tracking_details' => '',
117
- 'wcast_pretransit_show_order_details' => '',
118
- 'wcast_pretransit_show_billing_address' => '',
119
- 'wcast_pretransit_show_shipping_address' => '',
120
- 'wcast_pretransit_email_code_block' => '',
121
  );
122
 
123
  return apply_filters( 'skyrocket_customizer_defaults', $customizer_defaults );
@@ -131,49 +132,49 @@ class wcast_pretransit_customizer_email {
131
  */
132
  require_once trailingslashit( dirname(__FILE__) ) . 'custom-controls.php';
133
 
134
- $wp_customize->add_setting( 'pretransit_order_email_heading',
135
  array(
136
  'default' => '',
137
  'transport' => 'postMessage',
138
  'sanitize_callback' => ''
139
  )
140
  );
141
- $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'pretransit_order_email_heading',
142
  array(
143
- 'label' => __( 'Pre Transit shipment status email', 'woo-advanced-shipment-tracking' ),
144
  'description' => __( 'This section lets you customize the Email Content.', 'woo-advanced-shipment-tracking' ),
145
- 'section' => 'customer_pretransit_email'
146
  )
147
  ) );
148
  // Display Shipment Provider image/thumbnail
149
- $wp_customize->add_setting( 'wcast_enable_pretransit_email',
150
  array(
151
- 'default' => $this->defaults['wcast_enable_pretransit_email'],
152
  'transport' => 'postMessage',
153
  'sanitize_callback' => ''
154
  )
155
  );
156
- $wp_customize->add_control( 'wcast_enable_pretransit_email',
157
  array(
158
- 'label' => __( 'Enable Pre Transit shipment status email', 'woo-advanced-shipment-tracking' ),
159
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
160
- 'section' => 'customer_pretransit_email',
161
  'type' => 'checkbox'
162
  )
163
  );
164
  // Preview Order
165
- $wp_customize->add_setting( 'wcast_pretransit_email_preview_order_id',
166
  array(
167
  'default' => 'mockup',
168
  'transport' => 'refresh',
169
  'sanitize_callback' => ''
170
  )
171
  );
172
- $wp_customize->add_control( new Skyrocket_Dropdown_Select_Custom_Control( $wp_customize, 'wcast_pretransit_email_preview_order_id',
173
  array(
174
  'label' => __( 'Preview order', 'woo-advanced-shipment-tracking' ),
175
  'description' => '',
176
- 'section' => 'customer_pretransit_email',
177
  'input_attrs' => array(
178
  'placeholder' => __( 'Please select a order...', 'skyrocket' ),
179
  'class' => 'preview_order_select',
@@ -183,18 +184,18 @@ class wcast_pretransit_customizer_email {
183
  ) );
184
 
185
  // Header Text
186
- $wp_customize->add_setting( 'wcast_pretransit_email_to',
187
  array(
188
- 'default' => $this->defaults['wcast_pretransit_email_to'],
189
  'transport' => 'postMessage',
190
  'sanitize_callback' => ''
191
  )
192
  );
193
- $wp_customize->add_control( 'wcast_pretransit_email_to',
194
  array(
195
  'label' => __( 'To', 'woo-advanced-shipment-tracking' ),
196
  'description' => esc_html__( 'Enter emails here or use variables such as {customer_email}. Multiple emails can be separated by commas.', 'woo-advanced-shipment-tracking' ),
197
- 'section' => 'customer_pretransit_email',
198
  'type' => 'text',
199
  'input_attrs' => array(
200
  'class' => '',
@@ -205,18 +206,18 @@ class wcast_pretransit_customizer_email {
205
  );
206
 
207
  // Header Text
208
- $wp_customize->add_setting( 'wcast_pretransit_email_subject',
209
  array(
210
- 'default' => $this->defaults['wcast_pretransit_email_subject'],
211
  'transport' => 'postMessage',
212
  'sanitize_callback' => ''
213
  )
214
  );
215
- $wp_customize->add_control( 'wcast_pretransit_email_subject',
216
  array(
217
  'label' => __( 'Email subject', 'woo-advanced-shipment-tracking' ),
218
  'description' => esc_html__( 'Available placeholders: {site_title}, {order_number}', 'woo-advanced-shipment-tracking' ),
219
- 'section' => 'customer_pretransit_email',
220
  'type' => 'text',
221
  'input_attrs' => array(
222
  'class' => '',
@@ -227,18 +228,18 @@ class wcast_pretransit_customizer_email {
227
  );
228
 
229
  // Header Text
230
- $wp_customize->add_setting( 'wcast_pretransit_email_heading',
231
  array(
232
- 'default' => $this->defaults['wcast_pretransit_email_heading'],
233
  'transport' => 'postMessage',
234
  'sanitize_callback' => ''
235
  )
236
  );
237
- $wp_customize->add_control( 'wcast_pretransit_email_heading',
238
  array(
239
  'label' => __( 'Email heading', 'woo-advanced-shipment-tracking' ),
240
  'description' => esc_html__( 'Available placeholders: {site_title}, {order_number}', 'woo-advanced-shipment-tracking' ),
241
- 'section' => 'customer_pretransit_email',
242
  'type' => 'text',
243
  'input_attrs' => array(
244
  'class' => '',
@@ -249,84 +250,84 @@ class wcast_pretransit_customizer_email {
249
  );
250
 
251
  // Display Shipment Provider image/thumbnail
252
- $wp_customize->add_setting( 'wcast_pretransit_show_tracking_details',
253
  array(
254
- 'default' => $this->defaults['wcast_pretransit_show_tracking_details'],
255
  'transport' => 'refresh',
256
  'sanitize_callback' => ''
257
  )
258
  );
259
- $wp_customize->add_control( 'wcast_pretransit_show_tracking_details',
260
  array(
261
  'label' => __( 'Show tracking details', 'woo-advanced-shipment-tracking' ),
262
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
263
- 'section' => 'customer_pretransit_email',
264
  'type' => 'checkbox'
265
  )
266
  );
267
  // Display Shipment Provider image/thumbnail
268
- $wp_customize->add_setting( 'wcast_pretransit_show_order_details',
269
  array(
270
- 'default' => $this->defaults['wcast_pretransit_show_order_details'],
271
  'transport' => 'refresh',
272
  'sanitize_callback' => ''
273
  )
274
  );
275
- $wp_customize->add_control( 'wcast_pretransit_show_order_details',
276
  array(
277
  'label' => __( 'Show order details', 'woo-advanced-shipment-tracking' ),
278
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
279
- 'section' => 'customer_pretransit_email',
280
  'type' => 'checkbox'
281
  )
282
  );
283
  // Display Shipment Provider image/thumbnail
284
- $wp_customize->add_setting( 'wcast_pretransit_show_billing_address',
285
  array(
286
- 'default' => $this->defaults['wcast_pretransit_show_billing_address'],
287
  'transport' => 'refresh',
288
  'sanitize_callback' => ''
289
  )
290
  );
291
- $wp_customize->add_control( 'wcast_pretransit_show_billing_address',
292
  array(
293
  'label' => __( 'Show billing address', 'woo-advanced-shipment-tracking' ),
294
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
295
- 'section' => 'customer_pretransit_email',
296
  'type' => 'checkbox'
297
  )
298
  );
299
 
300
  // Display Shipment Provider image/thumbnail
301
- $wp_customize->add_setting( 'wcast_pretransit_show_shipping_address',
302
  array(
303
- 'default' => $this->defaults['wcast_pretransit_show_shipping_address'],
304
  'transport' => 'refresh',
305
  'sanitize_callback' => ''
306
  )
307
  );
308
- $wp_customize->add_control( 'wcast_pretransit_show_shipping_address',
309
  array(
310
  'label' => __( 'Show shipping address', 'woo-advanced-shipment-tracking' ),
311
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
312
- 'section' => 'customer_pretransit_email',
313
  'type' => 'checkbox'
314
  )
315
  );
316
 
317
  // Test of TinyMCE control
318
- $wp_customize->add_setting( 'wcast_pretransit_email_content',
319
  array(
320
- 'default' => $this->defaults['wcast_pretransit_email_content'],
321
  'transport' => 'refresh',
322
  'sanitize_callback' => 'wp_kses_post'
323
  )
324
  );
325
- $wp_customize->add_control( new Skyrocket_TinyMCE_Custom_control( $wp_customize, 'wcast_pretransit_email_content',
326
  array(
327
  'label' => __( 'Email content', 'woo-advanced-shipment-tracking' ),
328
  'description' => __( '', 'woo-advanced-shipment-tracking' ),
329
- 'section' => 'customer_pretransit_email',
330
  'input_attrs' => array(
331
  'toolbar1' => 'bold italic bullist numlist alignleft aligncenter alignright link',
332
  'mediaButtons' => true,
@@ -335,18 +336,18 @@ class wcast_pretransit_customizer_email {
335
  ) );
336
 
337
 
338
- $wp_customize->add_setting( 'wcast_pretransit_email_code_block',
339
  array(
340
- 'default' => $this->defaults['wcast_pretransit_email_code_block'],
341
  'transport' => 'postMessage',
342
  'sanitize_callback' => ''
343
  )
344
  );
345
- $wp_customize->add_control( new WP_Customize_codeinfoblock_Control( $wp_customize, 'wcast_pretransit_email_code_block',
346
  array(
347
  'label' => __( 'Available placeholders', 'woo-advanced-shipment-tracking' ),
348
  'description' => '<code>{site_title}<br>{customer_email}<br>{customer_first_name}<br>{customer_last_name}<br>{customer_username}<br>{order_number}<br>{est_delivery_date}</code>',
349
- 'section' => 'customer_pretransit_email',
350
  )
351
  ) );
352
  }
@@ -359,29 +360,29 @@ class wcast_pretransit_customizer_email {
359
  public function set_up_preview() {
360
 
361
  // Make sure this is own preview request.
362
- if ( ! wcast_pretransit_customizer_email::is_own_preview_request() ) {
363
  return;
364
  }
365
- include wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/preview/pretransit_preview.php';
366
  exit;
367
  }
368
 
369
- public function preview_pretransit_email(){
370
  // Load WooCommerce emails.
371
  $wc_emails = WC_Emails::instance();
372
  $emails = $wc_emails->get_emails();
373
- $preview_id = get_theme_mod('wcast_pretransit_email_preview_order_id');
374
 
375
 
376
- $email_heading = get_theme_mod('wcast_pretransit_email_heading');
377
  $email_heading = str_replace( '{site_title}', $this->get_blogname(), $email_heading );
378
  $email_heading = str_replace( '{order_number}', $preview_id, $email_heading );
379
 
380
- $email_content = get_theme_mod('wcast_pretransit_email_content');
381
- $wcast_show_tracking_details = get_theme_mod('wcast_pretransit_show_tracking_details');
382
- $wcast_show_order_details = get_theme_mod('wcast_pretransit_show_order_details');
383
- $wcast_show_billing_address = get_theme_mod('wcast_pretransit_show_billing_address');
384
- $wcast_show_shipping_address = get_theme_mod('wcast_pretransit_show_shipping_address');
385
  $sent_to_admin = false;
386
  $plain_text = false;
387
  $email = '';
@@ -460,4 +461,4 @@ class wcast_pretransit_customizer_email {
460
  * Initialise our Customizer settings
461
  */
462
 
463
- $wcast_pretransit_customizer_email = new wcast_pretransit_customizer_email();
7
  /**
8
  * Adds the individual sections, settings, and controls to the theme customizer
9
  */
10
+ class wcast_failure_customizer_email {
11
  // Get our default values
12
  public function __construct() {
13
  // Get our Customizer defaults
20
  add_action( 'customize_register', array( $this, 'wcast_register_sample_default_controls' ) );
21
 
22
  // Only proceed if this is own request.
23
+ if ( ! wcast_failure_customizer_email::is_own_customizer_request() && ! wcast_failure_customizer_email::is_own_preview_request() ) {
24
  return;
25
  }
26
  add_action( 'customize_register', array( wcast_customizer(), 'wcast_add_customizer_panels' ) );
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
52
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
53
  // Send variables to Javascript
54
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
55
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
72
  * @return bool
73
  */
74
  public static function is_own_preview_request() {
75
+ return isset( $_REQUEST['wcast-failure-email-customizer-preview'] ) && '1' === $_REQUEST['wcast-failure-email-customizer-preview'];
76
  }
77
  /**
78
  * Checks to see if we are opening our custom customizer controls
81
  * @return bool
82
  */
83
  public static function is_own_customizer_request() {
84
+ return isset( $_REQUEST['email'] ) && $_REQUEST['email'] === 'customer_failure_email';
85
  }
86
  /**
87
  * Get Customizer URL
88
  *
89
  */
90
+ public static function get_customizer_url($email,$return_tab) {
91
  $customizer_url = add_query_arg( array(
92
  'wcast-customizer' => '1',
93
  'email' => $email,
94
+ 'url' => urlencode( add_query_arg( array( 'wcast-failure-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
95
+ 'return' => urlencode( wcast_failure_customizer_email::get_email_settings_page_url($return_tab) ),
96
  ), admin_url( 'customize.php' ) );
97
 
98
  return $customizer_url;
103
  * @access public
104
  * @return string
105
  */
106
+ public static function get_email_settings_page_url($return_tab) {
107
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
108
  }
109
 
110
  public function wcast_generate_defaults() {
111
  $customizer_defaults = array(
112
+ 'wcast_failure_email_subject' => __( 'Your order #{order_number} is Failed Attempt', 'woo-advanced-shipment-tracking' ),
113
+ 'wcast_failure_email_heading' => __( 'Failed Attempt', 'woo-advanced-shipment-tracking' ),
114
+ 'wcast_failure_email_content' => __( "Hi there. we thought you'd like to know that your recent order from {site_title} is Failed Attempt", 'woo-advanced-shipment-tracking' ),
115
+ 'wcast_enable_failure_email' => '',
116
+ 'wcast_failure_email_to' => '{customer_email}',
117
+ 'wcast_failure_show_tracking_details' => '',
118
+ 'wcast_failure_show_order_details' => '',
119
+ 'wcast_failure_show_billing_address' => '',
120
+ 'wcast_failure_show_shipping_address' => '',
121
+ 'wcast_failure_email_code_block' => '',
122
  );
123
 
124
  return apply_filters( 'skyrocket_customizer_defaults', $customizer_defaults );
132
  */
133
  require_once trailingslashit( dirname(__FILE__) ) . 'custom-controls.php';
134
 
135
+ $wp_customize->add_setting( 'failure_order_email_heading',
136
  array(
137
  'default' => '',
138
  'transport' => 'postMessage',
139
  'sanitize_callback' => ''
140
  )
141
  );
142
+ $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'failure_order_email_heading',
143
  array(
144
+ 'label' => __( 'Failed Attempt shipment status email', 'woo-advanced-shipment-tracking' ),
145
  'description' => __( 'This section lets you customize the Email Content.', 'woo-advanced-shipment-tracking' ),
146
+ 'section' => 'customer_failure_email'
147
  )
148
  ) );
149
  // Display Shipment Provider image/thumbnail
150
+ $wp_customize->add_setting( 'wcast_enable_failure_email',
151
  array(
152
+ 'default' => $this->defaults['wcast_enable_failure_email'],
153
  'transport' => 'postMessage',
154
  'sanitize_callback' => ''
155
  )
156
  );
157
+ $wp_customize->add_control( 'wcast_enable_failure_email',
158
  array(
159
+ 'label' => __( 'Enable Failed Attempt shipment status email', 'woo-advanced-shipment-tracking' ),
160
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
161
+ 'section' => 'customer_failure_email',
162
  'type' => 'checkbox'
163
  )
164
  );
165
  // Preview Order
166
+ $wp_customize->add_setting( 'wcast_failure_email_preview_order_id',
167
  array(
168
  'default' => 'mockup',
169
  'transport' => 'refresh',
170
  'sanitize_callback' => ''
171
  )
172
  );
173
+ $wp_customize->add_control( new Skyrocket_Dropdown_Select_Custom_Control( $wp_customize, 'wcast_failure_email_preview_order_id',
174
  array(
175
  'label' => __( 'Preview order', 'woo-advanced-shipment-tracking' ),
176
  'description' => '',
177
+ 'section' => 'customer_failure_email',
178
  'input_attrs' => array(
179
  'placeholder' => __( 'Please select a order...', 'skyrocket' ),
180
  'class' => 'preview_order_select',
184
  ) );
185
 
186
  // Header Text
187
+ $wp_customize->add_setting( 'wcast_failure_email_to',
188
  array(
189
+ 'default' => $this->defaults['wcast_failure_email_to'],
190
  'transport' => 'postMessage',
191
  'sanitize_callback' => ''
192
  )
193
  );
194
+ $wp_customize->add_control( 'wcast_failure_email_to',
195
  array(
196
  'label' => __( 'To', 'woo-advanced-shipment-tracking' ),
197
  'description' => esc_html__( 'Enter emails here or use variables such as {customer_email}. Multiple emails can be separated by commas.', 'woo-advanced-shipment-tracking' ),
198
+ 'section' => 'customer_failure_email',
199
  'type' => 'text',
200
  'input_attrs' => array(
201
  'class' => '',
206
  );
207
 
208
  // Header Text
209
+ $wp_customize->add_setting( 'wcast_failure_email_subject',
210
  array(
211
+ 'default' => $this->defaults['wcast_failure_email_subject'],
212
  'transport' => 'postMessage',
213
  'sanitize_callback' => ''
214
  )
215
  );
216
+ $wp_customize->add_control( 'wcast_failure_email_subject',
217
  array(
218
  'label' => __( 'Email subject', 'woo-advanced-shipment-tracking' ),
219
  'description' => esc_html__( 'Available placeholders: {site_title}, {order_number}', 'woo-advanced-shipment-tracking' ),
220
+ 'section' => 'customer_failure_email',
221
  'type' => 'text',
222
  'input_attrs' => array(
223
  'class' => '',
228
  );
229
 
230
  // Header Text
231
+ $wp_customize->add_setting( 'wcast_failure_email_heading',
232
  array(
233
+ 'default' => $this->defaults['wcast_failure_email_heading'],
234
  'transport' => 'postMessage',
235
  'sanitize_callback' => ''
236
  )
237
  );
238
+ $wp_customize->add_control( 'wcast_failure_email_heading',
239
  array(
240
  'label' => __( 'Email heading', 'woo-advanced-shipment-tracking' ),
241
  'description' => esc_html__( 'Available placeholders: {site_title}, {order_number}', 'woo-advanced-shipment-tracking' ),
242
+ 'section' => 'customer_failure_email',
243
  'type' => 'text',
244
  'input_attrs' => array(
245
  'class' => '',
250
  );
251
 
252
  // Display Shipment Provider image/thumbnail
253
+ $wp_customize->add_setting( 'wcast_failure_show_tracking_details',
254
  array(
255
+ 'default' => $this->defaults['wcast_failure_show_tracking_details'],
256
  'transport' => 'refresh',
257
  'sanitize_callback' => ''
258
  )
259
  );
260
+ $wp_customize->add_control( 'wcast_failure_show_tracking_details',
261
  array(
262
  'label' => __( 'Show tracking details', 'woo-advanced-shipment-tracking' ),
263
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
264
+ 'section' => 'customer_failure_email',
265
  'type' => 'checkbox'
266
  )
267
  );
268
  // Display Shipment Provider image/thumbnail
269
+ $wp_customize->add_setting( 'wcast_failure_show_order_details',
270
  array(
271
+ 'default' => $this->defaults['wcast_failure_show_order_details'],
272
  'transport' => 'refresh',
273
  'sanitize_callback' => ''
274
  )
275
  );
276
+ $wp_customize->add_control( 'wcast_failure_show_order_details',
277
  array(
278
  'label' => __( 'Show order details', 'woo-advanced-shipment-tracking' ),
279
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
280
+ 'section' => 'customer_failure_email',
281
  'type' => 'checkbox'
282
  )
283
  );
284
  // Display Shipment Provider image/thumbnail
285
+ $wp_customize->add_setting( 'wcast_failure_show_billing_address',
286
  array(
287
+ 'default' => $this->defaults['wcast_failure_show_billing_address'],
288
  'transport' => 'refresh',
289
  'sanitize_callback' => ''
290
  )
291
  );
292
+ $wp_customize->add_control( 'wcast_failure_show_billing_address',
293
  array(
294
  'label' => __( 'Show billing address', 'woo-advanced-shipment-tracking' ),
295
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
296
+ 'section' => 'customer_failure_email',
297
  'type' => 'checkbox'
298
  )
299
  );
300
 
301
  // Display Shipment Provider image/thumbnail
302
+ $wp_customize->add_setting( 'wcast_failure_show_shipping_address',
303
  array(
304
+ 'default' => $this->defaults['wcast_failure_show_shipping_address'],
305
  'transport' => 'refresh',
306
  'sanitize_callback' => ''
307
  )
308
  );
309
+ $wp_customize->add_control( 'wcast_failure_show_shipping_address',
310
  array(
311
  'label' => __( 'Show shipping address', 'woo-advanced-shipment-tracking' ),
312
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
313
+ 'section' => 'customer_failure_email',
314
  'type' => 'checkbox'
315
  )
316
  );
317
 
318
  // Test of TinyMCE control
319
+ $wp_customize->add_setting( 'wcast_failure_email_content',
320
  array(
321
+ 'default' => $this->defaults['wcast_failure_email_content'],
322
  'transport' => 'refresh',
323
  'sanitize_callback' => 'wp_kses_post'
324
  )
325
  );
326
+ $wp_customize->add_control( new Skyrocket_TinyMCE_Custom_control( $wp_customize, 'wcast_failure_email_content',
327
  array(
328
  'label' => __( 'Email content', 'woo-advanced-shipment-tracking' ),
329
  'description' => __( '', 'woo-advanced-shipment-tracking' ),
330
+ 'section' => 'customer_failure_email',
331
  'input_attrs' => array(
332
  'toolbar1' => 'bold italic bullist numlist alignleft aligncenter alignright link',
333
  'mediaButtons' => true,
336
  ) );
337
 
338
 
339
+ $wp_customize->add_setting( 'wcast_failure_email_code_block',
340
  array(
341
+ 'default' => $this->defaults['wcast_failure_email_code_block'],
342
  'transport' => 'postMessage',
343
  'sanitize_callback' => ''
344
  )
345
  );
346
+ $wp_customize->add_control( new WP_Customize_codeinfoblock_Control( $wp_customize, 'wcast_failure_email_code_block',
347
  array(
348
  'label' => __( 'Available placeholders', 'woo-advanced-shipment-tracking' ),
349
  'description' => '<code>{site_title}<br>{customer_email}<br>{customer_first_name}<br>{customer_last_name}<br>{customer_username}<br>{order_number}<br>{est_delivery_date}</code>',
350
+ 'section' => 'customer_failure_email',
351
  )
352
  ) );
353
  }
360
  public function set_up_preview() {
361
 
362
  // Make sure this is own preview request.
363
+ if ( ! wcast_failure_customizer_email::is_own_preview_request() ) {
364
  return;
365
  }
366
+ include wc_advanced_shipment_tracking()->get_plugin_path() . '/includes/customizer/preview/failure_preview.php';
367
  exit;
368
  }
369
 
370
+ public function preview_failure_email(){
371
  // Load WooCommerce emails.
372
  $wc_emails = WC_Emails::instance();
373
  $emails = $wc_emails->get_emails();
374
+ $preview_id = get_theme_mod('wcast_failure_email_preview_order_id');
375
 
376
 
377
+ $email_heading = get_theme_mod('wcast_failure_email_heading');
378
  $email_heading = str_replace( '{site_title}', $this->get_blogname(), $email_heading );
379
  $email_heading = str_replace( '{order_number}', $preview_id, $email_heading );
380
 
381
+ $email_content = get_theme_mod('wcast_failure_email_content');
382
+ $wcast_show_tracking_details = get_theme_mod('wcast_failure_show_tracking_details');
383
+ $wcast_show_order_details = get_theme_mod('wcast_failure_show_order_details');
384
+ $wcast_show_billing_address = get_theme_mod('wcast_failure_show_billing_address');
385
+ $wcast_show_shipping_address = get_theme_mod('wcast_failure_show_shipping_address');
386
  $sent_to_admin = false;
387
  $plain_text = false;
388
  $email = '';
461
  * Initialise our Customizer settings
462
  */
463
 
464
+ $wcast_failure_customizer_email = new wcast_failure_customizer_email();
includes/customizer/class-wc-intransit-email-customizer.php CHANGED
@@ -51,6 +51,7 @@ class wcast_intransit_customizer_email {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
54
  // Send variables to Javascript
55
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
56
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -88,12 +89,12 @@ class wcast_intransit_customizer_email {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-intransit-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_intransit_customizer_email::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -104,8 +105,8 @@ class wcast_intransit_customizer_email {
104
  * @access public
105
  * @return string
106
  */
107
- public static function get_email_settings_page_url() {
108
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
109
  }
110
 
111
  public function wcast_generate_defaults() {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
54
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
55
  // Send variables to Javascript
56
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
57
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
  $customizer_url = add_query_arg( array(
94
  'wcast-customizer' => '1',
95
  'email' => $email,
96
  'url' => urlencode( add_query_arg( array( 'wcast-intransit-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
97
+ 'return' => urlencode( wcast_intransit_customizer_email::get_email_settings_page_url($return_tab) ),
98
  ), admin_url( 'customize.php' ) );
99
 
100
  return $customizer_url;
105
  * @access public
106
  * @return string
107
  */
108
+ public static function get_email_settings_page_url($return_tab) {
109
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
110
  }
111
 
112
  public function wcast_generate_defaults() {
includes/customizer/class-wc-outfordelivery-email-customizer.php CHANGED
@@ -51,6 +51,7 @@ class wcast_outfordelivery_customizer_email {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
54
  // Send variables to Javascript
55
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
56
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -88,12 +89,12 @@ class wcast_outfordelivery_customizer_email {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-outfordelivery-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_outfordelivery_customizer_email::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -104,8 +105,8 @@ class wcast_outfordelivery_customizer_email {
104
  * @access public
105
  * @return string
106
  */
107
- public static function get_email_settings_page_url() {
108
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
109
  }
110
 
111
  public function wcast_generate_defaults() {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
54
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
55
  // Send variables to Javascript
56
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
57
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
  $customizer_url = add_query_arg( array(
94
  'wcast-customizer' => '1',
95
  'email' => $email,
96
  'url' => urlencode( add_query_arg( array( 'wcast-outfordelivery-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
97
+ 'return' => urlencode( wcast_outfordelivery_customizer_email::get_email_settings_page_url($return_tab) ),
98
  ), admin_url( 'customize.php' ) );
99
 
100
  return $customizer_url;
105
  * @access public
106
  * @return string
107
  */
108
+ public static function get_email_settings_page_url($return_tab) {
109
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
110
  }
111
 
112
  public function wcast_generate_defaults() {
includes/customizer/class-wc-returntosender-email-customizer.php CHANGED
@@ -49,6 +49,7 @@ class wcast_returntosender_customizer_email {
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
52
  // Send variables to Javascript
53
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
54
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
@@ -88,12 +89,12 @@ class wcast_returntosender_customizer_email {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-returntosender-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_returntosender_customizer_email::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -105,8 +106,8 @@ class wcast_returntosender_customizer_email {
105
  * @access public
106
  * @return string
107
  */
108
- public static function get_email_settings_page_url() {
109
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
110
  }
111
 
112
  public function wcast_generate_defaults() {
49
 
50
  public function enqueue_preview_scripts() {
51
  wp_enqueue_script('wcast-email-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
52
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
53
  // Send variables to Javascript
54
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
55
  wp_localize_script('wcast-email-preview-scripts', 'wcast_preview', array(
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
  $customizer_url = add_query_arg( array(
94
  'wcast-customizer' => '1',
95
  'email' => $email,
96
  'url' => urlencode( add_query_arg( array( 'wcast-returntosender-email-customizer-preview' => '1' ), home_url( '/' ) ) ),
97
+ 'return' => urlencode( wcast_returntosender_customizer_email::get_email_settings_page_url($return_tab) ),
98
  ), admin_url( 'customize.php' ) );
99
 
100
  return $customizer_url;
106
  * @access public
107
  * @return string
108
  */
109
+ public static function get_email_settings_page_url($return_tab) {
110
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
111
  }
112
 
113
  public function wcast_generate_defaults() {
includes/customizer/class-wc-tracking-info-customizer.php CHANGED
@@ -51,6 +51,7 @@ class wcast_initialise_customizer_settings {
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . '/assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
54
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
55
  wp_localize_script('wcast-preview-scripts', 'wcast_preview', array(
56
  'site_title' => $this->get_blogname(),
@@ -88,12 +89,13 @@ class wcast_initialise_customizer_settings {
88
  * Get Customizer URL
89
  *
90
  */
91
- public static function get_customizer_url($email) {
 
92
  $customizer_url = add_query_arg( array(
93
  'wcast-customizer' => '1',
94
  'email' => $email,
95
  'url' => urlencode( add_query_arg( array( 'wcast-tracking-preview' => '1' ), home_url( '/' ) ) ),
96
- 'return' => urlencode( wcast_initialise_customizer_settings::get_email_settings_page_url() ),
97
  ), admin_url( 'customize.php' ) );
98
 
99
  return $customizer_url;
@@ -104,8 +106,8 @@ class wcast_initialise_customizer_settings {
104
  * @access public
105
  * @return string
106
  */
107
- public static function get_email_settings_page_url() {
108
- return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking' );
109
  }
110
  public function wcast_generate_defaults() {
111
  $customizer_defaults = array(
@@ -176,7 +178,7 @@ class wcast_initialise_customizer_settings {
176
  );
177
  $wp_customize->add_control( 'display_tracking_info_at',
178
  array(
179
- 'label' => __( 'Display Tracking Position', 'woo-advanced-shipment-tracking' ),
180
  'section' => 'default_controls_section',
181
  'type' => 'select',
182
  'choices' => array(
@@ -185,56 +187,6 @@ class wcast_initialise_customizer_settings {
185
  )
186
  )
187
  );
188
- // Display Shipment Provider image/thumbnail
189
- $wp_customize->add_setting( 'display_shipment_provider_image',
190
- array(
191
- 'default' => $this->defaults['display_shipment_provider_image'],
192
- 'transport' => 'postMessage',
193
- 'sanitize_callback' => ''
194
- )
195
- );
196
- $wp_customize->add_control( 'display_shipment_provider_image',
197
- array(
198
- 'label' => __( 'Shipment Provider image', 'woo-advanced-shipment-tracking' ),
199
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
200
- 'section' => 'default_controls_section',
201
- 'type' => 'checkbox'
202
- )
203
- );
204
-
205
- // Remove date from tracking info
206
- $wp_customize->add_setting( 'remove_date_from_tracking',
207
- array(
208
- 'default' => $this->defaults['remove_date_from_tracking'],
209
- 'transport' => 'postMessage',
210
- 'sanitize_callback' => ''
211
- )
212
- );
213
- $wp_customize->add_control( 'remove_date_from_tracking',
214
- array(
215
- 'label' => __( 'Remove date from tracking info', 'woo-advanced-shipment-tracking' ),
216
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
217
- 'section' => 'default_controls_section',
218
- 'type' => 'checkbox'
219
- )
220
- );
221
-
222
- // Show track label
223
- $wp_customize->add_setting( 'show_track_label',
224
- array(
225
- 'default' => $this->defaults['show_track_label'],
226
- 'transport' => 'postMessage',
227
- 'sanitize_callback' => ''
228
- )
229
- );
230
- $wp_customize->add_control( 'show_track_label',
231
- array(
232
- 'label' => __( 'Track Label', 'woo-advanced-shipment-tracking' ),
233
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
234
- 'section' => 'default_controls_section',
235
- 'type' => 'checkbox'
236
- )
237
- );
238
 
239
  // Header Text
240
  $wp_customize->add_setting( 'header_text_change',
@@ -246,7 +198,7 @@ class wcast_initialise_customizer_settings {
246
  );
247
  $wp_customize->add_control( 'header_text_change',
248
  array(
249
- 'label' => __( 'Header Text', 'woo-advanced-shipment-tracking' ),
250
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
251
  'section' => 'default_controls_section',
252
  'type' => 'text',
@@ -277,7 +229,7 @@ class wcast_initialise_customizer_settings {
277
  'placeholder' =>'',
278
  ),
279
  )
280
- );
281
 
282
  // Test of Toggle Switch Custom Control
283
  $wp_customize->add_setting( 'table_header',
@@ -289,11 +241,45 @@ class wcast_initialise_customizer_settings {
289
  );
290
  $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'table_header',
291
  array(
292
- 'label' => __( 'Table Design', 'woo-advanced-shipment-tracking' ),
293
  'section' => 'default_controls_section'
294
  )
295
  ) );
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  // Provider Header Text
298
  $wp_customize->add_setting( 'provider_header_text',
299
  array(
@@ -337,7 +323,6 @@ class wcast_initialise_customizer_settings {
337
  ),
338
  )
339
  );
340
-
341
  // Shipped Date Header Text
342
  $wp_customize->add_setting( 'shipped_date_header_text',
343
  array(
@@ -358,8 +343,23 @@ class wcast_initialise_customizer_settings {
358
  'placeholder' => __( 'Shipped Date', 'woo-advanced-shipment-tracking' ),
359
  ),
360
  )
 
 
 
 
 
 
 
 
361
  );
362
-
 
 
 
 
 
 
 
363
  // Track Header Text
364
  $wp_customize->add_setting( 'track_header_text',
365
  array(
@@ -382,6 +382,21 @@ class wcast_initialise_customizer_settings {
382
  )
383
  );
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  // Table content font weight
386
  $wp_customize->add_setting( 'table_padding',
387
  array(
@@ -469,26 +484,6 @@ class wcast_initialise_customizer_settings {
469
  )
470
  )
471
  );
472
- $font_size_array[ '' ] = __( 'Select', 'woo-advanced-shipment-tracking' );
473
- for ( $i = 10; $i <= 30; $i++ ) {
474
- $font_size_array[ $i ] = $i."px";
475
- }
476
- // Table header font size
477
- $wp_customize->add_setting( 'table_header_font_size',
478
- array(
479
- 'default' => $this->defaults['table_header_font_size'],
480
- 'transport' => 'postMessage',
481
- 'sanitize_callback' => ''
482
- )
483
- );
484
- $wp_customize->add_control( 'table_header_font_size',
485
- array(
486
- 'label' => __( 'Header font size', 'woo-advanced-shipment-tracking' ),
487
- 'section' => 'default_controls_section',
488
- 'type' => 'select',
489
- 'choices' => $font_size_array
490
- )
491
- );
492
 
493
  // Table Border size
494
  $wp_customize->add_setting( 'header_content_text_align',
@@ -500,7 +495,7 @@ class wcast_initialise_customizer_settings {
500
  );
501
  $wp_customize->add_control( 'header_content_text_align',
502
  array(
503
- 'label' => __( 'Header/content text align', 'woo-advanced-shipment-tracking' ),
504
  'section' => 'default_controls_section',
505
  'type' => 'select',
506
  'choices' => array(
@@ -512,6 +507,29 @@ class wcast_initialise_customizer_settings {
512
  )
513
  );
514
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  // Table header font color
516
  $wp_customize->add_setting( 'table_header_font_color',
517
  array(
@@ -522,7 +540,7 @@ class wcast_initialise_customizer_settings {
522
  );
523
  $wp_customize->add_control( 'table_header_font_color',
524
  array(
525
- 'label' => __( 'Header font color', 'woo-advanced-shipment-tracking' ),
526
  'section' => 'default_controls_section',
527
  'type' => 'color'
528
  )
@@ -538,7 +556,7 @@ class wcast_initialise_customizer_settings {
538
  );
539
  $wp_customize->add_control( 'table_content_font_size',
540
  array(
541
- 'label' => __( 'Content font size', 'woo-advanced-shipment-tracking' ),
542
  'section' => 'default_controls_section',
543
  'type' => 'select',
544
  'choices' => $font_size_array
@@ -555,7 +573,7 @@ class wcast_initialise_customizer_settings {
555
  );
556
  $wp_customize->add_control( 'table_content_font_color',
557
  array(
558
- 'label' => __( 'Content font color', 'woo-advanced-shipment-tracking' ),
559
  'section' => 'default_controls_section',
560
  'type' => 'color'
561
  )
@@ -614,7 +632,7 @@ class wcast_initialise_customizer_settings {
614
 
615
  $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'shipment_link_header',
616
  array(
617
- 'label' => __( 'Shipment Tracking Link', 'woo-advanced-shipment-tracking' ),
618
  'section' => 'default_controls_section'
619
  )
620
  ) );
@@ -628,7 +646,7 @@ class wcast_initialise_customizer_settings {
628
  );
629
  $wp_customize->add_control( 'tracking_link_font_color',
630
  array(
631
- 'label' => __( 'Tracking Link Font Color', 'woo-advanced-shipment-tracking' ),
632
  'section' => 'default_controls_section',
633
  'type' => 'color'
634
  )
@@ -644,7 +662,7 @@ class wcast_initialise_customizer_settings {
644
  );
645
  $wp_customize->add_control( 'tracking_link_bg_color',
646
  array(
647
- 'label' => __( 'Tracking Link Background Color', 'woo-advanced-shipment-tracking' ),
648
  'section' => 'default_controls_section',
649
  'type' => 'color'
650
  )
@@ -659,7 +677,7 @@ class wcast_initialise_customizer_settings {
659
  );
660
  $wp_customize->add_control( 'tracking_link_border',
661
  array(
662
- 'label' => __( 'Tracking link Border', 'woo-advanced-shipment-tracking' ),
663
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
664
  'section' => 'default_controls_section',
665
  'type' => 'checkbox'
51
 
52
  public function enqueue_preview_scripts() {
53
  wp_enqueue_script('wcast-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . '/assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
54
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
55
  $preview_id = get_theme_mod('wcast_email_preview_order_id');
56
  wp_localize_script('wcast-preview-scripts', 'wcast_preview', array(
57
  'site_title' => $this->get_blogname(),
89
  * Get Customizer URL
90
  *
91
  */
92
+ public static function get_customizer_url($email,$return_tab) {
93
+ //echo $return_tab;exit;
94
  $customizer_url = add_query_arg( array(
95
  'wcast-customizer' => '1',
96
  'email' => $email,
97
  'url' => urlencode( add_query_arg( array( 'wcast-tracking-preview' => '1' ), home_url( '/' ) ) ),
98
+ 'return' => urlencode( wcast_initialise_customizer_settings::get_email_settings_page_url($return_tab) ),
99
  ), admin_url( 'customize.php' ) );
100
 
101
  return $customizer_url;
106
  * @access public
107
  * @return string
108
  */
109
+ public static function get_email_settings_page_url($return_tab) {
110
+ return admin_url( 'admin.php?page=woocommerce-advanced-shipment-tracking&tab='.$return_tab );
111
  }
112
  public function wcast_generate_defaults() {
113
  $customizer_defaults = array(
178
  );
179
  $wp_customize->add_control( 'display_tracking_info_at',
180
  array(
181
+ 'label' => __( 'Tracking Display Position', 'woo-advanced-shipment-tracking' ),
182
  'section' => 'default_controls_section',
183
  'type' => 'select',
184
  'choices' => array(
187
  )
188
  )
189
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  // Header Text
192
  $wp_customize->add_setting( 'header_text_change',
198
  );
199
  $wp_customize->add_control( 'header_text_change',
200
  array(
201
+ 'label' => __( 'Main Header text', 'woo-advanced-shipment-tracking' ),
202
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
203
  'section' => 'default_controls_section',
204
  'type' => 'text',
229
  'placeholder' =>'',
230
  ),
231
  )
232
+ );
233
 
234
  // Test of Toggle Switch Custom Control
235
  $wp_customize->add_setting( 'table_header',
241
  );
242
  $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'table_header',
243
  array(
244
+ 'label' => __( 'Table Layout', 'woo-advanced-shipment-tracking' ),
245
  'section' => 'default_controls_section'
246
  )
247
  ) );
248
 
249
+ // Display Shipment Provider image/thumbnail
250
+ $wp_customize->add_setting( 'display_shipment_provider_image',
251
+ array(
252
+ 'default' => $this->defaults['display_shipment_provider_image'],
253
+ 'transport' => 'postMessage',
254
+ 'sanitize_callback' => ''
255
+ )
256
+ );
257
+ $wp_customize->add_control( 'display_shipment_provider_image',
258
+ array(
259
+ 'label' => __( 'Display Shipment Provider image', 'woo-advanced-shipment-tracking' ),
260
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
261
+ 'section' => 'default_controls_section',
262
+ 'type' => 'checkbox'
263
+ )
264
+ );
265
+
266
+ // Remove date from tracking info
267
+ $wp_customize->add_setting( 'remove_date_from_tracking',
268
+ array(
269
+ 'default' => $this->defaults['remove_date_from_tracking'],
270
+ 'transport' => 'postMessage',
271
+ 'sanitize_callback' => ''
272
+ )
273
+ );
274
+ $wp_customize->add_control( 'remove_date_from_tracking',
275
+ array(
276
+ 'label' => __( 'Hide date', 'woo-advanced-shipment-tracking' ),
277
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
278
+ 'section' => 'default_controls_section',
279
+ 'type' => 'checkbox'
280
+ )
281
+ );
282
+
283
  // Provider Header Text
284
  $wp_customize->add_setting( 'provider_header_text',
285
  array(
323
  ),
324
  )
325
  );
 
326
  // Shipped Date Header Text
327
  $wp_customize->add_setting( 'shipped_date_header_text',
328
  array(
343
  'placeholder' => __( 'Shipped Date', 'woo-advanced-shipment-tracking' ),
344
  ),
345
  )
346
+ );
347
+ // Show track label
348
+ $wp_customize->add_setting( 'show_track_label',
349
+ array(
350
+ 'default' => $this->defaults['show_track_label'],
351
+ 'transport' => 'postMessage',
352
+ 'sanitize_callback' => ''
353
+ )
354
  );
355
+ $wp_customize->add_control( 'show_track_label',
356
+ array(
357
+ 'label' => __( 'Track Label', 'woo-advanced-shipment-tracking' ),
358
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
359
+ 'section' => 'default_controls_section',
360
+ 'type' => 'checkbox'
361
+ )
362
+ );
363
  // Track Header Text
364
  $wp_customize->add_setting( 'track_header_text',
365
  array(
382
  )
383
  );
384
 
385
+ // Test of Toggle Switch Custom Control
386
+ $wp_customize->add_setting( 'table_header',
387
+ array(
388
+ 'default' => '',
389
+ 'transport' => 'postMessage',
390
+ 'sanitize_callback' => ''
391
+ )
392
+ );
393
+ $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'table_header',
394
+ array(
395
+ 'label' => __( 'Table Design', 'woo-advanced-shipment-tracking' ),
396
+ 'section' => 'default_controls_section'
397
+ )
398
+ ) );
399
+
400
  // Table content font weight
401
  $wp_customize->add_setting( 'table_padding',
402
  array(
484
  )
485
  )
486
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
 
488
  // Table Border size
489
  $wp_customize->add_setting( 'header_content_text_align',
495
  );
496
  $wp_customize->add_control( 'header_content_text_align',
497
  array(
498
+ 'label' => __( 'Table text align', 'woo-advanced-shipment-tracking' ),
499
  'section' => 'default_controls_section',
500
  'type' => 'select',
501
  'choices' => array(
507
  )
508
  );
509
 
510
+ $font_size_array[ '' ] = __( 'Select', 'woo-advanced-shipment-tracking' );
511
+ for ( $i = 10; $i <= 30; $i++ ) {
512
+ $font_size_array[ $i ] = $i."px";
513
+ }
514
+ // Table header font size
515
+ $wp_customize->add_setting( 'table_header_font_size',
516
+ array(
517
+ 'default' => $this->defaults['table_header_font_size'],
518
+ 'transport' => 'postMessage',
519
+ 'sanitize_callback' => ''
520
+ )
521
+ );
522
+ $wp_customize->add_control( 'table_header_font_size',
523
+ array(
524
+ 'label' => __( 'Table header font size', 'woo-advanced-shipment-tracking' ),
525
+ 'section' => 'default_controls_section',
526
+ 'type' => 'select',
527
+ 'choices' => $font_size_array
528
+ )
529
+ );
530
+
531
+
532
+
533
  // Table header font color
534
  $wp_customize->add_setting( 'table_header_font_color',
535
  array(
540
  );
541
  $wp_customize->add_control( 'table_header_font_color',
542
  array(
543
+ 'label' => __( 'Table header font color', 'woo-advanced-shipment-tracking' ),
544
  'section' => 'default_controls_section',
545
  'type' => 'color'
546
  )
556
  );
557
  $wp_customize->add_control( 'table_content_font_size',
558
  array(
559
+ 'label' => __( 'Table content font size', 'woo-advanced-shipment-tracking' ),
560
  'section' => 'default_controls_section',
561
  'type' => 'select',
562
  'choices' => $font_size_array
573
  );
574
  $wp_customize->add_control( 'table_content_font_color',
575
  array(
576
+ 'label' => __( 'Table content font color', 'woo-advanced-shipment-tracking' ),
577
  'section' => 'default_controls_section',
578
  'type' => 'color'
579
  )
632
 
633
  $wp_customize->add_control( new WP_Customize_Heading_Control( $wp_customize, 'shipment_link_header',
634
  array(
635
+ 'label' => __( 'Track Link', 'woo-advanced-shipment-tracking' ),
636
  'section' => 'default_controls_section'
637
  )
638
  ) );
646
  );
647
  $wp_customize->add_control( 'tracking_link_font_color',
648
  array(
649
+ 'label' => __( 'Track Link Font Color', 'woo-advanced-shipment-tracking' ),
650
  'section' => 'default_controls_section',
651
  'type' => 'color'
652
  )
662
  );
663
  $wp_customize->add_control( 'tracking_link_bg_color',
664
  array(
665
+ 'label' => __( 'Track Link Background Color', 'woo-advanced-shipment-tracking' ),
666
  'section' => 'default_controls_section',
667
  'type' => 'color'
668
  )
677
  );
678
  $wp_customize->add_control( 'tracking_link_border',
679
  array(
680
+ 'label' => __( 'Track link Border', 'woo-advanced-shipment-tracking' ),
681
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
682
  'section' => 'default_controls_section',
683
  'type' => 'checkbox'
includes/customizer/class-wc-tracking-page-customizer.php CHANGED
@@ -55,6 +55,7 @@ class wcast_tracking_page_customizer {
55
  public function enqueue_preview_scripts() {
56
 
57
  wp_enqueue_script('wcast-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . '/assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
 
58
  wp_localize_script('wcast-preview-scripts', 'wcast_preview', array(
59
  'site_title' => $this->get_blogname(),
60
  ));
55
  public function enqueue_preview_scripts() {
56
 
57
  wp_enqueue_script('wcast-preview-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . '/assets/js/preview-scripts.js', array('jquery', 'customize-preview'), wc_advanced_shipment_tracking()->version, true);
58
+ wp_enqueue_style('wcast-preview-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/preview-styles.css', array(), wc_advanced_shipment_tracking()->version );
59
  wp_localize_script('wcast-preview-scripts', 'wcast_preview', array(
60
  'site_title' => $this->get_blogname(),
61
  ));
includes/customizer/class-wcast-customizer.php CHANGED
@@ -52,22 +52,16 @@ class WC_Advanced_Shipment_Tracking_Customizer {
52
  'panel' => 'wcast_naviation_panel'
53
  )
54
  );
55
- /*$wp_customize->add_section( 'tracking_page_section',
56
- array(
57
- 'title' => __( 'Tracking Page', 'woo-advanced-shipment-tracking' ),
58
- 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
59
- 'panel' => 'wcast_naviation_panel'
60
- )
61
- );*/
62
  $wp_customize->add_section( 'customer_delivered_email',
63
  array(
64
  'title' => __( 'Delivered order status email', 'woo-advanced-shipment-tracking' ),
65
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
66
- 'panel' => 'wcast_emails_panel'
67
  )
68
  );
69
 
70
- $wp_customize->add_section( 'customer_pretransit_email',
71
  array(
72
  'title' => __( 'Pre Transit', 'woo-advanced-shipment-tracking' ),
73
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
@@ -81,40 +75,48 @@ class WC_Advanced_Shipment_Tracking_Customizer {
81
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
82
  'panel' => 'wcast_emails_panel'
83
  )
84
- );
85
 
86
- $wp_customize->add_section( 'customer_outfordelivery_email',
87
  array(
88
- 'title' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ),
89
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
90
  'panel' => 'wcast_emails_panel'
91
  )
92
- );
93
-
94
- $wp_customize->add_section( 'customer_delivered_status_email',
95
  array(
96
- 'title' => __( 'Delivered', 'woo-advanced-shipment-tracking' ),
 
 
 
 
 
 
 
97
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
98
  'panel' => 'wcast_emails_panel'
99
  )
100
  );
101
 
102
- $wp_customize->add_section( 'customer_returntosender_email',
103
  array(
104
- 'title' => __( 'Return To Sender', 'woo-advanced-shipment-tracking' ),
105
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
106
  'panel' => 'wcast_emails_panel'
107
  )
108
  );
109
- $wp_customize->add_section( 'customer_availableforpickup_email',
 
110
  array(
111
- 'title' => __( 'Available For Pickup', 'woo-advanced-shipment-tracking' ),
112
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
113
  'panel' => 'wcast_emails_panel'
114
  )
115
  );
116
  }
117
  public function enqueue_customizer_scripts(){
 
118
  if(isset( $_REQUEST['wcast-customizer'] ) && '1' === $_REQUEST['wcast-customizer']){
119
  wp_enqueue_style('wcast-customizer-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/customizer-styles.css', array(), wc_advanced_shipment_tracking()->version );
120
  wp_enqueue_script('wcast-customizer-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/customizer-scripts.js', array('jquery', 'customize-controls'), wc_advanced_shipment_tracking()->version, true);
@@ -125,13 +127,14 @@ class WC_Advanced_Shipment_Tracking_Customizer {
125
  'email_preview_url' => $this->get_email_preview_url(),
126
  'tracking_preview_url' => $this->get_tracking_preview_url(),
127
  'tracking_page_preview_url' => $this->get_tracking_page_preview_url(),
128
- 'customer_pretransit_preview_url' => $this->get_customer_pretransit_preview_url(),
129
  'customer_intransit_preview_url' => $this->get_customer_intransit_preview_url(),
130
  'customer_outfordelivery_preview_url' => $this->get_customer_outfordelivery_preview_url(),
131
  'customer_delivered_preview_url' => $this->get_customer_delivered_preview_url(),
132
  'customer_returntosender_preview_url' => $this->get_customer_returntosender_preview_url(),
133
  'customer_availableforpickup_preview_url' => $this->get_customer_availableforpickup_preview_url(),
134
- 'trigger_click' => '#accordion-section-'.$_REQUEST['email'].' h3',
 
135
  ));
136
  }
137
  }
@@ -172,12 +175,12 @@ class WC_Advanced_Shipment_Tracking_Customizer {
172
  * Get Tracking page preview URL
173
  *
174
  */
175
- public static function get_customer_pretransit_preview_url() {
176
- $customer_pretransit_preview_url = add_query_arg( array(
177
- 'wcast-pretransit-email-customizer-preview' => '1',
178
  ), home_url( '' ) );
179
 
180
- return $customer_pretransit_preview_url;
181
  }
182
  /**
183
  * Get Tracking page preview URL
@@ -315,7 +318,7 @@ class WC_Advanced_Shipment_Tracking_Customizer {
315
  */
316
  public static function is_own_section( $key ) {
317
 
318
- if ($key === 'default_controls_section' || $key === 'tracking_page_section' || $key === 'customer_delivered_email' || $key === 'customer_pretransit_email' || $key === 'customer_intransit_email' || $key === 'customer_outfordelivery_email' || $key === 'customer_delivered_status_email' || $key === 'customer_returntosender_email' || $key === 'customer_availableforpickup_email') {
319
  return true;
320
  }
321
 
52
  'panel' => 'wcast_naviation_panel'
53
  )
54
  );
55
+
 
 
 
 
 
 
56
  $wp_customize->add_section( 'customer_delivered_email',
57
  array(
58
  'title' => __( 'Delivered order status email', 'woo-advanced-shipment-tracking' ),
59
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
60
+ 'panel' => 'wcast_naviation_panel'
61
  )
62
  );
63
 
64
+ $wp_customize->add_section( 'customer_failure_email',
65
  array(
66
  'title' => __( 'Pre Transit', 'woo-advanced-shipment-tracking' ),
67
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
75
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
76
  'panel' => 'wcast_emails_panel'
77
  )
78
+ );
79
 
80
+ $wp_customize->add_section( 'customer_returntosender_email',
81
  array(
82
+ 'title' => __( 'Return To Sender', 'woo-advanced-shipment-tracking' ),
83
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
84
  'panel' => 'wcast_emails_panel'
85
  )
86
+ );
87
+ $wp_customize->add_section( 'customer_availableforpickup_email',
 
88
  array(
89
+ 'title' => __( 'Available For Pickup', 'woo-advanced-shipment-tracking' ),
90
+ 'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
91
+ 'panel' => 'wcast_emails_panel'
92
+ )
93
+ );
94
+ $wp_customize->add_section( 'customer_outfordelivery_email',
95
+ array(
96
+ 'title' => __( 'Out For Delivery', 'woo-advanced-shipment-tracking' ),
97
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
98
  'panel' => 'wcast_emails_panel'
99
  )
100
  );
101
 
102
+ $wp_customize->add_section( 'customer_delivered_status_email',
103
  array(
104
+ 'title' => __( 'Delivered', 'woo-advanced-shipment-tracking' ),
105
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
106
  'panel' => 'wcast_emails_panel'
107
  )
108
  );
109
+
110
+ $wp_customize->add_section( 'customer_failure_email',
111
  array(
112
+ 'title' => __( 'Failed Attempt', 'woo-advanced-shipment-tracking' ),
113
  'description' => esc_html__( '', 'woo-advanced-shipment-tracking' ),
114
  'panel' => 'wcast_emails_panel'
115
  )
116
  );
117
  }
118
  public function enqueue_customizer_scripts(){
119
+ $wcast_enable_delivered_email = get_option('woocommerce_customer_delivered_order_settings');
120
  if(isset( $_REQUEST['wcast-customizer'] ) && '1' === $_REQUEST['wcast-customizer']){
121
  wp_enqueue_style('wcast-customizer-styles', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/css/customizer-styles.css', array(), wc_advanced_shipment_tracking()->version );
122
  wp_enqueue_script('wcast-customizer-scripts', wc_advanced_shipment_tracking()->plugin_dir_url() . 'assets/js/customizer-scripts.js', array('jquery', 'customize-controls'), wc_advanced_shipment_tracking()->version, true);
127
  'email_preview_url' => $this->get_email_preview_url(),
128
  'tracking_preview_url' => $this->get_tracking_preview_url(),
129
  'tracking_page_preview_url' => $this->get_tracking_page_preview_url(),
130
+ 'customer_failure_preview_url' => $this->get_customer_failure_preview_url(),
131
  'customer_intransit_preview_url' => $this->get_customer_intransit_preview_url(),
132
  'customer_outfordelivery_preview_url' => $this->get_customer_outfordelivery_preview_url(),
133
  'customer_delivered_preview_url' => $this->get_customer_delivered_preview_url(),
134
  'customer_returntosender_preview_url' => $this->get_customer_returntosender_preview_url(),
135
  'customer_availableforpickup_preview_url' => $this->get_customer_availableforpickup_preview_url(),
136
+ 'trigger_click' => '#accordion-section-'.$_REQUEST['email'].' h3',
137
+ 'wcast_enable_delivered_email' => $wcast_enable_delivered_email['enabled'],
138
  ));
139
  }
140
  }
175
  * Get Tracking page preview URL
176
  *
177
  */
178
+ public static function get_customer_failure_preview_url() {
179
+ $customer_failure_preview_url = add_query_arg( array(
180
+ 'wcast-failure-email-customizer-preview' => '1',
181
  ), home_url( '' ) );
182
 
183
+ return $customer_failure_preview_url;
184
  }
185
  /**
186
  * Get Tracking page preview URL
318
  */
319
  public static function is_own_section( $key ) {
320
 
321
+ if ($key === 'default_controls_section' || $key === 'tracking_page_section' || $key === 'customer_delivered_email' || $key === 'customer_failure_email' || $key === 'customer_intransit_email' || $key === 'customer_outfordelivery_email' || $key === 'customer_delivered_status_email' || $key === 'customer_returntosender_email' || $key === 'customer_availableforpickup_email') {
322
  return true;
323
  }
324
 
includes/customizer/preview/availableforpickup_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_availableforpickup_customizer_email::preview_availableforpickup_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_availableforpickup_customizer_email::preview_availableforpickup_email(); ?>
21
 
includes/customizer/preview/delivered_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_initialise_customizer_email::preview_delivered_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_initialise_customizer_email::preview_delivered_email(); ?>
21
 
includes/customizer/preview/delivered_status_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_delivered_customizer_email::preview_delivered_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_delivered_customizer_email::preview_delivered_email(); ?>
21
 
includes/customizer/preview/failure_preview.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Exit if accessed directly
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ ?>
8
+
9
+ <head>
10
+
11
+ <meta charset="<?php bloginfo('charset'); ?>" />
12
+ <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
+ </head>
15
+
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
+
20
+ <?php wcast_failure_customizer_email::preview_failure_email(); ?>
21
+
22
+ </div>
23
+
24
+ <?php
25
+ do_action( 'woomail_footer' );
26
+ wp_footer(); ?>
27
+
28
+ </body>
29
+
30
+ </html>
includes/customizer/preview/intransit_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_intransit_customizer_email::preview_intransit_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_intransit_customizer_email::preview_intransit_email(); ?>
21
 
includes/customizer/preview/outfordelivery_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_outfordelivery_customizer_email::preview_outfordelivery_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_outfordelivery_customizer_email::preview_outfordelivery_email(); ?>
21
 
includes/customizer/preview/pretransit_preview.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if (!defined('ABSPATH')) {
4
- exit;
5
- }
6
-
7
- ?>
8
-
9
- <head>
10
-
11
- <meta charset="<?php bloginfo('charset'); ?>" />
12
- <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
-
20
- <?php wcast_pretransit_customizer_email::preview_pretransit_email(); ?>
21
-
22
- </div>
23
-
24
- <?php
25
- do_action( 'woomail_footer' );
26
- wp_footer(); ?>
27
-
28
- </body>
29
-
30
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/customizer/preview/preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_initialise_customizer_settings::preview_completed_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_initialise_customizer_settings::preview_completed_email(); ?>
21
 
includes/customizer/preview/returntosender_preview.php CHANGED
@@ -10,12 +10,12 @@ if (!defined('ABSPATH')) {
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
- <style type="text/css" id="kadence_woomail_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
- <body>
17
-
18
- <div id="kt_woomail_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_returntosender_customizer_email::preview_returntosender_email(); ?>
21
 
10
 
11
  <meta charset="<?php bloginfo('charset'); ?>" />
12
  <meta name="viewport" content="width=device-width" />
13
+ <style type="text/css" id="ast_designer_custom_css">.woocommerce-store-notice.demo_store, .mfp-hide {display: none;}</style>
14
  </head>
15
 
16
+ <body class="ast_preview_body">
17
+ <div id="overlay"></div>
18
+ <div id="ast_preview_wrapper" style="display: block;">
19
 
20
  <?php wcast_returntosender_customizer_email::preview_returntosender_email(); ?>
21
 
includes/emails/class-shipment-delivered-email.php CHANGED
@@ -62,7 +62,7 @@ if ( ! class_exists( 'WC_Email_Customer_Delivered_Order', false ) ) :
62
  * @param WC_Order|false $order Order object.
63
  */
64
  public function trigger( $order_id, $order = false ) {
65
-
66
  $this->setup_locale();
67
 
68
  if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
@@ -107,76 +107,93 @@ if ( ! class_exists( 'WC_Email_Customer_Delivered_Order', false ) ) :
107
  *
108
  * @return string
109
  */
110
- public function get_content_html() {
111
- $order = $this->object;
112
- $order_id = $order->get_id();
113
- $mailer = WC()->mailer();
114
-
115
- $email_heading = $this->get_heading();
116
- //ob_start();
117
- $email_content = get_theme_mod('wcast_delivered_email_content');
118
- $wcast_show_tracking_details = get_theme_mod('wcast_show_tracking_details');
119
- $wcast_show_order_details = get_theme_mod('wcast_show_order_details');
120
- $wcast_show_billing_address = get_theme_mod('wcast_show_billing_address');
121
- $wcast_show_shipping_address = get_theme_mod('wcast_show_shipping_address');
122
- $message = wc_advanced_shipment_tracking_email_class()->email_content($email_content,$order_id,$order);
123
-
124
- $wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
125
- $sent_to_admin = false;
126
- $plain_text = false;
127
 
128
- if($wcast_show_tracking_details == 1){
129
- ob_start();
130
- wc_get_template( 'emails/tracking-info.php', array(
131
- 'tracking_items' => $wast->get_tracking_items( $order_id, true )
132
- ), 'woocommerce-advanced-shipment-tracking/', wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/' );
133
- $message .= ob_get_clean();
134
- }
135
- if($wcast_show_order_details == 1){
 
 
 
 
 
 
 
 
136
 
137
- ob_start();
138
- wc_get_template(
139
- 'emails/wcast-email-order-details.php', array(
140
- 'order' => $order,
141
- 'sent_to_admin' => $sent_to_admin,
142
- 'plain_text' => $plain_text,
143
- 'email' => '',
144
- ),
145
- 'woocommerce-advanced-shipment-tracking/',
146
- wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
147
- );
148
- $message .= ob_get_clean();
149
- }
150
- if($wcast_show_billing_address == 1){
151
- ob_start();
152
- wc_get_template(
153
- 'emails/wcast-billing-email-addresses.php', array(
154
- 'order' => $order,
155
- 'sent_to_admin' => $sent_to_admin,
156
- ),
157
- 'woocommerce-advanced-shipment-tracking/',
158
- wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
159
- );
160
- $message .= ob_get_clean();
161
- }
162
- if($wcast_show_shipping_address == 1){
163
- ob_start();
164
- wc_get_template(
165
- 'emails/wcast-shipping-email-addresses.php', array(
166
  'order' => $order,
167
  'sent_to_admin' => $sent_to_admin,
168
- ),
169
- 'woocommerce-advanced-shipment-tracking/',
170
- wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
171
- );
172
- $message .= ob_get_clean();
173
- }
174
- // create a new email
175
- $email = new WC_Email();
176
- $email->id = 'WC_Delivered_email';
177
- // wrap the content with the email template and then add styles
178
- $message = apply_filters( 'woocommerce_mail_content', $email->style_inline( $mailer->wrap_message( $email_heading, $message ) ) );
179
- return $message;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  /**
62
  * @param WC_Order|false $order Order object.
63
  */
64
  public function trigger( $order_id, $order = false ) {
65
+ //echo $this->template_base;exit;
66
  $this->setup_locale();
67
 
68
  if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
107
  *
108
  * @return string
109
  */
110
+ public function get_content_html() {
111
+ $template = $this->get_template( 'template_html' );
112
+ $local_file = $this->get_theme_template_file( $template );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
+ if ( file_exists( $local_file ) && is_writable( $local_file )){
115
+ //echo $local_file;exit;
116
+ return wc_get_template_html(
117
+ $this->template_html,
118
+ array(
119
+ 'order' => $this->object,
120
+ 'email_heading' => $this->get_heading(),
121
+ 'sent_to_admin' => false,
122
+ 'plain_text' => false,
123
+ 'email' => $this,
124
+ )
125
+ );
126
+ } else{
127
+ $order = $this->object;
128
+ $order_id = $order->get_id();
129
+ $mailer = WC()->mailer();
130
 
131
+ $email_heading = $this->get_heading();
132
+ //ob_start();
133
+ $email_content = get_theme_mod('wcast_delivered_email_content');
134
+ $wcast_show_tracking_details = get_theme_mod('wcast_show_tracking_details');
135
+ $wcast_show_order_details = get_theme_mod('wcast_show_order_details');
136
+ $wcast_show_billing_address = get_theme_mod('wcast_show_billing_address');
137
+ $wcast_show_shipping_address = get_theme_mod('wcast_show_shipping_address');
138
+ $message = wc_advanced_shipment_tracking_email_class()->email_content($email_content,$order_id,$order);
139
+
140
+ $wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
141
+ $sent_to_admin = false;
142
+ $plain_text = false;
143
+
144
+ if($wcast_show_tracking_details == 1){
145
+ ob_start();
146
+ wc_get_template( 'emails/tracking-info.php', array(
147
+ 'tracking_items' => $wast->get_tracking_items( $order_id, true )
148
+ ), 'woocommerce-advanced-shipment-tracking/', wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/' );
149
+ $message .= ob_get_clean();
150
+ }
151
+ if($wcast_show_order_details == 1){
152
+
153
+ ob_start();
154
+ wc_get_template(
155
+ 'emails/wcast-email-order-details.php', array(
 
 
 
 
156
  'order' => $order,
157
  'sent_to_admin' => $sent_to_admin,
158
+ 'plain_text' => $plain_text,
159
+ 'email' => '',
160
+ ),
161
+ 'woocommerce-advanced-shipment-tracking/',
162
+ wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
163
+ );
164
+ $message .= ob_get_clean();
165
+ }
166
+ if($wcast_show_billing_address == 1){
167
+ ob_start();
168
+ wc_get_template(
169
+ 'emails/wcast-billing-email-addresses.php', array(
170
+ 'order' => $order,
171
+ 'sent_to_admin' => $sent_to_admin,
172
+ ),
173
+ 'woocommerce-advanced-shipment-tracking/',
174
+ wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
175
+ );
176
+ $message .= ob_get_clean();
177
+ }
178
+ if($wcast_show_shipping_address == 1){
179
+ ob_start();
180
+ wc_get_template(
181
+ 'emails/wcast-shipping-email-addresses.php', array(
182
+ 'order' => $order,
183
+ 'sent_to_admin' => $sent_to_admin,
184
+ ),
185
+ 'woocommerce-advanced-shipment-tracking/',
186
+ wc_advanced_shipment_tracking()->get_plugin_path() . '/templates/'
187
+ );
188
+ $message .= ob_get_clean();
189
+ }
190
+ // create a new email
191
+ $email = new WC_Email();
192
+ $email->id = 'WC_Delivered_email';
193
+ // wrap the content with the email template and then add styles
194
+ $message = apply_filters( 'woocommerce_mail_content', $email->style_inline( $mailer->wrap_message( $email_heading, $message ) ) );
195
+ return $message;
196
+ }
197
  }
198
 
199
  /**
includes/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php CHANGED
@@ -110,11 +110,11 @@ if ( ! class_exists( 'PAnD' ) ) {
110
  public static function dismiss_admin_notice() {
111
  $option_name = sanitize_text_field( $_POST['option_name'] );
112
  $dismissible_length = sanitize_text_field( $_POST['dismissible_length'] );
113
-
114
  if ( 'forever' != $dismissible_length ) {
115
  // If $dismissible_length is not an integer default to 1
116
  $dismissible_length = ( 0 == absint( $dismissible_length ) ) ? 1 : $dismissible_length;
117
- $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
118
  }
119
 
120
  check_ajax_referer( 'dismissible-notice', 'nonce' );
110
  public static function dismiss_admin_notice() {
111
  $option_name = sanitize_text_field( $_POST['option_name'] );
112
  $dismissible_length = sanitize_text_field( $_POST['dismissible_length'] );
113
+
114
  if ( 'forever' != $dismissible_length ) {
115
  // If $dismissible_length is not an integer default to 1
116
  $dismissible_length = ( 0 == absint( $dismissible_length ) ) ? 1 : $dismissible_length;
117
+ $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
118
  }
119
 
120
  check_ajax_referer( 'dismissible-notice', 'nonce' );
includes/views/admin_options_bulk_upload.php CHANGED
@@ -1,12 +1,11 @@
1
  <section id="content4" class="tab_section">
2
- <div class="mdl-grid">
3
- <div class="mdl-cell mdl-cell--12-col">
4
  <form method="post" id="wc_ast_upload_csv_form" action="" enctype="multipart/form-data">
5
- <h3><?php _e('Upload CSV', 'woo-advanced-shipment-tracking'); ?></h3>
6
  <table class="form-table upload_csv_table">
7
  <tbody>
8
  <tr valign="top" class="">
9
- <td scope="row" class="input_file_cl">
10
  <input type="file" name="trcking_csv_file" id="trcking_csv_file">
11
  </td>
12
  </tr>
@@ -39,8 +38,7 @@
39
  <ol class="csv_upload_status">
40
 
41
  </ol>
42
- </form>
43
- </div>
44
  <!--div class="mdl-cell mdl-cell--6-col">
45
  <h3><?php _e('Bulk import tracking info', 'woo-advanced-shipment-tracking'); ?></h3>
46
  <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>
@@ -52,6 +50,5 @@
52
  <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>
53
  </ul>
54
  <a class="button-primary btn_green" href="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/tracking.csv" download><?php _e('Download sample csv file', 'woo-advanced-shipment-tracking'); ?></a>
55
- </div-->
56
- </div>
57
  </section>
1
  <section id="content4" class="tab_section">
2
+ <h3><?php _e('Upload CSV', 'woo-advanced-shipment-tracking'); ?></h3>
 
3
  <form method="post" id="wc_ast_upload_csv_form" action="" enctype="multipart/form-data">
4
+
5
  <table class="form-table upload_csv_table">
6
  <tbody>
7
  <tr valign="top" class="">
8
+ <td scope="row" class="input_file_cl" colspan="2">
9
  <input type="file" name="trcking_csv_file" id="trcking_csv_file">
10
  </td>
11
  </tr>
38
  <ol class="csv_upload_status">
39
 
40
  </ol>
41
+ </form>
 
42
  <!--div class="mdl-cell mdl-cell--6-col">
43
  <h3><?php _e('Bulk import tracking info', 'woo-advanced-shipment-tracking'); ?></h3>
44
  <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>
50
  <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>
51
  </ul>
52
  <a class="button-primary btn_green" href="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/tracking.csv" download><?php _e('Download sample csv file', 'woo-advanced-shipment-tracking'); ?></a>
53
+ </div-->
 
54
  </section>
includes/views/admin_options_email_notifications.php CHANGED
@@ -20,23 +20,11 @@
20
  </span>
21
  </span>
22
  <a href="<?php echo wcast_initialise_customizer_email::get_customizer_url('customer_delivered_email') ?>" class="email_heading"><?php _e('Delivered order status email', 'woo-advanced-shipment-tracking'); ?></a>
23
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_initialise_customizer_email::get_customizer_url('customer_delivered_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
24
  </label>
25
  <?php
26
  if($wc_ast_api_key){
27
- ?>
28
-
29
- <label class="headig_label <?php if($wcast_enable_pretransit_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
30
- <span class="email_status_span">
31
- <span class="mdl-list__item-secondary-action shipment_status_toggle">
32
- <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_pretransit_email">
33
- <input type="checkbox" name="wcast_enable_pretransit_email" id="wcast_enable_pretransit_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_pretransit_email == 1) { echo 'checked'; } ?> />
34
- </label>
35
- </span>
36
- </span>
37
- <a href="<?php echo wcast_pretransit_customizer_email::get_customizer_url('customer_pretransit_email') ?>" class="email_heading"><?php _e('Pre Transit shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
38
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_pretransit_customizer_email::get_customizer_url('customer_pretransit_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
39
- </label>
40
 
41
  <label class="headig_label <?php if($wcast_enable_intransit_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
42
  <span class="email_status_span">
@@ -47,7 +35,7 @@
47
  </span>
48
  </span>
49
  <a href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email') ?>" class="email_heading"><?php _e('In Transit shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
50
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
51
  </label>
52
 
53
  <label class="headig_label <?php if($wcast_enable_outfordelivery_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -59,7 +47,7 @@
59
  </span>
60
  </span>
61
  <a href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email') ?>" class="email_heading"><?php _e('Out For Delivery shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
62
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
63
  </label>
64
 
65
  <label class="headig_label <?php if($wcast_enable_delivered_status_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -71,7 +59,7 @@
71
  </span>
72
  </span>
73
  <a href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email') ?>" class="email_heading"><?php _e('Delivered shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
74
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
75
  </label>
76
 
77
  <label class="headig_label <?php if($wcast_enable_returntosender_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -83,7 +71,7 @@
83
  </span>
84
  </span>
85
  <a href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email') ?>" class="email_heading"><?php _e('Return To Sender shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
86
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
87
  </label>
88
 
89
  <label class="headig_label <?php if($wcast_enable_availableforpickup_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
@@ -95,7 +83,7 @@
95
  </span>
96
  </span>
97
  <a href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email') ?>" class="email_heading"><?php _e('Available For Pickup shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
98
- <div class="row-actions"><a class="edit_customizer_a" href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a></div>
99
  </label>
100
  <?php } ?>
101
  </section>
20
  </span>
21
  </span>
22
  <a href="<?php echo wcast_initialise_customizer_email::get_customizer_url('customer_delivered_email') ?>" class="email_heading"><?php _e('Delivered order status email', 'woo-advanced-shipment-tracking'); ?></a>
23
+ <a class="edit_customizer_a" href="<?php echo wcast_initialise_customizer_email::get_customizer_url('customer_delivered_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
24
  </label>
25
  <?php
26
  if($wc_ast_api_key){
27
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  <label class="headig_label <?php if($wcast_enable_intransit_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
30
  <span class="email_status_span">
35
  </span>
36
  </span>
37
  <a href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email') ?>" class="email_heading"><?php _e('In Transit shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
38
+ <a class="edit_customizer_a" href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
39
  </label>
40
 
41
  <label class="headig_label <?php if($wcast_enable_outfordelivery_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
47
  </span>
48
  </span>
49
  <a href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email') ?>" class="email_heading"><?php _e('Out For Delivery shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
50
+ <a class="edit_customizer_a" href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
51
  </label>
52
 
53
  <label class="headig_label <?php if($wcast_enable_delivered_status_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
59
  </span>
60
  </span>
61
  <a href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email') ?>" class="email_heading"><?php _e('Delivered shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
62
+ <a class="edit_customizer_a" href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
63
  </label>
64
 
65
  <label class="headig_label <?php if($wcast_enable_returntosender_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
71
  </span>
72
  </span>
73
  <a href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email') ?>" class="email_heading"><?php _e('Return To Sender shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
74
+ <a class="edit_customizer_a" href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
75
  </label>
76
 
77
  <label class="headig_label <?php if($wcast_enable_availableforpickup_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
83
  </span>
84
  </span>
85
  <a href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email') ?>" class="email_heading"><?php _e('Available For Pickup shipment status email', 'woo-advanced-shipment-tracking'); ?></a>
86
+ <a class="edit_customizer_a" href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
87
  </label>
88
  <?php } ?>
89
  </section>
includes/views/admin_options_settings.php CHANGED
@@ -2,21 +2,31 @@
2
  <div class="tab_inner_container">
3
  <form method="post" id="wc_ast_settings_form" action="" enctype="multipart/form-data">
4
  <?php #nonce?>
5
- <ul class="subsubsub">
6
- <li><a href="javascript:void(0)" class="current"><?php _e( 'General', 'woo-advanced-shipment-tracking' ); ?></a> | </li>
7
- <li><a href="<?php echo wcast_initialise_customizer_settings::get_customizer_url('default_controls_section') ?>" class=""><?php _e( 'Tracking Info Display Designer', 'woo-advanced-shipment-tracking' ); ?></a></li>
8
- </ul>
 
 
 
 
9
  <br class="clear">
10
- <h3><?php _e( 'Settings', 'woo-advanced-shipment-tracking' ); ?></h3>
11
- <?php $this->get_html( $this->get_settings_data() );?>
12
- <div class="submit">
13
- <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
 
 
 
 
 
 
14
  <div class="spinner" style="float:none"></div>
15
  <div class="success_msg" style="display:none;"><?php _e( 'Data saved successfully.', 'woo-advanced-shipment-tracking' ); ?></div>
16
  <div class="error_msg" style="display:none;"></div>
17
  <?php wp_nonce_field( 'wc_ast_settings_form', 'wc_ast_settings_form' );?>
18
  <input type="hidden" name="action" value="wc_ast_settings_form_update">
19
- </div>
20
  </form>
21
  </div>
22
  </section>
2
  <div class="tab_inner_container">
3
  <form method="post" id="wc_ast_settings_form" action="" enctype="multipart/form-data">
4
  <?php #nonce?>
5
+
6
+ <input id="tab9" type="radio" name="pagetabs" class="tab_input_1" checked>
7
+ <label for="tab9"><?php _e( 'General', 'woo-advanced-shipment-tracking' ); ?></label>
8
+ <span style="margin: 0 3px;">|</span>
9
+ <input id="tab10" type="radio" class="tab_input_1" name="pagetabs" <?php if(isset($_GET['tab']) && $_GET['tab'] == 'delivered-order-status'){ echo 'checked'; } ?>>
10
+ <label for="tab10"><?php _e( 'Delivered Order Status', 'woo-advanced-shipment-tracking' ); ?></label>
11
+ <span style="margin: 0 3px;">|</span>
12
+ <label style="vertical-align: top;"><a style="text-decoration: none;" href="<?php echo wcast_initialise_customizer_settings::get_customizer_url('default_controls_section','settings') ?>" class=""><?php _e( 'Tracking Info Display Designer', 'woo-advanced-shipment-tracking' ); ?></a></label>
13
  <br class="clear">
14
+ <section id="content9" class="tpage_section">
15
+ <h3><?php _e( 'General Settings', 'woo-advanced-shipment-tracking' ); ?></h3>
16
+ <?php $this->get_html( $this->get_settings_data() );?>
17
+ </section>
18
+ <section id="content10" class="tpage_section">
19
+ <h3><?php _e( 'Delivered Order Status ', 'woo-advanced-shipment-tracking' ); ?></h3>
20
+ <?php $this->get_html( $this->get_delivered_data() );?>
21
+ </section>
22
+ <div class="submit">
23
+ <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
24
  <div class="spinner" style="float:none"></div>
25
  <div class="success_msg" style="display:none;"><?php _e( 'Data saved successfully.', 'woo-advanced-shipment-tracking' ); ?></div>
26
  <div class="error_msg" style="display:none;"></div>
27
  <?php wp_nonce_field( 'wc_ast_settings_form', 'wc_ast_settings_form' );?>
28
  <input type="hidden" name="action" value="wc_ast_settings_form_update">
29
+ </div>
30
  </form>
31
  </div>
32
  </section>
includes/views/admin_options_shipping_provider.php CHANGED
@@ -1,193 +1,176 @@
 
1
  <section id="content1" class="tab_section">
2
- <div class="tab_inner_container">
3
- <h4><?php _e('Select Shiping Provider which you want to use in order.', 'woo-advanced-shipment-tracking'); ?></h4>
4
- <div class="marginb20 d_s_select_section">
5
- <?php $default_provider = get_option("wc_ast_default_provider" );?>
6
- <label><?php _e('Default shipping provider :', 'woo-advanced-shipment-tracking'); ?></label>
7
- <select name="wc_ast_default_provider" class="wc_ast_default_provider">
8
- <option><?php _e('Please select default provider', 'woo-advanced-shipment-tracking'); ?></option>
9
- <?php foreach( $default_shippment_providers as $d_s_p ){?>
10
- <?php if($d_s_p->display_in_order != 1)continue;?>
11
- <option value="<?php echo sanitize_title( $d_s_p->provider_name )?>" <?php if( $default_provider == sanitize_title( $d_s_p->provider_name ) )echo 'selected';?>><?php echo $d_s_p->provider_name?></option>
12
- <?php } ?>
13
- </select>
14
- </div>
15
- <form method="post" action="" id="shipping_provider_form">
16
- <table class="widefat fixed shipping_provider_table ui-sortable" cellspacing="0" >
17
- <thead>
18
- <tr>
19
- <th class="manage-column column-shipping-provider <?php echo ( 'provider_name' == $orderby )?'sorted':'sortable'?> <?php echo $inverse_class?>" scope="col">
20
- <a href="admin.php?page=woocommerce-advanced-shipment-tracking&orderby=provider_name&order=<?php echo $inverse_order?>" class="">
21
- <span><?php _e('Shipping Provider', 'woo-advanced-shipment-tracking'); ?></span>
22
- <span class="sorting-indicator"></span>
23
- </a>
24
- </th>
25
- <th class="manage-column column-shipping-country <?php echo ( 'shipping_country' == $orderby )?'sorted':'sortable'?> <?php echo $inverse_class?>" >
26
- <a href="admin.php?page=woocommerce-advanced-shipment-tracking&orderby=shipping_country&order=<?php echo $inverse_order?>" class="">
27
- <span><?php _e('Shipping Country', 'woo-advanced-shipment-tracking'); ?></span>
28
- <span class="sorting-indicator"></span>
29
- </a>
30
- </th>
31
- <th class="manage-column column-tracking-url" ></th>
32
- <th class="manage-column column-status">
33
- <span><?php _e('Status', 'woo-advanced-shipment-tracking'); ?></span>
34
- <span class="mdl-list__item-secondary-action" style="display: inline-block;">
35
-
36
- <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="list-switch">
37
- <input type="checkbox" name="select_custom_provider[]" id="list-switch" class="mdl-switch__input bulk_status_change" value="" />
38
- </label>
39
- </span>
40
- </th>
41
- <th class="manage-column column-action" scope="col"></th>
42
- </tr>
43
- </thead>
44
- <tbody>
45
- <?php foreach($default_shippment_providers as $d_s_p){ ?>
46
- <?php
47
- if( $d_s_p->shipping_country == '' && $d_s_p->provider_name == '' && $d_s_p->provider_url == '' ){
48
- $wpdb->delete( $this->table, array( 'id' => $d_s_p->id ) );
49
- continue;
50
- }
51
- ?>
52
- <tr class="provider_tr <?php if($d_s_p->display_in_order != 1) { echo 'status_deactivate'; } ?> <?php if($d_s_p->shipping_default == 0) { echo 'custom_provider_tr'; } ?>">
53
- <td class="column-columnname thumb-column on_edit_hide">
54
- <?php if( $d_s_p->shipping_default == 1 ){ ?>
55
- <img class="provider_thumbnail" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/<?php echo sanitize_title($d_s_p->provider_name);?>.png?v=<?php echo wc_advanced_shipment_tracking()->version;?>">
56
- <?php } else{
57
- $custom_thumb_id = $d_s_p->custom_thumb_id;
58
- $image_attributes = wp_get_attachment_image_src( $custom_thumb_id , array('60','60') );
59
- //echo '<pre>';print_r($custom_thumb_id);echo '</pre>';exit;
60
- if($custom_thumb_id != 0){ ?>
61
- <img class="provider_thumbnail" src="<?php echo $image_attributes[0]; ?>">
62
- <?php } else{
63
- ?>
64
- <img class="provider_thumbnail" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/icon-default.png">
65
- <?php } ?>
66
- <?php } ?>
67
- <span class="provider_name">
68
- <?php echo $d_s_p->provider_name; ?>
69
- </span>
70
- </td>
71
- <td class="column-columnname country_select_box on_edit_hide">
72
- <span class="on_edit_hide">
73
- <?php
74
- $search = array('(US)', '(UK)');
75
- $replace = array('', '');
76
- if($d_s_p->shipping_country){
77
- echo str_replace($search, $replace, $WC_Countries->countries[$d_s_p->shipping_country]);
78
- }
79
- ?>
80
- </span>
81
- </td>
82
- <td class="column-columnname url-column on_edit_hide">
83
- <?php if ($d_s_p->provider_name == 'PostNL'){?>
84
- <a href="https://jouw.postnl.nl/#!/overzicht" title="https://jouw.postnl.nl/#!/overzicht" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
85
- </a>
86
- <?php }else {?>
87
- <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank" class="on_edit_hide"><?php _e( 'Tracking Page','woo-advanced-shipment-tracking' ); ?>
88
- </a>
89
- <?php } ?>
90
- </td>
91
- <td class="column-columnname status-column on_edit_hide">
92
- <span class="mdl-list__item-secondary-action">
93
- <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="list-switch-<?php echo $d_s_p->id; ?>">
94
- <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'; } ?> />
95
- </label>
96
- </span>
97
- </td>
98
- <td class="column-columnname on_edit_hide td-action">
99
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
100
- <span class="dashicons dashicons-edit edit_provider" style="display:none"></span>
101
- <span class="dashicons dashicons-trash remove" data-pid="<?php echo $d_s_p->id; ?>" style="display:none"></span>
102
- <?php } ?>
103
- <span class="dashicons dashicons-editor-justify sort-item ui-sortable-handle"></span>
104
- <?php
105
- $custom_thumb_id = $d_s_p->custom_thumb_id;
106
- $image_attributes = wp_get_attachment_image_src( $custom_thumb_id );
107
- ?>
108
- <input type="hidden" name="data[<?php echo $d_s_p->id?>][thumb_url]" class="image_path" value="<?php echo $image_attributes[0]; ?>">
109
- </td>
110
- <?php if( $d_s_p->shipping_default == 0 ){ ?>
111
- <td class="on_edit_show" colspan="5">
112
- <input type="text" class="text custom_provider_name" name="data[<?php echo $d_s_p->id?>][provider_name]" value="<?php echo $d_s_p->provider_name;?>" placeholder="<?php _e( 'Shipping Provider', 'woo-advanced-shipment-tracking' ); ?>"><br>
113
-
114
- <select class="select custom_provider_country" name="data[<?php echo $d_s_p->id?>][shipping_country]" >
115
- <option value="" ><?php _e( 'None', 'woo-advanced-shipment-tracking' ); ?></option>
116
- <?php foreach($countries as $key=>$val){ ?>
117
- <option value="<?php echo $key; ?>" <?php if ( $key == $d_s_p->shipping_country ) echo 'selected'?>><?php _e( $val, 'woo-advanced-shipment-tracking'); ?></option>
118
- <?php } ?>
119
- </select><br>
120
-
121
- <input type='hidden' name='data[<?php echo $d_s_p->id?>][thumb_id]' class='image_id' placeholder="Image" value='<?php echo $custom_thumb_id; ?>' id='image_id' style="">
122
- <input type='text' name='data[<?php echo $d_s_p->id?>][thumb_url]' class='image_path' placeholder="Image" value='<?php echo $image_attributes[0]; ?>' id='image_path' style="">
123
- <input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload' , 'woo-advanced-shipment-tracking'); ?>" /><br>
124
-
125
- <input type="text" class="text 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' ); ?>">
126
- <p><?php _e('You can add tracking number parameter like this - http://shippingprovider.com?tracking_number=%number% , %number% - parameter', 'woo-advanced-shipment-tracking'); ?></p>
127
-
128
- <input type="hidden" name="provider_id" class="provider_id" value="<?php echo $d_s_p->id?>">
129
- <input type="hidden" name="sorting[<?php echo $d_s_p->id?>][sort_order]" class="sort_order" value="<?php echo $d_s_p->sort_order?>">
130
- <input type="hidden" name="data[<?php echo $d_s_p->id?>][sort_order]" class="" value="<?php echo $d_s_p->sort_order?>"><br>
131
- <button class="button button-primary update_provider btn_green"><?php _e( 'Update', 'woo-advanced-shipment-tracking' ); ?></button>
132
- <a href="JavaScript:Void(0);" class="cancel_edit"><?php _e( 'Cancel' , 'woo-advanced-shipment-tracking'); ?></a>
133
- </td>
134
- <?php } ?>
135
- </tr>
136
- <?php } ?>
137
- </tbody>
138
- <tfoot>
139
- <tr>
140
- <th colspan="5" ><a href="#" class="add-provider button button-primary btn_green"><?php _e('Add Custom Shipping Provider', 'woo-advanced-shipment-tracking'); ?></a></th>
141
- </tr>
142
- </tfoot>
143
- </table>
144
- </form>
145
-
146
- <script type="text/template" id="tmpl-shipping-provider-row-template">
147
- <tr class="provider_tr tr_add">
148
- <td colspan="5">
149
- <table class="custom_provider_table">
150
- <tr>
151
- <td class="column-columnname shipping_provider">
152
- <input type="text" class="text" value="{{{ data.rate.provider_name }}}" placeholder="<?php _e( 'Shipping Provider', 'woo-advanced-shipment-tracking' ); ?>" name="data[{{{ data.index }}}][provider_name]" />
153
- </td>
154
- </tr>
155
- <tr class="">
156
- <td class="column-columnname shipping_country">
157
- <select class="select wcast_shipping_country" name="data[{{{ data.index }}}][shipping_country]" >
158
- <option value="" <# if ( "" === data.rate.rate_condition ) { #>selected="selected"<# } #>><?php _e( 'None', 'woo-advanced-shipment-tracking' ); ?></option>
159
- <?php
160
- foreach($countries as $key=>$val){ ?>
161
- <option value="<?php echo $key; ?>" ><?php _e( $val, 'woo-advanced-shipment-tracking'); ?></option>
162
- <?php }
163
- ?>
164
- </select>
165
- </td>
166
- </tr>
167
- <tr class="">
168
- <td class="column-columnname cusgtom_provider_thumb">
169
- <input type='text' placeholder='Image' name='data[{{{ data.index }}}][thumb_url]' class='image_path' value='' id='image_path'>
170
- <input type='hidden' name='data[{{{ data.index }}}][thumb_id]' class='image_id' placeholder="Image" value='' id='image_id' style="">
171
- <input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload' , 'woo-advanced-shipment-tracking'); ?>" />
172
- </td>
173
- </tr>
174
- <tr class="">
175
- <td class="column-columnname shipping_url">
176
- <input type="text" class="text" name="data[{{{ data.index }}}][provider_url]" value="" placeholder="<?php _e( 'Tracking Page', 'woo-advanced-shipment-tracking' ); ?>">
177
- <p><?php _e('You can add tracking number parameter like this - http://shippingprovider.com?tracking_number=%number% , %number% - parameter', 'woo-advanced-shipment-tracking'); ?></p>
178
- </td>
179
- </tr>
180
- <tr class="">
181
- <td >
182
- <input type="hidden" name="data[{{{ data.index }}}][sort_order]" class="sort_order" value="{{{ data.sort_id }}}">
183
- <button class="button button-primary add_new btn_green"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
184
- <a href="JavaScript:Void(0);" class="remove" data-pid="{{{ data.index }}}"><?php _e( 'Cancel' , 'woo-advanced-shipment-tracking'); ?></a>
185
- <!--span class="dashicons dashicons-trash remove" data-pid="{{{ data.index }}}"></span-->
186
- </td>
187
- </tr>
188
- </table>
189
- </td>
190
- </tr>
191
- </script>
192
  </div>
193
- </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $wc_ast_api_key = get_option('wc_ast_api_key'); ?>
2
  <section id="content1" class="tab_section">
3
+ <div class="tab_inner_container">
4
+ <div class="provider_top">
5
+ <div class="status_filter">
6
+ <a href="javaScript:void(0);" data-status="active" class="active">Active</a>
7
+ <a href="javaScript:void(0);" data-status="inactive">Inactive</a>
8
+ <a href="javaScript:void(0);" data-status="custom">Custom</a>
9
+ <a href="javaScript:void(0);" data-status="all">All</a>
10
+ </div>
11
+ <div class="provider_settings dropdown">
12
+ <span class="dashicons dashicons-admin-generic dropdown_menu"></span>
13
+ </div>
14
+ <ul class="dropdown-content">
15
+ <li><a href="javaScript:void(0);" class="add_custom_provider" id="add-custom">Add Custom Provider</a></li>
16
+ <?php if($wc_ast_api_key){ ?>
17
+ <li><a href="javaScript:void(0);" class="sync_providers">Sync Provider List</a></li>
18
+ <?php } ?>
19
+ <li>Reset <a href="javaScript:void(0);" class="reset_active">active</a> | <a href="javaScript:void(0);" class="reset_inactive">inactive</a></li>
20
+ </ul>
21
+ <div class="search_section">
22
+ <span class="dashicons dashicons-search search-icon"></span>
23
+ <input class="provider_search_bar " type="text" name="search_provider" id="search_provider" placeholder="Search by provider / country">
24
+ </div>
25
+ </div>
26
+ <div class="provider_list">
27
+ <?php
28
+ if($default_shippment_providers){
29
+ foreach($default_shippment_providers as $d_s_p){ ?>
30
+ <div class="provider <?php if($d_s_p->display_in_order == 1) { echo 'active_provider'; } ?>">
31
+ <div class="row-1">
32
+ <div class="left-div">
33
+ <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank">
34
+ <?php if( $d_s_p->shipping_default == 1 ){ ?>
35
+ <img class="provider-thumb" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/<?php echo sanitize_title($d_s_p->provider_name);?>.png?v=<?php echo wc_advanced_shipment_tracking()->version;?>">
36
+ <?php } else{
37
+ $custom_thumb_id = $d_s_p->custom_thumb_id;
38
+ $image_attributes = wp_get_attachment_image_src( $custom_thumb_id , array('60','60') );
39
+ //echo '<pre>';print_r($custom_thumb_id);echo '</pre>';exit;
40
+ if($custom_thumb_id != 0){ ?>
41
+ <img class="provider-thumb" src="<?php echo $image_attributes[0]; ?>">
42
+ <?php } else{
43
+ ?>
44
+ <img class="provider-thumb" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/shipment-provider-img/icon-default.png">
45
+ <?php } ?>
46
+ <?php } ?>
47
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </div>
49
+ <div class="right-div">
50
+ <a href="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" title="<?php echo str_replace("%number%","",$d_s_p->provider_url ); ?>" target="_blank">
51
+ <span class="provider_name"><?php echo $d_s_p->provider_name; ?></span>
52
+ </a>
53
+ <br>
54
+ <span class="provider_country"><?php
55
+ $search = array('(US)', '(UK)');
56
+ $replace = array('', '');
57
+ if($d_s_p->shipping_country && $d_s_p->shipping_country != 'Global'){
58
+ echo str_replace($search, $replace, $WC_Countries->countries[$d_s_p->shipping_country]);
59
+ } elseif($d_s_p->shipping_country && $d_s_p->shipping_country == 'Global'){
60
+ echo 'Global';
61
+ }
62
+ ?></span>
63
+ </div>
64
+ </div>
65
+ <div class="row-2">
66
+ <div class="default-provider">
67
+ <?php $default_provider = get_option("wc_ast_default_provider" );?>
68
+ <label for="make_default_<?php echo $d_s_p->id; ?>" id="default_label_<?php echo $d_s_p->id; ?>" class="<?php if($d_s_p->display_in_order != 1) { echo 'disable_label'; } ?>">
69
+ <input type="checkbox" id="make_default_<?php echo $d_s_p->id; ?>" name="make_provider_default" data-id="<?php echo $d_s_p->id; ?>" class="make_provider_default" value="<?php echo sanitize_title( $d_s_p->provider_name )?>" <?php if( $default_provider == sanitize_title( $d_s_p->provider_name ) )echo 'checked';?> <?php if($d_s_p->display_in_order != 1) { echo 'disabled'; } ?>>
70
+ <span>default</span>
71
+ </label>
72
+ </div>
73
+ <div class="provider-status">
74
+ <?php if( $d_s_p->shipping_default == 0 ){ ?>
75
+ <span class="dashicons dashicons-edit edit_provider" data-pid="<?php echo $d_s_p->id; ?>"></span>
76
+ <span class="dashicons dashicons-trash remove" data-pid="<?php echo $d_s_p->id; ?>"></span>
77
+ <?php } ?>
78
+ <span class="mdl-list__item-secondary-action">
79
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="list-switch-<?php echo $d_s_p->id; ?>">
80
+ <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'; } ?> />
81
+ </label>
82
+ </span>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ <?php } } else{
87
+ $status = 'active';
88
+ ?>
89
+ <h3><?php echo sprintf(__("You don't have any %s shipping providers.", 'woo-advanced-shipment-tracking'), $status); ?></h3>
90
+ <?php } ?>
91
+ </div>
92
+
93
+ <div id="" class="popupwrapper add_provider_popup" style="display:none;">
94
+ <div class="popuprow">
95
+ <h3 class="popup_title"><?php _e( 'Add Custom Shipping Provider', 'woo-advanced-shipment-tracking'); ?></h2>
96
+ <form id="add_provider_form" method="POST" class="add_provider_form">
97
+ <div>
98
+ <input type="text" name="shipping_provider" id="shipping_provider" placeholder="Shipping Provider">
99
+ </div>
100
+ <div>
101
+ <select class="select wcast_shipping_country" name="shipping_country" id="shipping_country">
102
+ <option value=""><?php _e( 'Shiping Country', 'woo-advanced-shipment-tracking' ); ?></option>
103
+ <?php
104
+ foreach($countries as $key=>$val){ ?>
105
+ <option value="<?php echo $key; ?>" ><?php _e( $val, 'woo-advanced-shipment-tracking'); ?></option>
106
+ <?php } ?>
107
+ </select>
108
+ </div>
109
+ <div>
110
+ <input type='text' placeholder='Image' name='thumb_url' class='image_path' value='' id='thumb_url'>
111
+ <input type='hidden' name='thumb_id' class='image_id' placeholder="Image" value='' id='thumb_id' style="">
112
+ <input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload' , 'woo-advanced-shipment-tracking'); ?>" />
113
+ </div>
114
+ <div>
115
+ <input type="text" name="tracking_url" id="tracking_url" placeholder="Tracking URL">
116
+ </div>
117
+ <div>
118
+ <input type="hidden" name="action" value="add_custom_shipment_provider">
119
+ <input type="submit" name="Submit" value="Submit" class="button-primary btn_green">
120
+ </div>
121
+ </form>
122
+ </div>
123
+ <div class="popupclose"></div>
124
+ </div>
125
+
126
+ <div id="" class="popupwrapper edit_provider_popup" style="display:none;">
127
+ <div class="popuprow">
128
+ <h3 class="popup_title"><?php _e( 'Edit Custom Shipping Provider', 'woo-advanced-shipment-tracking'); ?></h2>
129
+ <form id="edit_provider_form" method="POST" class="edit_provider_form">
130
+ <div>
131
+ <input type="text" name="shipping_provider" id="shipping_provider" value="" placeholder="Shipping Provider">
132
+ </div>
133
+ <div>
134
+ <select class="select wcast_shipping_country" name="shipping_country" id="shipping_country">
135
+ <option value=""><?php _e( 'Shiping Country', 'woo-advanced-shipment-tracking' ); ?></option>
136
+ <?php
137
+ foreach($countries as $key=>$val){ ?>
138
+ <option value="<?php echo $key; ?>" ><?php _e( $val, 'woo-advanced-shipment-tracking'); ?></option>
139
+ <?php } ?>
140
+ </select>
141
+ </div>
142
+ <div>
143
+ <input type='text' placeholder='Image' name='thumb_url' class='image_path' value='' id='thumb_url'>
144
+ <input type='hidden' name='thumb_id' class='image_id' placeholder="Image" value='' id='thumb_id' style="">
145
+ <input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload' , 'woo-advanced-shipment-tracking'); ?>" />
146
+ </div>
147
+ <div>
148
+ <input type="text" name="tracking_url" id="tracking_url" placeholder="Tracking URL">
149
+ </div>
150
+ <div>
151
+ <input type="hidden" name="action" value="update_custom_shipment_provider">
152
+ <input type="hidden" name="provider_id" id="provider_id" value="">
153
+ <input type="submit" name="Submit" value="Update" class="button-primary btn_green">
154
+ </div>
155
+ </form>
156
+ </div>
157
+ <div class="popupclose"></div>
158
+ </div>
159
+
160
+ <div id="" class="popupwrapper sync_provider_popup" style="display:none;">
161
+ <div class="popuprow">
162
+ <h3 class="popup_title"><?php _e( 'Sync Providers', 'woo-advanced-shipment-tracking'); ?></h2>
163
+ <p class="sync_message"><?php _e( 'Do you really want to sync all providers?', 'woo-advanced-shipment-tracking'); ?></p>
164
+ <ul class="synch_result">
165
+ <li class="providers_added"><?php _e( 'Providers Added', 'woo-advanced-shipment-tracking'); ?> - <span></span></li>
166
+ <li class="providers_updated"><?php _e( 'Providers Updated', 'woo-advanced-shipment-tracking'); ?> - <span></span></li>
167
+ <li class="providers_deleted"><?php _e( 'Providers Deleted', 'woo-advanced-shipment-tracking'); ?> - <span></span></li>
168
+ </ul>
169
+ <button class="sync_providers_btn button-primary btn_green"><?php _e( 'Sync Providers', 'woo-advanced-shipment-tracking'); ?></button>
170
+ <button class="close_synch_popup button-primary btn_green"><?php _e( 'Close', 'woo-advanced-shipment-tracking'); ?></button>
171
+ <div class="spinner" style="float:none"></div>
172
+ </div>
173
+ <div class="popupclose"></div>
174
+ </div>
175
+ </div>
176
+ </section>
includes/views/admin_options_trackship_integration.php CHANGED
@@ -8,16 +8,149 @@
8
  <input id="tab6" type="radio" name="pagetabs" class="tab_input_1" checked>
9
  <label for="tab6"><?php _e( 'General', 'woo-advanced-shipment-tracking' ); ?></label>
10
  <span style="margin: 0 3px;">|</span>
11
- <input id="tab7" type="radio" class="tab_input_1" name="pagetabs">
12
  <label for="tab7"><?php _e( 'Tracking Page', 'woo-advanced-shipment-tracking' ); ?></label>
 
 
 
13
  <br class="clear">
14
  <section id="content6" class="tpage_section">
 
15
  <?php
16
- $this->get_html( $this->get_trackship_general_data() ); ?>
 
 
 
 
 
 
 
 
 
 
 
17
  </section>
18
  <section id="content7" class="tpage_section">
 
19
  <?php
20
- $this->get_html( $this->get_trackship_page_data() ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </section>
22
  <?php } else{ ?>
23
  <div class="section-content trackship_section">
@@ -28,7 +161,6 @@
28
  <div class="text-center">
29
  <h3 class="heading">Automate your Shipment Tracking &amp; Delivery Operations</h3>
30
  <p class="lead">TrackShip pro actively sends shipment status updates to your WooCommerce store and streamlines your order management process and provide improved post-purchase experience to your customers.</p>
31
- <p class="lead">We are currently in beta stage, signup to get your invitation.</p>
32
  <a href="https://trackship.info?utm_source=wp_admin&utm_medium=referral&utm_campaign=coming_soon" target="_self" class="trackship_button"><span>SIGNUP NOW</span></a>
33
  </div>
34
  <div class="col small-12 large-12">
@@ -46,8 +178,9 @@
46
  </div>
47
  </div>
48
  <div class="icon-box-text last-reset">
49
- <h4>Auto-Track<br>All Your Shipments</h4>
50
- <p>TrackShip will automatically track your shipments with 60+ shipping carriers across the globe.</p>
 
51
  </div>
52
  </div>
53
  </div>
@@ -61,8 +194,9 @@
61
  </div>
62
  </div>
63
  <div class="icon-box-text last-reset">
64
- <h4>Complete WooCommerce Integration</h4>
65
- <p>trackShip integrates with WooCommerce using the <a href="https://wordpress.org/plugins/woo-advanced-shipment-tracking/">Advanced Shipment Tracking</a> plugin.</p>
 
66
  </div>
67
  </div>
68
  </div>
@@ -76,8 +210,9 @@
76
  </div>
77
  </div>
78
  <div class="icon-box-text last-reset">
79
- <h4>Reduce time &amp; money on Customer Service</h4>
80
- <p>Automate your order management and reduce time spend on customer service and delivery.</p>
 
81
  </div>
82
  </div>
83
  </div>
@@ -91,8 +226,9 @@
91
  </div>
92
  </div>
93
  <div class="icon-box-text last-reset">
94
- <h4>Automate<br>Your Order Management</h4>
95
- <p>Automatically change orders status to “Delivered” once the shipment is delivered to your customer.</p>
 
96
  </div>
97
  </div>
98
  </div>
@@ -106,8 +242,9 @@
106
  </div>
107
  </div>
108
  <div class="icon-box-text last-reset">
109
- <h4>Engage Customers With Tracking Page</h4>
110
- <p>Direct customers to a tracking page on your website and further engage customers after sales.</p>
 
111
  </div>
112
  </div>
113
  </div>
@@ -121,8 +258,9 @@
121
  </div>
122
  </div>
123
  <div class="icon-box-text last-reset">
124
- <h4>Shipment Status and Delivery Emails</h4>
125
- <p><span style="font-weight: 400;">Send your customers shipment status email notifications, triggered by shipment status changes.</span></p>
 
126
  </div>
127
  </div>
128
  </div>
@@ -134,7 +272,7 @@
134
  </div>
135
  <?php }
136
 
137
- if($wc_ast_api_key){
138
  ?>
139
  <div class="submit">
140
  <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
@@ -144,6 +282,6 @@
144
  <?php wp_nonce_field( 'wc_ast_trackship_form', 'wc_ast_trackship_form' );?>
145
  <input type="hidden" name="action" value="wc_ast_trackship_form_update">
146
  </div>
147
- <?php } ?>
148
  </form>
149
  </section>
8
  <input id="tab6" type="radio" name="pagetabs" class="tab_input_1" checked>
9
  <label for="tab6"><?php _e( 'General', 'woo-advanced-shipment-tracking' ); ?></label>
10
  <span style="margin: 0 3px;">|</span>
11
+ <input id="tab7" type="radio" class="tab_input_1" name="pagetabs" <?php if(isset($_GET['tab']) && $_GET['tab'] == 'tracking-page'){ echo 'checked'; } ?>>
12
  <label for="tab7"><?php _e( 'Tracking Page', 'woo-advanced-shipment-tracking' ); ?></label>
13
+ <span style="margin: 0 3px;">|</span>
14
+ <input id="tab8" type="radio" class="tab_input_1" name="pagetabs" <?php if(isset($_GET['tab']) && $_GET['tab'] == 'shipment-status-notifications'){ echo 'checked'; } ?>>
15
+ <label for="tab8"><?php _e( 'Shipment Status Notifications', 'woo-advanced-shipment-tracking' ); ?></label>
16
  <br class="clear">
17
  <section id="content6" class="tpage_section">
18
+ <h3><?php _e('General Settings', 'woo-advanced-shipment-tracking'); ?></h3>
19
  <?php
20
+ $this->get_html( $this->get_trackship_general_data() );
21
+ if($wc_ast_api_key){
22
+ ?>
23
+ <div class="submit">
24
+ <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
25
+ <div class="spinner" style="float:none"></div>
26
+ <div class="success_msg" style="display:none;"><?php _e( 'Settings Saved.', 'woo-advanced-shipment-tracking' ); ?></div>
27
+ <div class="error_msg" style="display:none;"></div>
28
+ <?php wp_nonce_field( 'wc_ast_trackship_form', 'wc_ast_trackship_form' );?>
29
+ <input type="hidden" name="action" value="wc_ast_trackship_form_update">
30
+ </div>
31
+ <?php } ?>
32
  </section>
33
  <section id="content7" class="tpage_section">
34
+ <h3><?php _e('Tracking Page', 'woo-advanced-shipment-tracking'); ?></h3>
35
  <?php
36
+ $this->get_html( $this->get_trackship_page_data() );
37
+ if($wc_ast_api_key){
38
+ ?>
39
+ <a href="<?php echo admin_url('admin-ajax.php')?>?action=preview_tracking_page" class="tracking-preview-link" target="_blank"><?php _e('Click to preview the tracking page', 'woo-advanced-shipment-tracking'); ?></a>
40
+ <p class="tracking-preview-desc"><?php _e('PLEASE NOTE - make sure to save your settings before preview.', 'woo-advanced-shipment-tracking'); ?></p>
41
+ <div class="submit">
42
+ <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
43
+ <div class="spinner" style="float:none"></div>
44
+ <div class="success_msg" style="display:none;"><?php _e( 'Settings Saved.', 'woo-advanced-shipment-tracking' ); ?></div>
45
+ <div class="error_msg" style="display:none;"></div>
46
+ <?php wp_nonce_field( 'wc_ast_trackship_form', 'wc_ast_trackship_form' );?>
47
+ <input type="hidden" name="action" value="wc_ast_trackship_form_update">
48
+ </div>
49
+ <?php } ?>
50
+ </section>
51
+ <section id="content8" class="tpage_section">
52
+ <h3><?php _e('Shipment Status Notifications ', 'woo-advanced-shipment-tracking'); ?></h3>
53
+ <?php
54
+ $wcast_enable_delivered_email = get_option('woocommerce_customer_delivered_order_settings');
55
+ $wcast_enable_pretransit_email = get_theme_mod('wcast_enable_pretransit_email');
56
+ $wcast_enable_intransit_email = get_theme_mod('wcast_enable_intransit_email');
57
+ $wcast_enable_outfordelivery_email = get_theme_mod('wcast_enable_outfordelivery_email');
58
+ $wcast_enable_failure_email = get_theme_mod('wcast_enable_failure_email');
59
+ $wcast_enable_delivered_status_email = get_theme_mod('wcast_enable_delivered_status_email');
60
+ $wcast_enable_returntosender_email = get_theme_mod('wcast_enable_returntosender_email');
61
+ $wcast_enable_availableforpickup_email = get_theme_mod('wcast_enable_availableforpickup_email');
62
+ $wc_ast_api_key = get_option('wc_ast_api_key');
63
+ //echo '<pre>';print_r($wcast_enable_delivered_email['enabled']);echo '</pre>';
64
+ ?>
65
+ <section class="ac-container">
66
+ <?php
67
+ if($wc_ast_api_key){
68
+ ?>
69
+ <div class="headig_label <?php if($wcast_enable_intransit_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
70
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/In-Transit-512.png">
71
+ <span class="email_status_span">
72
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
73
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_intransit_email">
74
+ <input type="checkbox" name="wcast_enable_intransit_email" id="wcast_enable_intransit_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_intransit_email == 1) { echo 'checked'; } ?> />
75
+ </label>
76
+ </span>
77
+ </span>
78
+ <a href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email','shipment-status-notifications') ?>" class="email_heading"><?php _e('In Transit', 'woo-advanced-shipment-tracking'); ?></a>
79
+ <a class="edit_customizer_a" href="<?php echo wcast_intransit_customizer_email::get_customizer_url('customer_intransit_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
80
+ <p class="shipment_about"><?php _e('Carrier has accepted or picked up shipment from shipper. The shipment is on the way.', 'woo-advanced-shipment-tracking'); ?></p>
81
+ </div>
82
+
83
+ <div class="headig_label <?php if($wcast_enable_returntosender_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
84
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/return-to-sender-512.png">
85
+ <span class="email_status_span">
86
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
87
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_returntosender_email">
88
+ <input type="checkbox" name="wcast_enable_returntosender_email" id="wcast_enable_returntosender_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_returntosender_email == 1) { echo 'checked'; } ?> />
89
+ </label>
90
+ </span>
91
+ </span>
92
+ <a href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email','shipment-status-notifications') ?>" class="email_heading"><?php _e('Return To Sender', 'woo-advanced-shipment-tracking'); ?></a>
93
+ <a class="edit_customizer_a" href="<?php echo wcast_returntosender_customizer_email::get_customizer_url('customer_returntosender_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
94
+ <p class="shipment_about"><?php _e('Shipment is returned to sender', 'woo-advanced-shipment-tracking'); ?></p>
95
+ </div>
96
+
97
+ <div class="headig_label <?php if($wcast_enable_availableforpickup_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
98
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/available-for-picup-512.png">
99
+ <span class="email_status_span">
100
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
101
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_availableforpickup_email">
102
+ <input type="checkbox" name="wcast_enable_availableforpickup_email" id="wcast_enable_availableforpickup_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_availableforpickup_email == 1) { echo 'checked'; } ?> />
103
+ </label>
104
+ </span>
105
+ </span>
106
+ <a href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email','shipment-status-notifications') ?>" class="email_heading"><?php _e('Available For Pickup', 'woo-advanced-shipment-tracking'); ?></a>
107
+ <a class="edit_customizer_a" href="<?php echo wcast_availableforpickup_customizer_email::get_customizer_url('customer_availableforpickup_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
108
+ <p class="shipment_about"><?php _e('The shipment is ready to pickup.', 'woo-advanced-shipment-tracking'); ?></p>
109
+ </div>
110
+ <div class="headig_label <?php if($wcast_enable_outfordelivery_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
111
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/Out-for-Delivery-512.png">
112
+ <span class="email_status_span">
113
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
114
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_outfordelivery_email">
115
+ <input type="checkbox" name="wcast_enable_outfordelivery_email" id="wcast_enable_outfordelivery_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_outfordelivery_email == 1) { echo 'checked'; } ?> />
116
+ </label>
117
+ </span>
118
+ </span>
119
+ <a href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email','shipment-status-notifications') ?>" class="email_heading"><?php _e('Out For Delivery', 'woo-advanced-shipment-tracking'); ?></a>
120
+ <a class="edit_customizer_a" href="<?php echo wcast_outfordelivery_customizer_email::get_customizer_url('customer_outfordelivery_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
121
+ <p class="shipment_about"><?php _e('Carrier is about to deliver the shipment', 'woo-advanced-shipment-tracking'); ?></p>
122
+ </div>
123
+
124
+ <div class="delivered_shipment_label headig_label <?php if($wcast_enable_delivered_status_email == 1){ echo 'enable'; } else{ echo 'disable'; }?> <?php if($wcast_enable_delivered_email['enabled'] === 'yes'){ echo 'delivered_enabel'; } ?>">
125
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/Delivered-512.png">
126
+ <span class="email_status_span">
127
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
128
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_delivered_status_email">
129
+ <input type="checkbox" name="wcast_enable_delivered_status_email" id="wcast_enable_delivered_status_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_delivered_status_email == 1 && $wcast_enable_delivered_email['enabled'] != 'yes') { echo 'checked'; } ?> <?php if($wcast_enable_delivered_email['enabled'] === 'yes'){ echo 'disabled'; }?> />
130
+ </label>
131
+ </span>
132
+ </span>
133
+ <a href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email','shipment-status-notifications') ?>" class="email_heading <?php if($wcast_enable_delivered_email['enabled'] === 'yes'){ echo 'disabled_link'; }?>"><?php _e('Delivered', 'woo-advanced-shipment-tracking'); ?></a>
134
+ <a class="edit_customizer_a <?php if($wcast_enable_delivered_email['enabled'] === 'yes'){ echo 'disabled_link'; }?>" href="<?php echo wcast_delivered_customizer_email::get_customizer_url('customer_delivered_status_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
135
+ <p class="shipment_about"><?php _e('The shipment was delivered successfully', 'woo-advanced-shipment-tracking'); ?></p>
136
+ <p class="delivered_message <?php if($wcast_enable_delivered_email['enabled'] === 'yes'){ echo 'disable_delivered'; }?>"><?php _e("You already have delivered email enabled, to enable this email you'll need to disable the order status delivered in settings.", 'woo-advanced-shipment-tracking'); ?></p>
137
+ </div>
138
+
139
+ <div class="headig_label <?php if($wcast_enable_failure_email == 1){ echo 'enable'; } else{ echo 'disable'; }?>">
140
+ <img class="email-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/failure-512.png">
141
+ <span class="email_status_span">
142
+ <span class="mdl-list__item-secondary-action shipment_status_toggle">
143
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="wcast_enable_failure_email">
144
+ <input type="checkbox" name="wcast_enable_failure_email" id="wcast_enable_failure_email" class="mdl-switch__input" value="yes" <?php if($wcast_enable_failure_email == 1) { echo 'checked'; } ?> />
145
+ </label>
146
+ </span>
147
+ </span>
148
+ <a href="<?php echo wcast_failure_customizer_email::get_customizer_url('customer_failure_email','shipment-status-notifications') ?>" class="email_heading"><?php _e('Failed Attempt', 'woo-advanced-shipment-tracking'); ?></a>
149
+ <a class="edit_customizer_a" href="<?php echo wcast_failure_customizer_email::get_customizer_url('customer_failure_email','shipment-status-notifications') ?>"><?php _e('Edit', 'woo-advanced-shipment-tracking'); ?></a>
150
+ <p class="shipment_about"><?php _e('Carrier attempted to deliver but failed, and usually leaves a notice and will try to deliver the package again.', 'woo-advanced-shipment-tracking'); ?></p>
151
+ </div>
152
+ <?php } ?>
153
+ </section>
154
  </section>
155
  <?php } else{ ?>
156
  <div class="section-content trackship_section">
161
  <div class="text-center">
162
  <h3 class="heading">Automate your Shipment Tracking &amp; Delivery Operations</h3>
163
  <p class="lead">TrackShip pro actively sends shipment status updates to your WooCommerce store and streamlines your order management process and provide improved post-purchase experience to your customers.</p>
 
164
  <a href="https://trackship.info?utm_source=wp_admin&utm_medium=referral&utm_campaign=coming_soon" target="_self" class="trackship_button"><span>SIGNUP NOW</span></a>
165
  </div>
166
  <div class="col small-12 large-12">
178
  </div>
179
  </div>
180
  <div class="icon-box-text last-reset">
181
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/Multi-Carrier-Support.png">
182
+ <h4>Multi-Carrier </br>Support</h4>
183
+ <p>TrackShip’s Tracking API auto-tracks all your shipments with <a href="https://trackship.info/shipping-providers/" target="blak">100+ shipping providers</a> across the globe, so you and your customers can see exactly where their package is 24×7.</p>
184
  </div>
185
  </div>
186
  </div>
194
  </div>
195
  </div>
196
  <div class="icon-box-text last-reset">
197
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/woo-inegration.png">
198
+ <h4>WooCommerce </br>Integration</h4>
199
+ <p>Trackship fully integrates with WooCommerce with the <a href="https://wordpress.org/plugins/woo-advanced-shipment-tracking/">Advanced Shipment Tracking</a> plugin, and most of its features can be easily managed directly from your WooCommerce admin panel.</p>
200
  </div>
201
  </div>
202
  </div>
210
  </div>
211
  </div>
212
  <div class="icon-box-text last-reset">
213
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/customer-support.png">
214
+ <h4>Better Customer </br>Support</h4>
215
+ <p>The most frequent question shoppers ask is, “Where's my order?” with TrackShip, you and your customers will know where the package is at all time. tracking information will display on WooCommerce orders panel.</p>
216
  </div>
217
  </div>
218
  </div>
226
  </div>
227
  </div>
228
  <div class="icon-box-text last-reset">
229
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/delivery-email-2.png">
230
+ <h4>Shipment Status </br>Notifications</h4>
231
+ <p>Engage your Customer with personalized shipment status email notifications triggered by shipment status changes; In Transit, Out For Delivery, Delivered or have an Exception.</p>
232
  </div>
233
  </div>
234
  </div>
242
  </div>
243
  </div>
244
  <div class="icon-box-text last-reset">
245
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/Branded-Tracking-Page.png">
246
+ <h4>Branded Tracking </br>Page</h4>
247
+ <p>Direct customers to a tracking page on your website and further engage customers after sales. Instead of sending your customers to track their order at a carrier page, you can direct customers to a detailed tracking page on your store.</p>
248
  </div>
249
  </div>
250
  </div>
258
  </div>
259
  </div>
260
  <div class="icon-box-text last-reset">
261
+ <img class="trackship-icon" src="<?php echo wc_advanced_shipment_tracking()->plugin_dir_url()?>assets/css/icons/shiping-and-delivery-analytics.png">
262
+ <h4>Shipping & Delivery </br>Analytics</h4>
263
+ <p>Analyse delivery performance using tracking data. Find out exception for your past shipments and get an overview of your historic shipments data, find shipments by provider, delivery status,, ship date and more.</p>
264
  </div>
265
  </div>
266
  </div>
272
  </div>
273
  <?php }
274
 
275
+ /*if($wc_ast_api_key){
276
  ?>
277
  <div class="submit">
278
  <button name="save" class="button-primary woocommerce-save-button btn_green" type="submit" value="Save changes"><?php _e( 'Save', 'woo-advanced-shipment-tracking' ); ?></button>
282
  <?php wp_nonce_field( 'wc_ast_trackship_form', 'wc_ast_trackship_form' );?>
283
  <input type="hidden" name="action" value="wc_ast_trackship_form_update">
284
  </div>
285
+ <?php }*/ ?>
286
  </form>
287
  </section>
includes/views/zorem_admin_sidebar.php CHANGED
@@ -3,8 +3,8 @@
3
  <img src="https://trackship.info/wp-content/uploads/2019/05/logo-1024x261.png" alt="" style="max-width: 60%;">
4
  <h4>Automate your Shipment Tracking & Delivery Operations</h4>
5
  <p>TrackShip proactively sends shipment status updates to your WooCommerce store and streamlines your order management process and provide improved post-purchase experience to your customers.</p>
6
- <p>We are currently in beta stage, signup to get your invitation.</p>
7
- <a href="https://trackship.info" target="_self" class="button button-primary btn_green" target="_blank"><span>get your invite</span><i class="icon-angle-right"></i></a>
8
  </div>
9
 
10
  <!--<div class="zorem-sidebar-title"></div>-->
3
  <img src="https://trackship.info/wp-content/uploads/2019/05/logo-1024x261.png" alt="" style="max-width: 60%;">
4
  <h4>Automate your Shipment Tracking & Delivery Operations</h4>
5
  <p>TrackShip proactively sends shipment status updates to your WooCommerce store and streamlines your order management process and provide improved post-purchase experience to your customers.</p>
6
+
7
+ <a href="https://trackship.info" target="_self" class="button button-primary btn_green" target="_blank"><span>SIGNUP NOW</span><i class="icon-angle-right"></i></a>
8
  </div>
9
 
10
  <!--<div class="zorem-sidebar-title"></div>-->
readme.txt CHANGED
@@ -12,33 +12,34 @@ Add shipment tracking information to your WooCommerce orders and provide your cu
12
 
13
  == Description ==
14
 
15
- Shop managers can add shipment provider, tracking number and date to orders, Shipment tracking Info and tracking link to track their shipments will appear in customers accounts and on WooCommerce “Completed” order emails.
16
 
17
- This plugin provides more then 60 shipping providers (carriers) by default and you can also add your own custom providers. You can customize the display of the tracking info on emails, you can manually enter tracking info to orders or use our REST API or the bulk upload from csv option is you want to automate your work..
 
 
18
 
19
  == Features ==
20
 
21
- * Add Shipment Tracking information to WooCommerce orders: shipment provider, tracking number and ship date.
22
- * Option to add multiple Tracking numbers to each order
23
- * Shipment tracking information & tracking link will be sent on “Completed” order emails
24
- * Customers can track orders shipment status on their account on your website
25
- * Fully customize the shipment tracking display design and layout.
26
- * Support for more then 60 shipment providers (carriers)
27
- * Select which shipping providers to display on the shipping providers list on orders.
28
- * Select default shipping provider to display on the shipping providers list on orders.
29
  * Add custom shipping providers
30
- * Rename the "Completed" Order status to "Shipped" (Optional)
31
- * Custom "Delivered" orders status (Optional)
32
- * Custom “Delivered” order emails sent to your customers once the order status is marked as delivered
33
- * "Change order status to Delivered" available in bulk orders actions and single order actions.
34
- * Fully customize the “Delivered” order emails content, design and layout.
35
- * Bulk upload tracking info to order from CSV files
36
- * WooCommerce REST API support to update shipment tracking information
 
 
 
37
 
38
  == TrackShip Integration==
39
- Automate your Shipment Tracking & Delivery Operations.
40
- TrackShip proactively sends shipment status updates to your WooCommerce store and streamlines your order management process and provide improved post-purchase experience to your customers.
41
- We are currently in beta stage, [signup](https://trackship.info?utm_source=wp_plugin_page&utm_medium=referral&utm_campaign=coming_soon) to get your invitation once we launch the service.
42
 
43
  == Localization ==
44
 
@@ -105,6 +106,31 @@ http://a32694-tmp.s415.upress.link/wp-json/wc/v1/orders/<order-id>/shipment-trac
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  = 2.2 =
109
  * Fixed issue with Kadence email customizer plugin
110
  * Fixed – Fixed PHP Notice: Undefined index: custom_tracking_provider
12
 
13
  == Description ==
14
 
15
+ Add shipment tracking information to your WooCommerce orders and provide your customers with an easy way to track their orders. This plugin provides a list of 100+ Shipping Providers and you can also add your own custom providers.
16
 
17
+ Shop managers can add shipment provider, tracking number and date to orders, the customer will receive tracking info and track link in the orders email and in Customer accounts.
18
+
19
+ Use WooCommerce Advanced Shipment Tracking to streamline your order management, add shipment tracking information to orders, auto track orders ([TracksShip](https://trackship.info/)) and provide superior post-purchase experience that your customers will love and appreciate!
20
 
21
  == Features ==
22
 
23
+ * Add shipment tracking info to orders Shipping provider, tracking number and ship date.
24
+ * Add multiple tracking numbers to orders
25
+ * List of more then 100 shipping providers (carriers)
26
+ * Select shipping providers to use when adding tracking info to orders
27
+ * Set the default provider when adding tracking info to orders
 
 
 
28
  * Add custom shipping providers
29
+ * Display Shipment tracking info and tracking link on user accounts
30
+ * Display Shipment tracking info and tracking link on customer emails
31
+ * Customize and preview the Tracking info display on customer emails using email designer.
32
+ * Choose on which Customer emails to include the tracking info.
33
+ * Bulk import tracking info to orders with CSV file.
34
+ * WooCommerce REST API support to update shipment tracking information
35
+ * Rename the Completed Order status to Shipped
36
+ * Enable Delivered custom order status
37
+ * Customer order status Delivered email to customers
38
+ * Customize and preview the Delivered status email using email designer.
39
 
40
  == TrackShip Integration==
41
+
42
+ Auto-track all your WooCommerce shipments with [TracksShip](https://trackship.info/). Get real-time shipment updates and automate your order management flow to increase your customers satisfaction and further engage customers.
 
43
 
44
  == Localization ==
45
 
106
 
107
  == Changelog ==
108
 
109
+ = 2.3 =
110
+ * Fixed - PHP Warning
111
+ * Fixed - Unable to override customer-delivered-order.php template
112
+ * Fixed - Sync Providers issues with images when adding new providers
113
+ * Added details info of the changes after Sync Providers
114
+ * Added "Change order to Shipped?" checkbox when adding tracking info to orders
115
+ * Added "DHL Freight","Sendle" and "Deppon" shipping provider
116
+ * Added Slug field to shipping providers table
117
+ * Added ajax overlay in customizer refresh
118
+ * Updated settings page design
119
+ * Updated - When new provider added default status is inactive
120
+ * Updated - added parameter in return url of tracking info customizer and shipping status email customizer so when close customizer directly go into particular tab
121
+ * Updated - remove trim from tracking number when add tracking info to orders
122
+
123
+ = 2.2.5 =
124
+ * Fixed - PHP Warning
125
+ * Added 20+ new Shipping Provider
126
+ * Updated design of emails section in customizer
127
+ * Updated Shipment Status Notifications in TrackShip
128
+ * Updated Shipping Providers List Design
129
+ * Updated Correios, Mondial Relay
130
+ * Updated Shipping Provider La Poste, Colissimo and Chronopost
131
+ * Updated Shipping Provider DHL.at, DHL.cz, DHL.se, DHL
132
+ * Updated TrackShip Tracking Page
133
+
134
  = 2.2 =
135
  * Fixed issue with Kadence email customizer plugin
136
  * Fixed – Fixed PHP Notice: Undefined index: custom_tracking_provider
woocommerce-advanced-shipment-tracking.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI:
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: 2.2
8
  * Author: zorem
9
  * Author URI:
10
  * License: GPL-2.0+
@@ -22,7 +22,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
22
  *
23
  * @var string
24
  */
25
- public $version = '2.2';
26
 
27
  /**
28
  * Initialize the main plugin function
@@ -169,6 +169,9 @@ class zorem_woocommerce_advanced_shipment_tracking {
169
  $wc_ast_status_delivered = get_option('wc_ast_status_delivered');
170
  if($wc_ast_status_delivered == 1)
171
  add_action( 'woocommerce_order_status_delivered', array( $this, 'email_trigger_delivered' ), 10, 2 );
 
 
 
172
  }
173
 
174
  /**
@@ -323,7 +326,7 @@ class zorem_woocommerce_advanced_shipment_tracking {
323
 
324
  require_once $this->get_plugin_path() . '/includes/customizer/class-wc-email-customizer.php';
325
 
326
- require_once $this->get_plugin_path() . '/includes/customizer/class-wc-pretransit-email-customizer.php';
327
 
328
  require_once $this->get_plugin_path() . '/includes/customizer/class-wc-intransit-email-customizer.php';
329
 
4
  * Plugin Name: Advanced Shipment Tracking for WooCommerce
5
  * Plugin URI:
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: 2.3
8
  * Author: zorem
9
  * Author URI:
10
  * License: GPL-2.0+
22
  *
23
  * @var string
24
  */
25
+ public $version = '2.3';
26
 
27
  /**
28
  * Initialize the main plugin function
169
  $wc_ast_status_delivered = get_option('wc_ast_status_delivered');
170
  if($wc_ast_status_delivered == 1)
171
  add_action( 'woocommerce_order_status_delivered', array( $this, 'email_trigger_delivered' ), 10, 2 );
172
+
173
+ add_action( 'wp_ajax_nopriv_preview_tracking_page', array( $this->front, 'preview_tracking_page') );
174
+ add_action( 'wp_ajax_preview_tracking_page', array( $this->front, 'preview_tracking_page') );
175
  }
176
 
177
  /**
326
 
327
  require_once $this->get_plugin_path() . '/includes/customizer/class-wc-email-customizer.php';
328
 
329
+ require_once $this->get_plugin_path() . '/includes/customizer/class-wc-failure-email-customizer.php';
330
 
331
  require_once $this->get_plugin_path() . '/includes/customizer/class-wc-intransit-email-customizer.php';
332