Created
August 22, 2024 21:36
-
-
Save emre-edu-tech/4762e3e27c5858c28aee45601bfd3868 to your computer and use it in GitHub Desktop.
Woocommerce - Show price suffix just on single product template but not on RELATED PRODUCTS section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Show price suffix just on single product template but not on related products section | |
add_filter( 'woocommerce_get_price_html', 'custom_price_suffix', 10, 2 ); | |
function custom_price_suffix( $price, $product ) { | |
global $woocommerce_loop; | |
if(is_product() && ($woocommerce_loop['name'] != 'related')) { | |
$price = $price . ' <span class="leoshop-price-suffix"> Preis inkl. MwSt. & exkl. Versand</span>'; | |
} | |
return $price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment