I had there some code so i get the right prices and classes arround them to style them correctly.
// Prijs tonen
function edit_price_display() {
global $product;
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
$normal_price = $product->get_price();
$price_btw = $product->get_price_including_tax();
$regular_price = number_format($regular_price, 2, ",", ".");
$sale_price = number_format( floatval($sale_price), 2, ",", ".");
$normal_price = number_format($normal_price, 2, ",", ".");
$price_btw = number_format($price_btw, 2, ",", ".");
if ($sale_price > 0) {
$display_price = '<span class="price">';
$display_price .= '<span class="shopping-prijs amount striped">€' . $regular_price . '<small class="woocommerce-price-suffix"> Excl. BTW</small></span>';
$display_price .= '<br>';
$display_price .= '<span class="shopping-prijs amount">€' . $normal_price . '<small class="woocommerce-price-suffix"> Excl. BTW</small></span>';
$display_price .= '<br>';
$display_price .= '<span class="woocommerce-Price-amount amount" itemprop="price">€' . $price_btw . '<small class="woocommerce-price-suffix"> Incl. BTW</small></span>';
$display_price .= '</span>';
return $display_price;
} else {
$display_price = '<span class="price">';
$display_price .= '<span class="shopping-prijs amount">€' . $normal_price . '<small class="woocommerce-price-suffix"> Excl. BTW</small></span>';
$display_price .= '<br>';
$display_price .= '<span class="woocommerce-Price-amount amount" itemprop="price">€' . $price_btw . '<small class="woocommerce-price-suffix"> Incl. BTW</small></span>';
$display_price .= '</span>';
return $display_price;
}
}
add_filter('woocommerce_get_price_html', 'edit_price_display', 10, 2);
You’re suggestion has fixed the problem but does it also needs to be corrected for the other lines of code?