• Hi, I would like to change the order of the options in the admin order meta box dropdown, where you can choose to save a private note or to send it to the customer. By default, the “Private note” option is the first one; I would like the “Note to customer” to be the first one.

    Can someone give me an idea how to do that, of course without editing the core WooCommerce plugin file (WC_Meta_Box_Order_Notes)? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Danny Santoro

    (@danielsantoro)

    Automattic Happiness Engineer

    Hi there,

    This is all brought in by class WC_Meta_Box_Order_Notes in the file you mentioned – if you use a filter, you can modify the output. Essentially you would just need to switch the last segment of the code in your filter.

    This is starting on Line 79 of class-wc-meta-box-order-notes.php, edited to how you would want it to be (with the options switched):

    <select name="order_note_type" id="order_note_type">
        <option value="customer"><?php _e( 'Note to customer', 'woocommerce' ); ?></option>
        <option value=""><?php _e( 'Private note', 'woocommerce' ); ?></option>
    </select>
    

    Here is a page to get you started with filters: https://codex.www.ads-software.com/Plugin_API/Filter_Reference
    And here is an easier-to-follow guide that I like a little better ?? :https://wpcandy.com/teaches/how-to-use-wordpress-hooks/#.V_vbJ5MrIUF

    • This reply was modified 8 years, 1 month ago by Danny Santoro. Reason: Cleaning up code
    Thread Starter morris4ever69

    (@morris4ever69)

    Hi Danny, thank you very much for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Editing order notes meta box dropdown in admin order page’ is closed to new replies.