I have few questions regarding woo price.php
first I like to change the way get_price_html() showing the price and I couldn't find a way and then I decide to change price.php file and add the following lines before get_price_html:
<div class="row">
<div class="col-md-6">
<p class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) ); ?>" style="color: #212529; font-weight: 700; font-size: 1.61rem; line-height: 2rem; text-transform: none; margin-top: -0.25rem;"><?php
echo get_woocommerce_currency_symbol();
echo $product->get_regular_price(); ?></p>
</div>
<div class="col-md-6">
<span class="text-danger">VAT included </span>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) ); ?>" style="color: #212529; font-weight: 700; font-size: 1.61rem; line-height: 2rem; text-transform: none; margin-top: -0.25rem;"><?php
echo get_woocommerce_currency_symbol();
echo $product->get_sale_price();
?></p>
</div>
<div class="col-md-6">
<span class="text-danger">Price per KG </span>
</div>
</div>
It works for me and showing the product's price in the style that I am looking for. but there is few questions:
- As you see in
get_price_htmlthe price appears with,but inget_regular_pricethe price shown with.as a decimal - Also when
get_sale_priceis available, it doesn't add<strike>to the regular price.
Totally is the arny way to edit get_price_html instead of get_sale_price and get_sale_price
