How to Sort WooCommerce Products

Modifying WooCommerce product sorting can make popular or high-margin products more eye-catching, which is very helpful for boosting sales and conversions. It also allows better management of ads and inventory. Want to know how to modify WooCommerce product sorting? In this article, we will introduce three simple and practical methods for you to master!

图片[1]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

1、Manually adjust the product sorting

Manually adjusting the product sorting gives you more precise control over the order in which products are displayed on the WooCommerce store page. However, this method is relatively time-consuming to set up, so it's not suitable for standalone shopping centers with a large number of products. If you want to manually adjust the product sorting, just select "Products" > "All Products" on the left menu bar of WordPress, and then click "Sort", then you can You can easily drag the products to adjust their display order.

图片[2]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

You can also manually set the priority order of the products through the "Advanced" option on the WooCommerce product page.

图片[3]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

2、Modify the default product sorting

This method is very simple. Simply log in to your WordPress backend, then find "Appearance" > "Customize" on the left menu bar, click on it, and then follow the order of "WooCommerce" > "Product Catalog". > "Product Catalog" and you can start to adjust the product sorting.

图片[4]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

Then find the default product sorting option and select the new default sorting method in the drop down menu, there are 5 types, by popularity, rating, posting time, price from low to high and high to low.

图片[5]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

Once selected, click the Publish button and WooCommerce will sort all the products with the new sorting method.

3, PHP code product sorting

If you're not quite satisfied with the default product sorting options, you can also create your own by adding code to the functions.php file. However, before doing so, remember to create a child theme or use the code snippet plugin so that you can make sure your site won't be affected.

First of all, you need to install and enable the "Code Snippets" plugin on your WordPress site, so that it is more convenient for you to follow.

图片[6]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

Then go to WordPress left menu bar > Snippets and click Add New to add the code.

图片[7]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

Next, copy and paste the code into the text box, save the changes, and you'll be able to generate new product sorting options.

图片[8]-如何调整WooCommerce产品排序-光子波动网 | WordPress教程、Elementor教程与故障修复

Sort products by product category:

add_filter('woocommerce_default_catalog_orderby', 'quadlayers_catalog_orderby_for_category');

function quadlayers_catalog_orderby_for_category( $sort_by ) {
if( !is_product_category('uncategorized') ) {
return $sort_by; // modify uncategorized category archive sorting
}
return 'date'; }
}

Sort products alphabetically:

function quadlayers_alphabetical_shop_ordering( $sort_args ) {
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
if ( 'alphabetical' == $orderby_value ) {
$sort_args['orderby'] = 'title';
$sort_args['order'] = 'asc';
$sort_args['meta_key'] = '';
}
return $sort_args;
}
add_filter( 'woocommerce_get_catalog_ordering_args', 'quadlayers_alphabetical_shop_ordering'

summarize

By modifying WooCommerce product sorting, merchants can flexibly adjust the display position of popular or high-margin products on the store page, so as to effectively improve product sales and conversion rate. The article introduces three simple and practical methods to help merchants easily master product sorting techniques. Whether it is manually adjusting, modifying the default sorting or using PHP code sorting, merchants can choose the appropriate method according to their needs to optimize the product display and improve sales results.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Harry
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments