Skip to content

Instantly share code, notes, and snippets.

@8lane
Created March 31, 2014 10:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8lane/9889715 to your computer and use it in GitHub Desktop.
Save 8lane/9889715 to your computer and use it in GitHub Desktop.
Limit number of cross sells items on cart page in WooCommerce
add_filter('woocommerce_cross_sells_total', 'cartCrossSellTotal');
function cartCrossSellTotal($total) {
$total = '3';
return $total;
}
@de-b
Copy link

de-b commented Jan 2, 2019

If need to change column:

add_filter( 'woocommerce_cross_sells_columns', 'change_cross_sells_columns' );
function change_cross_sells_columns( $columns ) {
    return 3;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment