Last active
October 30, 2023 07:48
-
-
Save SirDarcanos/8b9deaf4587f83724588a54c27db8a34 to your computer and use it in GitHub Desktop.
Reordering Cross-Sells and Up-Sells in WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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'; } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment