Wijzig de weergave van de product prijs in WooCommerce wanneer een product variabel is met een minimum en maximum prijs. Meer informatie en ondersteuning via https://wphelpdesk.nl/artikel/woocommerce-vanaf-prijs/
<?php | |
//Vanaf hier Kopiëren | |
/** | |
* Toont de tekst "Vanaf" wanneer er een verschil is tussen | |
* $product->min_variation_price EN $product->max_variation_price | |
* Geschikt voor WooCommerce versie 3, deze code kan je plakken in de functions.php van je thema | |
* Version: Woocommerce 3.0 | |
*/ | |
add_filter('woocommerce_variable_price_html','wphelpdesk_variate_prijs_verschil', 10, 2); | |
function wphelpdesk_variate_prijs_verschil( $price, $product ) { | |
if (count($product->get_children()) > 1) { | |
// De tekst 'Vanaf' is te wijzigen naar het woord dat je wilt weergeven | |
// Zorg wel dat je de '' laat staan! | |
$price = '<span class="from">' . __('Vanaf') . '</span> '; | |
$price .= woocommerce_price($product->price); | |
} | |
return $price; | |
} | |
// Tot hier Kopiëren | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Hi there,
Code works perfectly, only my prices are exclusive of VAT. So I see the prices from without the VAT. Can this be adjusted?
Greetings,
Sfaantje