Reputation: 278
How to add another option here like order actions, order totals. I know how to create option page but not how to edit woocommerce options . Is there any way ?
Upvotes: 3
Views: 3569
Reputation: 3830
Its really simple to customize the order and coupons in woocommerce because they are just another custom post type. You can use any functionality of a custom post type in there. You only need to keep in mind that the post type of Orders
is shop_order
and of Coupons
is shop_coupon
.
If you want to add some custom option inside the order editor page of woocommerce then use the following code to add a new meta box inside that post type.-
add_action('add_meta_boxes',function(){
add_meta_box('custom_order_option', 'Custom Order Option', 'custom_order_option_cb','shop_order');
});
function custom_order_option_cb($post){
// your code goes here...
}
For further details visit the codex here.
Upvotes: 4