Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php WooCommerce:创建自定义电子邮件_Php_Wordpress_Woocommerce_Woocommerce Theming - Fatal编程技术网

Php WooCommerce:创建自定义电子邮件

Php WooCommerce:创建自定义电子邮件,php,wordpress,woocommerce,woocommerce-theming,Php,Wordpress,Woocommerce,Woocommerce Theming,我正在尝试使用客户发票/订单详细信息电子邮件创建审核提醒电子邮件。我们不使用此电子邮件,因此我认为最好更改代码,使其成为审阅提醒电子邮件,然后我们可以手动触发它 我已经修改了一些代码,所以现在看起来是这样的: <?php /** * Customer completed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-compl

我正在尝试使用客户发票/订单详细信息电子邮件创建审核提醒电子邮件。我们不使用此电子邮件,因此我认为最好更改代码,使其成为审阅提醒电子邮件,然后我们可以手动触发它

我已经修改了一些代码,所以现在看起来是这样的:

<?php
/**
 * Customer completed order email
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce/Templates/Emails
 * @version 3.5.0
 */

if ( ! defined( 'ABSPATH' ) ) {
  exit;
}

/*
 * @hooked WC_Emails::email_header() Output the email header
 */
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>


<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
<p><?php printf( esc_html__("the more you share, the more you help other customers. We would love to know your thoughts on your most recent purchase and we'd appreciate it if you could take a moment to write a quick review.", 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p>
<?php

/*
 * @hooked WC_Emails::order_details() Shows the order details table.
 * @hooked WC_Structured_Data::generate_order_data() Generates structured data.
 * @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
 * @since 2.5.0
 */

$text_align = is_rtl() ? 'right' : 'left';


  if ( $sent_to_admin ) {
    $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
    $after  = '</a>';
  } else {
    $before = '';
    $after  = '';
  }
  /* translators: %s: Order ID. */
  ?>
</h2>

<div style="margin-bottom: 40px;">
  <table class="td" cellspacing="0" cellpadding="0" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
<tbody>
      <?php
      echo wc_get_email_order_items( $order, array( // WPCS: XSS ok.
        'show_sku'      => $sent_to_admin,
        'show_image'    => true,
        'image_size'    => array( 100, 100 ),
        'plain_text'    => $plain_text,
        'sent_to_admin' => $sent_to_admin,
      ) );
      ?>

    </tbody>
  </table>
</div>


<p>
<?php esc_html_e( 'Thanks for shopping with us.', 'woocommerce' ); ?>
</p>
<?php

/*
 * @hooked WC_Emails::email_footer() Output the email footer
 */
do_action( 'woocommerce_email_footer', $email );


电子邮件订单项目.php表单插件/woocommerce/templates/emails/复制到您的wp content/themefolder/woocommerce/emails/email order项目中。php通过此操作,您可以编辑电子邮件的布局,而无需触及woocommerce的核心功能。详细信息已经存在,包括图片和标题。

您好,请尝试一次本文,但如果我编辑此文件,它不会更改所有电子邮件的内容吗?