Tell me how to hide the old price of a product when viewing a product in detail? Those. so that a strikethrough price is not displayed, regardless of the type of goods: variable or simple.
As I understand it, this $ product-> get_price_html () code displays two prices.

    1 answer 1

    The choice - there are such functions of price display:

    $_product->get_regular_price(); $_product->get_sale_price(); $_product->get_price(); 

    From the names it is clear about the first two. The third displays the active price.

    There is a filter with which you can correct the html output from the product->get_price_html() function:

     apply_filters( 'woocommerce_get_price_html', $price, $this ); 

    Get current currency symbol:

     $currency_symbol = html_entity_decode( get_woocommerce_currency_symbol() ); 
    • > From the names it is clear about the first two. The third displays both prices. - word
    • corrected the answer. - KAGG Design
    • <p class="price">get_regular_price <?php echo $product->get_regular_price(); ?></p> <p class="price">get_sale_price <?php echo $product->get_sale_price(); ?></p> <p class="price">get_price <?php echo $product->get_price(); ?></p> <p class="price">get_display_price <?php echo $product->get_display_price(); ?></p> <p class="price">get_price_html <?php echo $product->get_price_html(); ?></p> <p class="price">get_regular_price <?php echo $product->get_regular_price(); ?></p> <p class="price">get_sale_price <?php echo $product->get_sale_price(); ?></p> <p class="price">get_price <?php echo $product->get_price(); ?></p> <p class="price">get_display_price <?php echo $product->get_display_price(); ?></p> <p class="price">get_price_html <?php echo $product->get_price_html(); ?></p> - word
    • only this code displays two prices get_price_html () - word
    • So what? I have given direct features from which you can get three price options. If necessary, there is a filter apply_filters ('woocommerce_get_price_html', $ price, $ this); - KAGG Design