Reputation: 164
I want to create a custom table block in Woocommerce admin order page. As you can see in a screenshot, I have used :
add_action( 'woocommerce_admin_order_data_after_order_details', 'vp_admin_order_table' );
What I want is to create a separate block, with this table inside it.
Is there any action to trigger gap between Order details and Products list?
Upvotes: 4
Views: 1216
Reputation: 2817
Try this code:
function op_register_menu_meta_box() {
add_meta_box(
'Some identifier of your custom box',
esc_html__( 'Box Title', 'text-domain' ),
'render_meta_box',
'shop_order', // shop_order is the post type of the admin order page
'normal', // change to 'side' to move box to side column
'low' // priority (where on page to put the box)
);
}
add_action( 'add_meta_boxes', 'op_register_menu_meta_box' );
function render_meta_box() {
// Metabox content
echo '<strong>Your awesome content goes here</strong>';
}
Remember to set to box as visible under "Screen Options" on the order page.
Further reading:
Upvotes: 2