skip to Main Content

I am struggling to add some simple html to the top of the edit coupon page. Am I using the wrong action hook?

add_action( 'woocommerce_edit_coupon_form_before_coupon_data', 'add_html_next_to_coupon_code' );

function add_html_next_coupon_code() {
    echo '<p> HTML content.</p>';
}

2

Answers


  1. You have used right hook ‘woocommerce_edit_coupon_form_before_coupon_data’. But missed to call same function. Your function name is add_html_next_coupon_code

    Please follow this code

    add_action( 'woocommerce_edit_coupon_form_before_coupon_data', 'add_html_next_coupon_code' );
    
    function add_html_next_coupon_code() {
        echo '<p> HTML content.</p>';
    }
    
    Login or Signup to reply.
  2. add_action( ‘woocommerce_edit_coupon_form_before_coupon_data’, ‘add_html_next_coupon_code’ );

    function add_html_next_coupon_code() {
    echo ‘

    HTML content.

    ‘;
    }

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search