3

enter image description here

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 ?

yourkishore
  • 278
  • 8
  • 19

1 Answers1

4

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.

maksbd19
  • 3,785
  • 28
  • 37
  • Nailed it +1. Also, there are *lots* of nice good working code for this at [wordpress.se]. – brasofilo Oct 26 '13 at 14:45
  • Thanks for the reply mate, actually that project of mine is completed with plugin options :( but finally i found the solution. Not tested but seems good. – yourkishore Oct 26 '13 at 17:05