| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
$emailTextLinkColor = get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) ? get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) : '#96588a'; |
| 7 |
|
| 8 |
if ( $tracking_items ) : ?> |
| 9 |
<table class="yaymail_builder_table_items_border yaymail_builder_table_tracking_item" cellspacing="0" cellpadding="6" border="1" style="width: 100% !important;" width="100%"> |
| 10 |
|
| 11 |
<thead> |
| 12 |
<tr> |
| 13 |
<th class="tracking-provider" colspan="<?php echo esc_html( 'WC_Shipment_Tracking_Actions' == $setClassAvtive ? 1 : 2 ); ?>" scope="col" class="td" style="text-align: left;"><?php esc_html_e( 'Provider', 'yaymail' ); ?></th> |
| 14 |
<th class="tracking-number" scope="col" class="td" style="text-align: left;"><?php esc_html_e( 'Tracking Number', 'yaymail' ); ?></th> |
| 15 |
<th class="date-shipped" scope="col" class="td" style="text-align: left;"><?php esc_html_e( 'Date', 'yaymail' ); ?></th> |
| 16 |
<th class="order-actions" scope="col" class="td" style="text-align: left;"> </th> |
| 17 |
</tr> |
| 18 |
</thead> |
| 19 |
|
| 20 |
<tbody style="flex-direction:inherit;"> |
| 21 |
<?php |
| 22 |
foreach ( $tracking_items as $tracking_item ) { |
| 23 |
?> |
| 24 |
<tr class="tracking order_item" style="flex-direction:inherit;"> |
| 25 |
|
| 26 |
<?php if ( 'WC_Shipment_Tracking_Actions' == $setClassAvtive ) { ?> |
| 27 |
<td class="tracking-provider" data-title="<?php esc_html_e( 'Provider', 'yaymail' ); ?>" style="text-align: left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 28 |
<?php echo esc_html( null != $tracking_item['custom_tracking_provider'] ? $tracking_item['custom_tracking_provider'] : $tracking_item['tracking_provider'] ); ?> |
| 29 |
</td> |
| 30 |
<?php |
| 31 |
} else { |
| 32 |
global $wpdb; |
| 33 |
|
| 34 |
$tracking_provider = isset( $tracking_item['tracking_provider'] ) ? $tracking_item['tracking_provider'] : $tracking_item['custom_tracking_provider']; |
| 35 |
if ( $tracking_provider ) { |
| 36 |
$tracking_provider = apply_filters( 'convert_provider_name_to_slug', $tracking_provider ); |
| 37 |
|
| 38 |
$results = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woo_shippment_provider WHERE ts_slug = %s", $tracking_provider ) ); |
| 39 |
|
| 40 |
$provider_name = apply_filters( 'get_ast_provider_name', $tracking_provider, $results ); |
| 41 |
} else { |
| 42 |
$provider_name = $tracking_item['custom_tracking_provider']; |
| 43 |
} |
| 44 |
|
| 45 |
?> |
| 46 |
<td class="tracking-provider" data-title="<?php esc_html_e( 'Provider', 'yaymail' ); ?>" style="text-align: left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 47 |
<img style="vertical-align: middle;" src="<?php echo esc_html( apply_filters( 'get_shipping_provdider_src', $results ) ); ?>"> |
| 48 |
</td> |
| 49 |
<td class="tracking-provider" data-title="<?php esc_html_e( 'Provider', 'yaymail' ); ?>" style="text-align: left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 50 |
<?php echo esc_html( apply_filters( 'ast_provider_title', esc_html( $provider_name ) ) ); ?> |
| 51 |
</td> |
| 52 |
<?php } ?> |
| 53 |
|
| 54 |
<td class="tracking-number" data-title="<?php esc_html_e( 'Tracking Number', 'yaymail' ); ?>" style="text-align: left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 55 |
<?php if ( isset( $tracking_item['tracking_number'] ) ) { ?> |
| 56 |
<?php echo esc_html( $tracking_item['tracking_number'] ); ?> |
| 57 |
<?php } ?> |
| 58 |
</td> |
| 59 |
<td class="date-shipped" data-title="<?php esc_html_e( 'Status', 'yaymail' ); ?>" style="text-align: left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 60 |
<?php if ( isset( $tracking_item['date_shipped'] ) ) { ?> |
| 61 |
<time datetime="<?php echo esc_attr( gmdate( 'Y-m-d', $tracking_item['date_shipped'] ) ); ?>" title="<?php echo esc_attr( gmdate( 'Y-m-d', $tracking_item['date_shipped'] ) ); ?>"><?php echo esc_html( date_i18n( get_option( 'date_format' ), $tracking_item['date_shipped'] ) ); ?></time> |
| 62 |
<?php } ?> |
| 63 |
</td> |
| 64 |
|
| 65 |
<td class="order-actions" style="text-align: center; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding: 12px;"> |
| 66 |
<?php if ( isset( $tracking_item['formatted_tracking_link'] ) ) { ?> |
| 67 |
<a style="color: <?php echo esc_attr( $emailTextLinkColor ); ?>" href="<?php echo esc_url( $tracking_item['formatted_tracking_link'] ); ?>" target="_blank"><?php esc_html_e( 'Track', 'yaymail' ); ?></a> |
| 68 |
<?php } ?> |
| 69 |
</td> |
| 70 |
|
| 71 |
</tr> |
| 72 |
<?php |
| 73 |
} |
| 74 |
?> |
| 75 |
</tbody> |
| 76 |
</table> |
| 77 |
<?php |
| 78 |
endif; |
| 79 |
|