Jeeyer
Jeeyer

Reputation: 11

Remove Price Suffix Woocommerce Shop page

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

Answers (4)

Peterthapanda
Peterthapanda

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

Jeeyer
Jeeyer

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

Rohil_PHPBeginner
Rohil_PHPBeginner

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

Aaron Davis
Aaron Davis

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

Related Questions