How magento 2 displayed only the in-stock upsell products in view page. How they handled and displayed
I wish to display upsell product collection in list page on each product. I got the upsell product collection using below code and I got the upsell product collection (But it got both in-stock and out of stock products). I need to display only instock upsell products. So Please Provide me a solution to get in-stock upsell products
but while getting collection itself ,how do i add stock status filter then wish to get the upsell collection.
I don't want foreach each item and check stock status