Created
May 6, 2016 10:05
-
-
Save mikejolley/7a36bfdc40cc210e684d5827907c2ae7 to your computer and use it in GitHub Desktop.
WooCommerce - Change number of displayed upsells on product pages
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
add_filter( 'woocommerce_upsell_display_args', 'custom_woocommerce_upsell_display_args' ); | |
function custom_woocommerce_upsell_display_args( $args ) { | |
$args['posts_per_page'] = 5; // Change this number | |
$args['columns'] = 5; // This is the number shown per row. | |
return $args; | |
} |
Does this work with the most recent release of Woocom?
This worked for me on Woo 3.4.5. Thanks Mike!
Mike, I'm trying to change the Cross Sell display. I can't hook it and I can't find anything anywhere that can make this happen.
I've tried yours above by changing the filter to cross_sells and I've tried
`
add_filter( 'woocommerce_cross_sells_total', 'shopkeeper_change_cross_sells_product_no' );
function shopkeeper_change_cross_sells_product_no( $columns ) {
return 6;
}
`
Nothing has worked. What am I missing? Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this work with the most recent release of Woocom?