• Resolved grafixNZ

    (@grafixnz)


    Hello Mike,

    You answered my thread three months ago regarding this issue here https://www.ads-software.com/support/topic/adding-sku-to-order-completed-email

    However, I actually never got it to work, even though I have done what was suggested and there are no template overrides. The other person in the thread seems to have solved the issue, but didn’t describe what they did.

    Do you have any further suggestions for how to add the SKU? I believe I am receiving the exact same email that the customer is getting, and I see no SKU with the code change.

    I have this in functions.php to send the email to myself

    add_filter( ‘woocommerce_email_recipient_customer_completed_order’, ‘your_email_recipient_filter_function’, 10, 2);

    function your_email_recipient_filter_function($recipient, $object) {
    $recipient = $recipient . ‘EMAIL ADDRESS HERE’;
    return $recipient;
    }

    Many thanks

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Can you remind us what change you made and to what files, and provide system status report.

    I had the same problem…

    I added the code the template file customer-completed-order.php (copy it to your theme/woocommerce/emails) in the line 35

    // turn "off"
    //do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
    // new table
    echo $order->email_order_items_table( array(
        'show_sku'      => true,
        'show_image'    => true,
        '$image_size'   => array( 50, 50 ),
        'plain_text'    => $plain_text,
        'sent_to_admin' => $sent_to_admin
        ) );

    You can turn off the image (false) and you need to do the totals after in a table… :/

    read this:

    Update…

    I added a filter for it in functions.php…

    function your_funtion_sku_woocommerce_emails( $output, $order ) {
        static $run = 0;
        // if we've already run this filter, bail out
        if ( $run ) {return $output;}
        $args = array('show_sku'=> true);
        // increment our flag so we don't run again
        $run++;
        // if first run, give WooComm our updated table
        return $order->email_order_items_table( $args );
    }
    add_filter( 'woocommerce_email_order_items_table', 'your_funtion_sku_woocommerce_emails', 10, 2 );
    Thread Starter grafixNZ

    (@grafixnz)

    Thanks m4nu3l, that fixed it for me ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Completed email, add SKU’ is closed to new replies.