The following bit of code will change the number of related products that are displayed on a Woocommerce single product page. Add this to your functions.php file.


/* Woocommerce change the number of related products on the single product page*/
function woo_related_products_limit() {
global $product;
$args['posts_per_page'] = 3;
return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' );
function jk_related_products_args( $args ) {
$args['posts_per_page'] = 3; // 3 related products
$args['columns'] = 3; // arranged in 3 columns
return $args;
} 

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.