Guest User

templates/emails/plain/tracking-info.php

a guest
Mar 17th, 2020
10
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3.     exit;
  4. }
  5.  
  6. if ( $tracking_items ) {
  7.  
  8.     $wcast_customizer_settings = new wcast_initialise_customizer_settings();
  9.     $ast = new WC_Advanced_Shipment_Tracking_Actions;
  10.     $tracking_info_settings = get_option('tracking_info_settings');
  11.  
  12.     if ( $tracking_info_settings['header_text_change'] ) {
  13.         $shipment_tracking_header = $tracking_info_settings['header_text_change'];
  14.     } else {
  15.         $shipment_tracking_header = "Tracking Information";
  16.     }
  17.  
  18.     if ( $tracking_info_settings['additional_header_text'] ) {
  19.         $shipment_tracking_header_text = $tracking_info_settings['additional_header_text'];
  20.     }
  21.  
  22.     $provider_header_text = $ast->get_option_value_from_array( 'tracking_info_settings', 'provider_header_text', $wcast_customizer_settings->defaults['provider_header_text'] );
  23.    
  24.     $tracking_number_header_text = $ast->get_option_value_from_array( 'tracking_info_settings', 'tracking_number_header_text', $wcast_customizer_settings->defaults['tracking_number_header_text'] );
  25.    
  26.     $track_header_text = $ast->get_option_value_from_array( 'tracking_info_settings', 'track_header_text', $wcast_customizer_settings->defaults['track_header_text'] );
  27.  
  28.     echo strtoupper( apply_filters( 'woocommerce_shipment_tracking_my_orders_title', __( $shipment_tracking_header, 'woo-advanced-shipment-tracking' ) ) ) . "\n\n";
  29.    
  30.     if ( isset( $shipment_tracking_header_text ) ) {
  31.         echo $shipment_tracking_header_text . "\n\n";
  32.     }
  33.  
  34.     if ( isset( $new_status ) ) {
  35.         echo sprintf( __( 'Shipment status changed to %s', 'woo-advanced-shipment-tracking' ), apply_filters( "trackship_status_filter", $new_status ) ) . "\n\n";
  36.     }
  37.  
  38.     foreach ( $tracking_items as $tracking_item ) {
  39.         $url = str_replace( '%number%', $tracking_item['tracking_number'], $tracking_item['formatted_tracking_link'] );
  40.         echo __( $provider_header_text, 'woo-advanced-shipment-tracking' ) . ": " . apply_filters( 'ast_provider_title', esc_html( $tracking_item['formatted_tracking_provider'] ) ) . "\n";
  41.         echo __( $tracking_number_header_text, 'woo-advanced-shipment-tracking' ) . ": " . esc_html( $tracking_item['tracking_number'] ) . "\n";
  42.         echo __( $track_header_text, 'woo-advanced-shipment-tracking' ) . ": " . esc_url( $url ) . "\n\n";
  43.     }
  44.  
  45.     echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
  46. }
RAW Paste Data