• Resolved wpallthetime

    (@wpallthetime)


    I’m using some modified code shared by someone else in this forum (below).

    function md_custom_woocommerce_checkout_fields( $fields )
    {
    global $html;
    $fields[‘order’][‘order_comments’][‘placeholder’] = ‘Special notes’;
    $fields[‘order’][‘order_comments’][‘label’] = ‘Add your special note’;
    $html=’mynote’;
    return $fields;
    }
    add_filter( ‘woocommerce_checkout_fields’, ‘md_custom_woocommerce_checkout_fields’ );

    Next I want to display the $html:

    add_action(‘woocommerce_checkout_after_terms_and_conditions’, ‘add_terms_and_policy’, 20);
    function add_terms_and_policy() {
    global $html;
    echo $html;
    }

    The problem is that I can see mynote displayed for a second and then it disappears. So I’m so close to solving a problem. Does anyone know why it would then hide?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Global variable and displaying text in checkout’ is closed to new replies.