Sorting products in WooCommerce is easy and can be done in a few clicks. By default, WooCommerce sorts products alphabetically, but you can easily change that by going to the Products tab in the WordPress admin sidebar and clicking on the Sort link. From there, you can choose to sort products by price, date, title, or popularity.
If you want to custom sort your products, then you’ll need to use the [products] shortcode.
This shortcode has a number of attributes that you can use to customize how products are displayed on your WooCommerce store. One of those attributes is ‘orderby’, which allows you to specify how products should be sorted.
The ‘orderby’ attribute takes a few different values:
- date: Sorts products by their published date.
- price: Sorts products by their price (ascending or descending).
- rand: Randomly sorts products.
- title: Sorts products alphabetically by their title.
So, if you want to custom sort your products by price, then you would use the following shortcode:
[products orderby=”price”]You can also specify whether you want products sorted in ascending or descending order. To do that, you would use the ‘order’ attribute like this:
Conclusion: How Do I Custom Sort a Product in WooCommerce?
Sorting products in WooCommerce is easy and can be done in a few clicks. If you want to custom sort your product, then use the [products] shortcode with the ‘orderby’ attribute.