title: Woocommerce display price without tax on variable products
body: <p>prices in my shop are displayed with tax and also I'm using {price_excluding_tax} suffix to display also price excluding tax. But there is a problem with variable products... The shop shows only prices including tax (and the old price in case of promotion) but it doesn't shows the price excluding tax. Prices for both variable products are the same. I tried to use this code:</p>
  
  <p><a href="https://tomjesch.com/display-woocommerce-products-with-and-without-tax/" rel="nofollow noreferrer">https://tomjesch.com/display-woocommerce-products-with-and-without-tax/</a></p>
  
  <p>But it doesn't work properly - it shows prices, but does not react to any price change in the woocommerce admin panel. So, it works fine only when adding a new product. </p>
  
  <p>Thanks in advance... </p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>function edit_price_display() {
    $product         = WC_Product( get_the_ID() );
    $regular_price   = $product -&gt;regular_price;
    $price           = $product-&gt;price;
  
    $price_incl_tax  = $price + round( $price * ( 23 / 100 ), 2 ); 
    $price_incl_tax  = number_format( $price_incl_tax, 2, ",", "" ); 
    $price           = number_format( $price, 2, ",", "" ); 
  
    $display_price   = '&lt;ins&gt;&lt;span class="woocommerce-Price-amount amount"&gt;';
    $display_price  .= ' '.$price_incl_tax .'&lt;span class="woocommerce-Price-currencySymbol"&gt;&amp;nbsp;zł&lt;/span&gt;';
    $display_price  .= '&lt;/span&gt;&lt;/ins&gt;&amp;nbsp;';
    $display_price  .= '&lt;small class="woocommerce-price-suffix"&gt;(netto: &lt;span class="woocommerce-Price-amount amount"&gt;'.$price .'&amp;nbsp;&lt;span class="woocommerce-Price-currencySymbol"&gt;zł&lt;/span&gt;&lt;/span&gt;)&lt;/small&gt;';
  
    $display_price .= '';
  
    $display_regular_price ='&lt;del&gt;&lt;span class="woocommerce-Price-amount amount"&gt;'.$regular_price .'&lt;span class="woocommerce-Price-currencySymbol"&gt;&amp;nbsp;zł&lt;/span&gt;&lt;/span&gt;&lt;/del&gt;';
  
  
    if($product-&gt;is_on_sale()) {
      echo $display_regular_price;    
    }
    echo $display_price;
  }
  add_filter('woocommerce_variable_price_html', 'edit_price_display');
  </code></pre>