WooCommerce Shop: Display Only Products On Sale

WooCommerce Shop: Display Only Products On Sale

Looking to enhance your WooCommerce shop by showcasing only products on sale? While WooCommerce doesn’t include a built-in feature for this, a simple PHP snippet can make it possible. This guide walks you through adding a “Sort by On Sale” option to your shop’s dropdown menu or directly filtering sale items using a custom URL parameter.

Key Steps:

  1. Add a Custom Sorting Option: Use the provided PHP snippet to add a “Sort by On Sale” filter to your WooCommerce Shop page dropdown.
  2. Enable Direct URLs for Sale Items: Apply the orderby=on_sale parameter to your Shop page URL (e.g., https://example.com/shop/?orderby=on_sale) to send customers directly to a page featuring sale items.
  3. How the Code Works: The snippet modifies WooCommerce’s catalog query to filter products by their sale price and labels this sorting option for easy customer access.

This feature is perfect for events like Black Friday or other seasonal sales, helping you highlight deals and drive conversions. For more details and to access the full PHP code, visit the original article at www.businessbloomer.com

Tags:

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest