Created
March 6, 2020 08:56
-
-
Save kreamweb/d0885696be8c346c68d2eaf1464363b2 to your computer and use it in GitHub Desktop.
**YITH WooCommerce Point of Sale** - Snippet to change the max number of products for search
This file contains 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
<?php | |
add_filter( 'woocommerce_rest_product_object_query', 'yith_pos_extend_post_per_pages', 5, 2 ); | |
function yith_pos_extend_post_per_pages( $args, $request ){ | |
if ( isset( $_GET[ 'queryName' ] ) && 'yith_pos_search' === $_GET[ 'queryName' ] ) { | |
$args[ 'posts_per_page' ] = 20; | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment