Viewing 4 replies - 1 through 4 (of 4 total)
  • Saif

    (@babylon1999)

    Hello @zehgs,

    If I understand you correctly, you want to hide out-of-stock products but keep them on the product category pages.

    You can try the following CSS snippet.

    /* Hide Out-of-Stock but not in category page */
    
    body:not(.tax-product_cat) .outofstock {
       display: none !important;
    }

    To add this code in your CSS editor, please follow these steps:

    1. Go to Customize → Additional CSS.
    2. Copy the CSS code at the top, and paste it in the new line.
    3. Click the blue Save Changes button to save your changes.

    To know more about custom CSS, please visit our guide here: https://en.support.wordpress.com/custom-design/custom-css/

    Hope this helps!

    Thread Starter zehgs

    (@zehgs)

    Hi @babylon1999 !

    Thank you very much for the suggestion. Ideally I was looking for a PHP snippet because your solution doesn’t replace the out-of-stock products with in-stock ones. Is it possible?

    Thanks again!

    Howdy @zehgs

    Thank you for reaching back, elaborating further on this.

    Ideally I was looking for a PHP snippet because your solution doesn’t replace the out-of-stock products with in-stock ones. Is it possible?

    Kindly keep in mind we are not developers and only offer support for existing functionality.

    Please see our Support Policy: https://www.woocommerce.com/support-policy/

    For assistance with customization or development with your site, we recommend that you seek help from:

    If you are comfortable coding yourself and have questions, I would also recommend that you consider:

    I hope that helps you to figure it out.

    Feel free to get back to us if you have further questions.

    Thread Starter zehgs

    (@zehgs)

    Ok, thanks a lot for the help resources! Have a great week

    • This reply was modified 1 year, 9 months ago by zehgs.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Is it possible to hide out-of-stock products ONLY in galleries?’ is closed to new replies.