WordPress.org

Ready to get started?Download WordPress

Forums

WP e-Commerce Shop Styling
[resolved] How to add order notes to email (6 posts)

  1. Bloke
    Member
    Posted 1 year ago #

    How can I add order notes to the email?

    http://wordpress.org/plugins/wp-ecommerce-shop-styling/

  2. haet
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. Bloke
    Member
    Posted 1 year ago #

    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.

  4. haet
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. Bloke
    Member
    Posted 1 year ago #

    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

  6. Bloke
    Member
    Posted 1 year ago #

    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();

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.