Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daviddunnington/f0c4a246b21f455038d456696f03b3e8 to your computer and use it in GitHub Desktop.
Save daviddunnington/f0c4a246b21f455038d456696f03b3e8 to your computer and use it in GitHub Desktop.
Modify Woocommerce upsell sort order
function wc_custom_upsell_sorting() {
woocommerce_upsell_display( - 1, 4, 'menu_order', 'ASC' );
}
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'wc_custom_upsell_sorting', 15 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment