• Resolved agstudio

    (@agstudio)


    Is it possible to add note to customer after change order meta. I use this code and it works with add_order_note(), but not with set_customer_note().

    add_action( 'woocommerce_process_shop_order_meta', 'save_extra_details', 10, 3 );    
    function save_extra_details( $post_id, $post ) {
    	
    	$meta_delivery_date = get_post_meta( $post_id, '_delivery_date', true );
    	
    	if ( $_POST[ '_delivery_date' ] != $meta_delivery_date ) {
    		$order = wc_get_order( $post_id );
    		$note = 'Delivery date was changed from ' . date("m/d/Y", strtotime($meta_delivery_date)) . ' to ' . date("m/d/Y", strtotime($_POST[ '_delivery_date' ]));
    		//$order->add_order_note( $note );
    		$order->set_customer_note($note);
    		$order->save();
    );
        }
        
        update_post_meta( $post_id, '_delivery_date', wc_clean( $_POST[ '_delivery_date' ] ) );
        
    }

    Is there any way to inform customer about order meta changes? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add customer note when the order meta is updated’ is closed to new replies.