• Resolved Pat Gilmour

    (@patgilmour)


    I want to change the heading on my Paid Customer Invoices.

    In an invoice, this is the text that appears in the header of your order table – normally with a solid background color.

    The class that handles the text is here:
    woocommerce/includes/emails/class-wc-email-customer-invoice.php

    The line of code I would need to change is this one:
    $this->heading_paid = __( 'Order {order_number} details', 'woocommerce');

    But obviously, I don’t want to change one of the core classes.

    I know there is hook – woocommerce_email_headers – for email headers. But can’t make it change this text

    Is there a filter to modify this text?

    Thanks!

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter Pat Gilmour

    (@patgilmour)

    For anyone interested, you can do the above with a filter:

    /**
     * Email: Change Text of Paid Invoice Heading
     *
     * By default, paid invoices don't have "Invoice" in the heading, but some customers request this.
     *
     * see https://docs.woothemes.com/document/change-email-subject-lines/ for how to do it with subject lines
     * which points to /wp-content/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php
     *
     * the filter hook is in there: woocommerce_email_heading_customer_invoice_paid
     *
     */
    add_filter( 'woocommerce_email_heading_customer_invoice_paid', 'xcsn_woocommerce_email_heading_customer_invoice_paid', 10, 2);
    function xcsn_woocommerce_email_heading_customer_invoice_paid ( $heading, $order ) {
    
    	$order_id = $order->id;
    
    	$heading = 'Invoice for Order Number #' . $order_id ;
    
    	return $heading;
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Change Paid Customer Invoice Heading’ is closed to new replies.