Assuming you are using storefront default homepage template. You can filter products before displaying on hompepage
function rfl_show_backorders( $is_visible, $id ) {
$product = new wC_Product( $id );
if ( ! $product->is_in_stock() && ! $product->backorders_allowed() && is_front_page() ) {
$is_visible = false;
}
return $is_visible;
}
add_filter( 'woocommerce_product_is_visible', 'rfl_show_backorders', 10, 2 );
Related Posts:
- How can I run a multi language WordPress site in two folders in one install? [closed]
- How to handle WordPress account for terminated employee
- Getting the gallery images from products in woocommerce?
- Get product details by url key in WordPress woocommerce
- Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?
- Which WooCommerce hook do I need to use to place the coupon field after the checkout sidebar
- Reverse engineering of WooCommerce Storefront filters
- WooCommerce Cart – Group Products By Category
- WooCommerce – update order item price and recalculate totals
- Categories not shown in admin after adding woocommerce products via wp wc cli
- Enabling autosave when plugin disabled
- WooCommerce email text based on category && shipping zone && payment method [closed]
- woocommerce – get_image_size() deprecated [closed]
- Woocommerce: How to remove page title from storefront theme homepage
- Remove checkout fields with Woocommerce depending on one of several shipping methods
- How to change a column width on WooCommerce orders page (Admin)
- WooCommerce Shop Orders by Date
- Show list of woo commerce orders where particular zip code exists using pre_get_posts?
- Woocommerce Shipping label just hangs
- adding a script with type=”module” to woocommerce admin area
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Featured image for product listings, but another image as the product image?
- How to add custom data to cart for a specific product which I have shown on a page programmatically and with a separate anchor adding it to cart?
- How to select from two different tables to display orders list with custom column from other table
- Woo Related Products How to override the plugin script?
- Woocommerce how to alter shipping tax before checkout
- Line break on Product details [closed]
- WooCommerce add class name in the list [closed]
- How to display Woocommerce variations prices and descriptions
- Adding Transaction-Specific Conversion Tracking from Adwords into WooCommerce
- New field on checkout is shown but it’s not saved on the order details [closed]
- How to rewrite product permalinks in Woocommerce to use category slugs
- How to re-arrange this hooked content?
- Woocommerce altered my homepage, and I can’t figure out how to revert it [closed]
- Woocommerce – Problem sorting and filtering products with different tax rates by price [closed]
- Why does my loop breaks the css below?
- How to add order status class to the body tag?
- Woocommerce – Change the template?
- Wooocommerce disable check_cart_item_stock if cart item has specific meta
- Force meta data on specific product type
- WooCommerce plaintext mail doesn’t display currency symbol
- WP/WooCommerce multisite with polylang, product duplication between websites [closed]
- WooCommerce add_to_cart
- Show password while you are typing it on the “my account” login page
- Functions.php change for Woocommerce not working
- Woocommerce replace product page image with product tabs [closed]
- /page/ is not working with a custom permalink structure (WooCommerce)
- WooCommerce Bookings Plugin Not Saving Order ID
- Woocommerce Register Error
- Where is this text in a wordpress email coming from? Want to change/remove
- Add starts rating in woocommerce product comment from backend
- Need to check if user has completed a woo commerce payment
- How to get all customers cart from woocommerce API?
- How to make a “subtitle” for each Woocommerce product
- Create Product with Woocommerce API, but Variations are not linked
- How to reduce checkout loading time of `?wc-ajax=checkout`
- unable to customize query to get filtered products by meta_key
- Woocommerce + Google Analytics (Conversion Rate Not Working)
- send order detail to swiftpos
- WordPress Woocommerce REST API JSON Error
- data-value for custom woocommerce field showing in code but not visable on page load
- Update user meta when customer update their first name
- Woocommerce posts and products links works only once and then get 404 error
- How can we find a WooCommerce shop bottleneck? (only when cart is full)
- Woocommerce pagination problem- page/2 = 404 solution
- Woocommerce , how to set billing_address via JS?
- Using admin email in billing address
- Overriding Plugin function in your child theme
- Files names changed (with strange characters) after being uploaded to cpanel
- woocommerce_add_to_cart custom function called several times
- How do you reactive related products on WooCommerce when it has been disabled?
- Display product variations in shop page
- How can I locate where the actions are defined? [duplicate]
- Shortcodes in billing fields doesn’t work
- Update a user meta key based on WooCommerce product purchase
- How to fix spacing in address tab in my account page
- Adding time of order to Admin email for new order
- show multiple product photos on WooCommerce single page
- Hide add to cart when product variation has no price or is unavailable
- How to get _POST variable on WooCommerce product page (form on homepage)
- How do I put woocommerce cart page to my checkout page? [closed]
- Search box missing Woocommerce Product Bundle Extension
- CSS url rules not relative to css path in account endpoint areas. IE. subscriptions
- How to Manage Multiple WordPress Websites from one dashboard (WooCommerce)
- Setting stock levels to “0” for all products in store using WP CLI
- Custom e-commerce display for specific users [closed]
- How to get the attributes based on dependency in woocommerce?
- Woocommerce composite and bundle products
- WooCommerce Review ID Block
- custom status in Woocommerce with database results
- Question about WooCommerce Subscription
- WooCommerce: Redirect to an item’s product page after item is removed from cart
- Blurry product card image – rendered is 486×452 vs 300×279 in real image. Smaller versions being autocreated and served using srcset
- how to show itemized shipping cost|? [closed]
- GET woocommerce order request is not showing meta data [closed]
- Add a custom meta column to a built-in import CSV file
- Hide/show button for the password field in the Woocommerce My Account page
- I need help with CPT for a food delivery business
- Woocommerce admin order email customize – remove product short description
- Which php files, in a WordPress setup, do not need direct web access?