| 1 |
<?php |
| 2 |
use YayMail\Page\Source\CustomPostType; |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
if ( false != $subscription ) : |
| 7 |
$productId = get_post_meta( $subscription, 'product_id', true ); |
| 8 |
$productName = get_post_meta( $subscription, 'product_name', true ); |
| 9 |
$quantity = (float) get_post_meta( $subscription, 'quantity', true ); |
| 10 |
$lineTotal = (float) get_post_meta( $subscription, 'line_total', true ); |
| 11 |
$orderCurrency = get_post_meta( $subscription, 'order_currency', true ); |
| 12 |
$lineSubTotal = (float) get_post_meta( $subscription, 'line_subtotal', true ); |
| 13 |
$lineTax = false == get_post_meta( $subscription, 'line_tax', true ) ? (float) get_post_meta( $subscription, 'line_tax', true ) : 0; |
| 14 |
$postID = CustomPostType::postIDByTemplate( $this->template ); |
| 15 |
$text_link_color = get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) ? get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) : '#96588a'; |
| 16 |
?> |
| 17 |
<table class="yaymail_builder_table_items_border yaymail_builder_table_item_subscription" cellspacing="0" cellpadding="6" style="width: 100%;" border="1"> |
| 18 |
<thead> |
| 19 |
<tr> |
| 20 |
<th scope="col" |
| 21 |
style="text-align:left;"><?php esc_html_e( 'Product', 'yith-woocommerce-subscription' ); ?></th> |
| 22 |
<th scope="col" |
| 23 |
style="text-align:left;"><?php esc_html_e( 'Subtotal', 'yith-woocommerce-subscription' ); ?></th> |
| 24 |
</tr> |
| 25 |
</thead> |
| 26 |
<tbody> |
| 27 |
<tr> |
| 28 |
<td scope="col" style="text-align:left;"> |
| 29 |
<a style="color:<?php echo esc_attr( $text_link_color ); ?>" href="<?php echo esc_url( get_permalink( $productId ) ); ?>"><?php echo wp_kses_post( $productName ); ?></a><?php echo ' x ' . esc_html( $quantity ); ?> |
| 30 |
</td> |
| 31 |
|
| 32 |
<td scope="col" |
| 33 |
style="text-align:left;"><?php echo wp_kses_post( wc_price( $lineTotal, array( 'currency' => $orderCurrency ) ) ); ?></td> |
| 34 |
</tr> |
| 35 |
|
| 36 |
</tbody> |
| 37 |
<tfoot> |
| 38 |
<?php if ( 0 !== $lineTax ) : ?> |
| 39 |
<tr> |
| 40 |
<th scope="row"><?php esc_html_e( 'Item Tax:', 'yith-woocommerce-subscription' ); ?></th> |
| 41 |
<td><?php echo wp_kses_post( wc_price( $lineTax, array( 'currency' => $orderCurrency ) ) ); ?></td> |
| 42 |
</tr> |
| 43 |
<?php endif ?> |
| 44 |
<tr> |
| 45 |
<th scope="row"><?php esc_html_e( 'Subtotal:', 'yith-woocommerce-subscription' ); ?></th> |
| 46 |
<td><?php echo wp_kses_post( wc_price( $lineTotal + $lineTax, array( 'currency' => $orderCurrency ) ) ); ?></td> |
| 47 |
</tr> |
| 48 |
|
| 49 |
<?php |
| 50 |
$subscriptions_shippings = get_post_meta( $subscription, 'order_shipping', true ); |
| 51 |
if ( $subscriptions_shippings ) : |
| 52 |
?> |
| 53 |
<tr> |
| 54 |
<th scope="row"><?php esc_html_e( 'Shipping:', 'yith-woocommerce-subscription' ); ?></th> |
| 55 |
<td> |
| 56 |
<?php |
| 57 |
// translators:placeholder shipping name. |
| 58 |
echo wp_kses_post( wc_price( $subscriptions_shippings, array( 'currency' => $orderCurrency ) ) ); |
| 59 |
?> |
| 60 |
</td> |
| 61 |
</tr> |
| 62 |
<?php |
| 63 |
if ( ! empty( get_post_meta( $subscription, 'order_shipping_tax', true ) ) ) : |
| 64 |
?> |
| 65 |
<tr> |
| 66 |
<th scope="row"><?php esc_html_e( 'Shipping Tax:', 'yith-woocommerce-subscription' ); ?></th> |
| 67 |
<td colspan="2"><?php echo wp_kses_post( wc_price( get_post_meta( $subscription, 'order_shipping_tax', true ), array( 'currency' => $orderCurrency ) ) ); ?></td> |
| 68 |
</tr> |
| 69 |
<?php |
| 70 |
endif; |
| 71 |
endif; |
| 72 |
?> |
| 73 |
<tr> |
| 74 |
<th scope="row"><?php esc_html_e( 'Total:', 'yith-woocommerce-subscription' ); ?></th> |
| 75 |
<td colspan="2"><?php echo wp_kses_post( wc_price( get_post_meta( $subscription, 'subscription_total', true ), array( 'currency' => $orderCurrency ) ) ); ?></td> |
| 76 |
</tr> |
| 77 |
</tfoot> |
| 78 |
</table> |
| 79 |
|
| 80 |
<?php endif; ?> |
| 81 |
|