Advertisement
geminilabs

review-reminder-html.php

Dec 4th, 2023 (edited)
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.22 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Customer follow-up email sent after purchase with a reminder to write a review.
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/site-reviews-notifications/woocommerce/review-reminder-html.php.
  6.  *
  7.  * HOWEVER, on occasion the Site Reviews Notifications add-on will need to update
  8.  * template files and you (the theme developer) will need to copy the new files
  9.  * to your theme to maintain compatibility. We try to do this as little as
  10.  * possible, but it does happen. When this occurs the version of the template
  11.  * file will be bumped and the readme will list any important changes.
  12.  *
  13.  * @version 1.0.0
  14.  */
  15. defined('ABSPATH') || exit;
  16.  
  17. /*
  18.  * Executes the e-mail header.
  19.  *
  20.  * @hooked WC_Emails::email_header() Output the email header
  21.  */
  22. do_action('woocommerce_email_header', $email_heading, $email);
  23.  
  24. /*
  25.  * Show email content - this is set in the email's settings.
  26.  */
  27. echo wp_kses_post(wpautop(wptexturize($content)));
  28.  
  29. ?>
  30.  
  31. <p>
  32.     <?php
  33.         printf(esc_html_x('Here are the details of your order placed on %s:', 'Order date', 'site-reviews-notifications'),
  34.             esc_html(wc_format_datetime($order->get_date_created()))
  35.         );
  36. ?>
  37. </p>
  38.  
  39. <h2>
  40.     <?php
  41.     echo wp_kses_post(sprintf(_x('[Order #%s]', 'Order ID', 'site-reviews-notifications').' (<time datetime="%s">%s</time>)',
  42.         $order->get_order_number(),
  43.         $order->get_date_created()->format('c'),
  44.         wc_format_datetime($order->get_date_created())
  45.     ));
  46. ?>
  47. </h2>
  48.  
  49. <div style="margin-bottom: 40px;">
  50.     <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
  51.         <tbody>
  52.         <?php
  53.  
  54.     foreach ($order->get_items() as $item_id => $item) {
  55.  
  56.         $product = $item->get_product();
  57.         $image = '';
  58.  
  59.         if (!apply_filters('woocommerce_order_item_visible', true, $item)) {
  60.             continue;
  61.         }
  62.  
  63.         if (is_object($product)) {
  64.             $image = $product->get_image($image_size);
  65.         }
  66.  
  67.         ?>
  68.             <tr class="<?php echo esc_attr(apply_filters('woocommerce_order_item_class', 'order_item', $item, $order)); ?>">
  69.                 <td class="td" style="text-align:<?php echo esc_attr($text_align); ?>; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;">
  70.                 <?php
  71.                     // Product image.
  72.                     echo wp_kses_post(apply_filters('woocommerce_order_item_thumbnail', $image, $item));
  73.                     // Product name.
  74.                     echo wp_kses_post(apply_filters('woocommerce_order_item_name', $item->get_name(), $item, false));
  75.                     // allow other plugins to add additional product information here.
  76.                     do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text);
  77.                     // Product meta
  78.                     wc_display_item_meta($item, [
  79.                         'label_before' => '<strong class="wc-item-meta-label" style="float: '.esc_attr($text_align).'; margin-'.esc_attr($margin_side).': .25em; clear: both">',
  80.                     ]);
  81.                     // allow other plugins to add additional product information here.
  82.                     do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text);
  83.                 ?>
  84.                 </td>
  85.                 <td class="td" style="text-align:<?php echo esc_attr($text_align); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
  86.                     <?php
  87.                         $language = get_post_meta($order->get_id(), 'wpml_language', true);
  88.                         $permalink = apply_filters('wpml_permalink', $product->get_permalink(), $language);
  89.                     ?>
  90.                     <a href="<?php echo $permalink; ?>#reviews"><?php _e('Rate product', 'site-reviews-notifications'); ?></a>
  91.                 </td>
  92.             </tr>
  93.         <?php } ?>
  94.         </tbody>
  95.     </table>
  96. </div>
  97.  
  98. <?php
  99.  
  100. /**
  101.  * Executes the email footer.
  102.  *
  103.  * @hooked WC_Emails::email_footer() Output the email footer
  104.  */
  105. do_action('woocommerce_email_footer', $email);
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement