Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29758

Problem with overwriting an email template in WooCommerce

$
0
0

I modified an email template by putting those files in 'mytheme/woocommerce/emails':

  • customer-processing-order.php
  • email-footer.php
  • email-header.php
  • email-order-details.php
  • email-order-items.php

Everything works correctly, it seems that email template is succesfully replaced. I've checked it by using WooCommerce Email Test plugin (https://pl.wordpress.org/plugins/woocommerce-email-test/) and in WooCommerce status. All files are propertly replaced.

But in email received after doing an order it seems like the email using default customer-processing-order.php file.

I made only two changes in this file:

  • i replaced default paragraph with info that order has beeing processed
  • deleted line with customer details hook.

My customer-processing-order.php looks like:

<?php
/**
 * Customer processing order email
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-processing-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/
 * @author      WooThemes
 * @package     WooCommerce/Templates/Emails
 * @version     2.5.0
 */

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

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

<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-family: Trebuchet MS, Tahoma, sans-serif"><![endif]-->
<div>My custom html</div>
<!--[if mso]></td></tr></table><![endif]-->

<?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
 */
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );



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

I use following plugins:

  • woocommerce-direct-checkout
  • woocommerce-rental-and-booking

Any ideas where can be problem?


Viewing all articles
Browse latest Browse all 29758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>