Html code is not showing in woocommerce shop page on adding in header.php?

Can you use WooCommerce conditional tags instead of the default? For example, if you want this block of content to appear for all pages, use is_woocommerce() or if it should only appear on the main shop page, use is_shop().

For example:

if( is_woocommerce() ){
    //echo your content here...
} ?>

Source: https://docs.woocommerce.com/document/conditional-tags/