how to add text area and checkbox before order details on Woocommerce checkout page

I want to add some one check box, one text area and one link before the order details on checkout. I tried to find all over the stackoverflow but I did not found any exact information or code. If anyone help me so I will be very thankful to you. check screen shot for more info http://prntscr.com/9dtloy

add_action( 'woocommerce_review_order_before_payment', 'skyverge_before_paying_notice' );
function skyverge_before_paying_notice() {
wc_print_notice( __( 'Here is some text', 'woocommerce' ), 'error' );
}

Read More

I tried this code which is showing something like this http://prntscr.com/9dttsi

Thanks

Related posts

3 comments

  1. Have you tried add_action( ‘woocommerce_review_order_before_order_total’, ‘my_custom_fields’ );

    function my_custom_fields(){
        // put your custom fields out here
    }
    
  2. The following hook will add the text before the order details but below the “Your order” text.

    //Hook
    add_action('woocommerce_before_cart_contents', 'fields_before_order_details');
    
    //function
    function fields_before_order_details(){
      wc_print_notice( __( 'Here is some text', 'woocommerce' ), 'error' );
    }
    

    This is not the only hook that will achieve this, you can find a list of more Woocommerce hooks here.

  3. This is how we can show content right before the “Your Order”

    add_action('woocommerce_after_checkout_billing_form', 'fields_before_order_details');
    //function
    function fields_before_order_details(){
      echo 'Terms & Conditions';
    }
    

    Thanks all for your contribution

Comments are closed.