Home Forums WoodMart support forum no html blocks Reply To: no html blocks

#369308

giannisth
Participant

also please see this:
right before selecting a product, the price is “free” because the price is set to 0, which is what i want! https://i.imgur.com/zsFVqpi.png
but when i select on the product location the “free” dissapears and shows the price , which is not what i want.https://i.imgur.com/6fz3XO2.png
i have inserted this code

add_filter( 'woocommerce_get_price_html', 'wooc_price_free_zero_empty', 9999, 2 );
   
function wooc_price_free_zero_empty( $price, $product ) {
    if ( '' === $product->get_price() || 0 == $product->get_price() ) {
        $price = '<span class="wooc-price-amount amount amount-free">Δωρεάν</span>';
    }  
    return $price;
}

any idea please?