• Hris

    (@hhristozov)


    Hello,

    I would like to remove out-of-stock products from my Upsell section on the single product page.

    Optimally, if I have 6 products added in the Upsell product section and 2 of them are out of stock, I would like to show only the 4 products that are in stock.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @hhristozov,

    It’s related to WooCommerce. Please enable the “Out of stock visibility” option on the “WooCommerce settings > Products > Inventory” path.

    Best Regards

    • This reply was modified 3 years, 1 month ago by Shahin.
    Thread Starter Hris

    (@hhristozov)

    @skalanter

    Thank you for the answer, but unfortunately this does not really help me. Since this option will also hide the products from category/archive pages.

    Since this products will be back in stock again, I do not want to hide them from category page. ( I also have the possibility to preorder them).

    I am looking for a solution to remove them from Upsell section and once again if I have 6 products in the upsell but 2 are out of stock to show only 4 products.

    Abhishek

    (@abhikr781)

    Hello,

    ?Please try to add the below CSS code from the Appearance > Customize > Custom CSS, and check.

    .single-product.woocommerce .upsells.products .outofstock {
        display: none;
    }

    Following the post will help you more with it.

    https://www.ads-software.com/support/topic/how-hide-out-of-stock-products-in-cross-sell-products/

    Thread Starter Hris

    (@hhristozov)

    Hello,

    I have added the CSS and it works, but there is one issue. I want to always show 4 products in the upsell section. For my test product I have added around 8 products in the upsell, however, randomly it will sometimes show 3 as one of them is out of stock.

    Is there a way that it will always show the 4 products and not consider out of stock products, because right now when it shows out of stock product we just hide it with the CSS and it is blank white.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Removing out of stock products from Up Sell’ is closed to new replies.