Reputation: 11
Does somebody know how to remove the price suffix only on the Woocommerce Shop (overview) page and keep it only visible at the product page.
Thanks! J.
Upvotes: 0
Views: 4983
Reputation: 11
Updated 2019 version of correct css code:
.woocommerce-price-suffix {
display: none;
}
.single-product .woocommerce-price-suffix {
display: block !important;
}
Use inline instead of block to show the suffix next to price.
Upvotes: 1
Reputation: 11
Got it fixed with this code:
.woocommerce-price-suffix {
display: none;
}
.single-product .product-price-wrap .woocommerce-price-suffix {
display: block !important;
}
Thanks guys!
Upvotes: 0
Reputation: 6080
You can hide it conditional with is_shop
condition and you can use woocommerce_get_price_html filter to hide it.
Try below code:
/**
* Filter to hide price on shop page.
* @author Rohil Mistry
*/
add_filter('woocommerce_get_price_html', 'hide_price_on_shop');
function hide_price_on_shop($price){
if(is_shop()){
$price = '';
}
return $price;
}
Let me know if you have any doubt.
Upvotes: 0
Reputation: 140
Might be more of a css hack but try this:
.woocommerce-price-suffix {
display: none;
}
Without an example im unsure if it will just remove it site wide
Upvotes: 1