4

With CSS I am basically hidding quatity fields in WooCommerce using display:none. But it removes quantity fields on Cart and Wishlist pages as well.

How can I only target single product pages?

I can do it by page ID as well but I have 100's of products and it's just not a practical way to do it.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Garry
  • 63
  • 1
  • 5

1 Answers1

3

To target Woocommerce Single product page just use the <body> class single-product.

Like for example to hide quantity fields (only on single product pages):

.single-product .quantity {
    display:none;
}
LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399