WooCommerce offers several default sorting options for products, including:
- Sort by popularity
- Sort by average rating
- Sort by latest
- Sort by price: low to high
- Sort by price: high to low
However, a more user-friendly approach is to prioritize in-stock and/or featured products. This guide will walk you through enabling these features using FiboFilters.
Note:
Both features can function simultaneously.
Table of Contents
Show in-stock products first
FiboFilters provides a built-in feature to prioritize in-stock products and push out-of-stock items to the end of the list. By default, this feature is disabled, but you can enable it by adding the following PHP snippet to your website:
add_filter( 'fibofilters/request/base_product_ids/order_by_stock_status', '__return_true' );
ⓘLearn how to add this snippet to your WordPress.
Once enabled, in-stock products will appear first, followed by out-of-stock items, as shown in the example below:
Show featured products first
To prioritize featured products, add the following code to your website:
add_filter( 'fibofilters/request/product_order/featured_first', '__return_true' );
ⓘLearn how to add this snippet to your WordPress.
After adding this snippet, featured products will be displayed at the top of the product list, providing better visibility for special items:
By implementing these features, you can improve the shopping experience by presenting products in a more intuitive and customer-friendly order.