Add Price suffix with VAT toggle button
-
Hi,
I tried to add a suffix on price (listing product), Ex VAT or Inc VAT according to what was selected with the toggle VAT button. I’ve tried to add this function, but it doesn’t seem like a good one, so could you help me? Maybe there is another solution with the plugin?
add_filter( ‘woocommerce_get_price_suffix’, ‘custom_price_suffix’, 999, 4 );
function custom_price_suffix( $html, $product, $price, $qty ){
if ( $product->is_taxable() ) {
return ‘ ‘ . __(‘inc VAT’, ‘woocommerce’);
}else {
return ‘ ‘ . __(‘ex VAT’, ‘woocommerce’);
}
return $html;
}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add Price suffix with VAT toggle button’ is closed to new replies.