Skip to content
Advertisement

Remove read more button for out of stock item

Ive been strugling with removing a “read more” or “beri dalje” button from my website. The website in question is www.fotroviciliji.si .

I can locate it and hide it in chrome investigator but not via global css or using php in functions.php.

The button has a class name btn border-grey product_type_simple. I tried to hide it via global css code. Display none does nothing, visibility hidden hides all the buttons including add to cart which I want to keep.

Then I tried to hide it with a php snippet from woocommerce: https://docs.woocommerce.com/document/hide-loop-read-more-buttons-for-out-of-stock-items/ which actually hid all the correct buttons but messed up the add to cart function which then reloaded the whole page everytime I added something to cart. I added some unrelated code to functions.php.

I also tried this Remove product button if out of stock from Woocommerce shop and archives and it removes all the buttons including add to cart.

Please help Ive been at this for a couple of days and its driving me mad.

Advertisement

Answer

add this CSS

.outofstock a.btn {
    display: none !important;
}

This CSS was only remove read more who is out of stock product.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement