| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
use YayMail\Page\Source\CustomPostType; |
| 5 |
use YayMail\Helper\Helper; |
| 6 |
|
| 7 |
$is_preview = Helper::isPreview( $this->preview_mail ); |
| 8 |
$text_align = is_rtl() ? 'right' : 'left'; |
| 9 |
$sent_to_admin = ( isset( $sent_to_admin ) ? $sent_to_admin : false ); |
| 10 |
$plain_text = ( isset( $plain_text ) ? $plain_text : '' ); |
| 11 |
$email = ( isset( $email ) ? $email : '' ); |
| 12 |
$postID = CustomPostType::postIDByTemplate( $this->template ); |
| 13 |
$yaymail_settings = get_option( 'yaymail_settings' ); |
| 14 |
$order_image = isset( $yaymail_settings['product_image'] ) && '0' != $yaymail_settings['product_image'] ? $yaymail_settings['product_image'] : '0'; |
| 15 |
$text_link_color = get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) ? get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) : '#7f54b3'; |
| 16 |
$borderColor = isset( $atts['bordercolor'] ) && $atts['bordercolor'] ? 'border-color:' . html_entity_decode( $atts['bordercolor'], ENT_QUOTES, 'UTF-8' ) : 'border-color:inherit'; |
| 17 |
$textColor = isset( $atts['textcolor'] ) && $atts['textcolor'] ? 'color:' . html_entity_decode( $atts['textcolor'], ENT_QUOTES, 'UTF-8' ) : 'color:inherit'; |
| 18 |
$order_item_download_title = get_post_meta( $postID, '_yaymail_email_order_item_download_title', true ); |
| 19 |
$product_title = $is_preview ? '{{items_download_product_title}}' : ( false != $order_item_download_title ? $order_item_download_title['items_download_product_title'] : 'Product' ); |
| 20 |
$expires_title = $is_preview ? '{{items_download_expires_title}}' : ( false != $order_item_download_title ? $order_item_download_title['items_download_expires_title'] : 'Expires' ); |
| 21 |
$download_title = $is_preview ? '{{items_download_download_title}}' : ( false != $order_item_download_title ? $order_item_download_title['items_download_download_title'] : 'Download' ); |
| 22 |
$columns = apply_filters( |
| 23 |
'woocommerce_email_downloads_columns', |
| 24 |
array( |
| 25 |
'download-product' => __( 'Product', 'woocommerce' ), |
| 26 |
'download-expires' => __( 'Expires', 'woocommerce' ), |
| 27 |
'download-file' => __( 'Download', 'woocommerce' ), |
| 28 |
) |
| 29 |
); |
| 30 |
?> |
| 31 |
|
| 32 |
<!-- Table Items has Border --> |
| 33 |
<table class="yaymail_builder_table_items_border yaymail_builder_table_item_download" cellspacing="0" cellpadding="6" border="1" style="width: 100% !important;<?php echo esc_attr( $borderColor ); ?>;color: inherit;flex-direction:inherit;" width="100%"> |
| 34 |
<thead> |
| 35 |
<tr style="word-break: normal;<?php echo esc_attr( $textColor ); ?>"> |
| 36 |
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;<?php echo esc_attr( $borderColor ); ?>;"> |
| 37 |
<?php esc_html_e( $product_title, 'woocommerce' ); ?> |
| 38 |
</th> |
| 39 |
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;<?php echo esc_attr( $borderColor ); ?>;"> |
| 40 |
<?php esc_html_e( $expires_title, 'woocommerce' ); ?> |
| 41 |
</th> |
| 42 |
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;<?php echo esc_attr( $borderColor ); ?>;"> |
| 43 |
<?php esc_html_e( $download_title, 'woocommerce' ); ?> |
| 44 |
</th> |
| 45 |
</tr> |
| 46 |
</thead> |
| 47 |
<tfoot> |
| 48 |
<tr style="<?php echo esc_attr( $textColor ); ?>"> |
| 49 |
<td class="td" style="<?php echo esc_attr( $borderColor ); ?>;text-align:<?php echo esc_attr( $text_align ); ?>"> |
| 50 |
|
| 51 |
<?php |
| 52 |
if ( '1' == $order_image ) : |
| 53 |
$product_image_src = wc_placeholder_img_src(); |
| 54 |
$image_width = isset( $yaymail_settings['image_width'] ) ? str_replace( 'px', '', $yaymail_settings['image_width'] ) : 32; |
| 55 |
$image_height = isset( $yaymail_settings['image_height'] ) ? str_replace( 'px', '', $yaymail_settings['image_height'] ) : 32; |
| 56 |
$image_size = isset( $yaymail_settings['image_size'] ) ? $yaymail_settings['image_size'] : 'thumbnail'; |
| 57 |
?> |
| 58 |
<div class="yaymail-product-download-image" style="margin-bottom: 5px; float: left"> |
| 59 |
<a style="color:<?php echo esc_attr( $text_link_color ); ?>" href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"> |
| 60 |
<img src="<?php echo esc_url( $product_image_src ); ?>" alt="Product image" height="<?php echo esc_attr( $image_height ); ?>" width="<?php echo esc_attr( $image_width ); ?>" style="vertical-align:middle; margin-right: 10px;" /> |
| 61 |
<span><?php esc_html_e( 'Downloadable Product', 'yaymail' ); ?></span> |
| 62 |
</a> |
| 63 |
</div> |
| 64 |
<?php else : ?> |
| 65 |
<a href="" style="color:<?php echo esc_attr( $text_link_color ); ?>" > <?php esc_html_e( 'Downloadable Product', 'yaymail' ); ?></a> |
| 66 |
<?php endif; ?> |
| 67 |
</td> |
| 68 |
<td class="td" style="<?php echo esc_attr( $borderColor ); ?>;text-align:<?php echo esc_attr( $text_align ); ?>"> |
| 69 |
<time datetime="2021-02-13" title="1613174400"> <?php echo wp_kses_post( wc_format_datetime( new WC_DateTime() ) ); ?></time> |
| 70 |
</td> |
| 71 |
<td class="td" style="<?php echo esc_attr( $borderColor ); ?>;text-align:<?php echo esc_attr( $text_align ); ?>"> |
| 72 |
<a href="" style="color:<?php echo esc_attr( $text_link_color ); ?>" ><?php esc_html_e( 'Download.doc', 'yaymail' ); ?></a> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
</tfoot> |
| 76 |
</table> |
| 77 |
|