Limit Comparison Set Results

If you would like to limit the number of results displayed in your Comparison Sets to the first X number of products, here's some code you can add to your Custom Plugin.

add_filter( 'dfrcs_filter_products', function ( array $filtered_products, array $all_products ) {
   $max_products = 3;

   return array_slice( $filtered_products, 0, $max_products );
}, 10, 2 );

You can change $max_products = 3; to whatever you would like. If you only want to display a maximum of 5 products, change 3 to 5.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us