MainWP Community

Reordering Cross-Sells and Up-Sells in WooCommerce

Reordering cross-sells and up-sells if using WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

// Up-sells sorting
add_filter( 'woocommerce_upsells_orderby', function() { return 'date'; } );
add_filter( 'woocommerce_upsells_order', function() { return 'desc'; } );

// Cross-sells sorting
add_filter( 'woocommerce_cross_sells_orderby', function() { return 'date'; } );
add_filter( 'woocommerce_cross_sells_order', function() { return 'desc'; } );
1 Like