• How do I hide the tag “out of stock” on my WooCommerce products from the category page?

    I still want to track inventory but I don’t want the out of stock label to show up on the image when browsing the products.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello @miggyt,

    Please share the category page url so we can provide you custom css as per the need.

    Kind regards,

    Manoj

    Hello,

    Can you share your site link so that I can check it? Try to add the below code to the Customize > Custom CSS section and check it works or not –

    .archive .out-of-stock {
        display:none;
    }
    Thread Starter miggyt

    (@miggyt)

    Attached is a category page example

    No that code didn’t help.

    Also I prefer to add a code snippet rather than custom CSS

    Thank you for your help everyone

    Try to add the below code to the fucntions.php file of the child theme –

    remove_filter('ocean_woo_outofstock_text', __return_false());

    Thread Starter miggyt

    (@miggyt)

    Hi @apprimit

    Unfortunately that didn’t work.

    Can you try the below code?

    function prefix_out_of_stock() {
        echo '';
    }
    add_filter('ocean_woo_outofstock_text','prefix_out_of_stock');
    Thread Starter miggyt

    (@miggyt)

    Thank you so much for your help @apprimit .

    It did work! However there is now an ugly grey square in the upper left hand corner of the photo.

    Can you please link to the page where you have this issue so that I can check it?

    Thread Starter miggyt

    (@miggyt)

    Hi @apprimit

    Attached is an example.

    However, any category page would work. All out of stock items now successfully hide the tag “out of stock” on the preview, but they do have the grey square outline.

    I didn’t see any link. Can you please attach a link?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Hide “Out of Stock” Text Label’ is closed to new replies.