Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Bloke,
    If you create a custom checkout field for your order notes, you can add this field to any mail or to your PDF invoice
    regards, Hannes

    Thread Starter Bloke

    (@bloke)

    Thanks. I am referring to the sales order notes found in the sales log. These are notes entered in the back end not by the customer.

    Hi Bloke,
    Sorry that’s not possible at the moment. You can either contact me per email for a quote to get this feature, or just wait a few weeks (or maybe a few months) until I reach this entry on my list of change requests.
    regards, Hannes

    Thread Starter Bloke

    (@bloke)

    I found this and its close to what I am trying to do. He gives a list of item array keys at the bottom and I assume I could retrieve the notes.

    Scroll to the second to last block of code Get purchase log data

    Thread Starter Bloke

    (@bloke)

    I got it figured out and here is how I did it in case anyone needs it because I cannot a free plug in that allows you to add the notes. Its helpful to add the order log notes to emails because when you resend the receipt to the customer it informs them of any changes.

    In my theme’s functions file. I added.

    function wpsc_get_notes($purchase_id ) {//$purchase_id
    
    $purchase_log_notes  = $wpdb->get_var( $wpdb->prepare( 'SELECT notes FROM ' . WPSC_TABLE_PURCHASE_LOGS . " WHERE id = %d", $purchase_id ) );
    return $purchase_log_notes;

    And then I created a class that I adapted from what I found here https://gist.github.com/webaware/4964078.

    class WpscExtendCustEmailNotes {
    /**
    * add filter hooks
    */
    public function __construct() {
    add_filter('wpsc_purchase_log_customer_notification_raw_message', array($this, 'customerMessage'), 10, 2);
    }
    
    /**
    * intercept filter hook for customer notification message
    */
    public function customerMessage($msg, $log_notification) {
    
    global $purid;
    $order_notes = wpsc_get_notes($purid);
    $msg .= "\n\n" .str_repeat('=', 85) . "\n";
    $msg .= "\n\n<strong>Order notes:</strong>";
    $msg .= "\n\n$order_notes\n";
    return $msg;
    }
    }
    
    new WpscExtendCustEmailNotes();

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add order notes to email’ is closed to new replies.