WordPress.org

Forums

WooCommerce - excelling eCommerce
Create New Email Template Base On Custom Order Status (1 post)

  1. eleazarcelis
    Member
    Posted 1 year ago #

    Hi everybody!

    I created two status order in my plugin, and I need to create two email template NOT OVERWRITE, I copied the classes that already have WooCommerce, my problem is that my custom email template is not found, it is as if the file did not exist.

    i tried:

    in the construct:
    $this->template_html = 'emails/customer-mycustomstatus-order.php';

    in the function "get_content_html":

    ob_start();
    wc_get_template( $this->template_html, array(
    'order' => $this->object,
    'email_heading' => $this->get_heading(),
    'sent_to_admin' => false,
    'plain_text'    => false
    ), '/wp-content/plugins/myplugin/woocommerce/', '/wp-content/plugins/myplugin/woocommerce/' );
    return ob_get_clean();

    I also tried filtering "woocommerce_locate_template":

    if ( $template_name == 'emails/customer-mycustomstatus-order.php' ) {
    $template = _MYPLUGIN_ABSPATH_.'/'.$template_name;
    }

    and never get the file, please, I'm doing wrong?

    https://wordpress.org/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic