Update notes with response

This commit is contained in:
Mike Jolley 2019-01-03 13:37:32 +00:00
parent 5ef45f51f6
commit 247fd3f610
1 changed files with 16 additions and 4 deletions

View File

@ -687,10 +687,22 @@ jQuery( function ( $ ) {
data: data,
type: 'POST',
success: function( response ) {
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
wc_meta_boxes_order_items.reloaded_items();
wc_meta_boxes_order_items.unblock();
if ( response.success ) {
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
$( '#woocommerce-order-items' ).find( '.inside' ).append( response.data.html );
// Update notes.
if ( response.data.notes_html ) {
$( 'ul.order_notes' ).empty();
$( 'ul.order_notes' ).append( $( response.data.notes_html ).find( 'li' ) );
}
wc_meta_boxes_order_items.reloaded_items();
wc_meta_boxes_order_items.unblock();
} else {
wc_meta_boxes_order_items.unblock();
window.alert( response.data.error );
}
}
});