• Resolved morganelite

    (@morganelite)


    Hello All!

    I am interested in adding an automatic note to the order notes section of the Admin orders page. I do not know PHP, but came across the following code in a previous post from 8 months ago. Is there anyway to do this using CSS? If no, where should I place the PHP code and how safe is it?

    add_action( ‘woocommerce_new_order’, ‘add_engraving_notes’ );
    function add_engraving_notes( $order_id ) {
    //note this line is different
    //because I already have the ID from the hook I am using.
    $order = wc_get_order( $order_id );

    // The text for the note
    $note = ‘No special message yet’;

    // Add the note
    $order->add_order_note( $note );

    // Save the data
    $order->save();
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter morganelite

    (@morganelite)

    Also do anyone know if the automatic order note will be overwritten if a customer places an actual note in the order notes section during checkout?

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    Is there anyway to do this using CSS?

    If you want an actual note created that is saved in the database, impossible.

    If no, where should I place the PHP code and how safe is it?

    You can use your functions.php or something like: https://www.ads-software.com/plugins/code-snippets/ – both methods are safe.

    Also do anyone know if the automatic order note will be overwritten if a customer places an actual note in the order notes section during checkout?

    Order notes do not overwrite each other.

    Kind regards,

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Kind regards,

    Thread Starter morganelite

    (@morganelite)

    Resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Automatic custom order note to Admin Order page’ is closed to new replies.