Easy way to change number of items is to go to WordPress Settings > Reading and change option “Blog pages show at most”. If that does not work for you there are filters which can be used. You will need Competitions for WooCommerce v3.5 in order to get new filters needed for this code snippet. Then change variable $limit to number you want and put code snippet to your child theme functions.php file.
add_filter( 'woocommerce_competition_my_tickets_endpoint_post_ids_active', 'my_custom_woocommerce_competition_my_tickets_endpoint_post_ids_active' );
add_filter( 'woocommerce_competition_my_tickets_endpoint_post_ids_past', 'my_custom_woocommerce_competition_my_tickets_endpoint_post_ids_past' );
function my_custom_woocommerce_competition_my_tickets_endpoint_post_ids_active() {
$limit = 1;
$current_user_id = get_current_user_id();
$postids = competitions_for_woocommerce_get_user_competitions();
$posts_ids = array();
if ( count($postids)>0 ) {
$args = array(
'posts_per_page' => $limit,
'fields' => 'ids',
'post_type'=> 'product',
'post__in' => $postids,
'show_past_competitions' => false,
'tax_query' => array( array('taxonomy' => 'product_type' , 'field' => 'slug', 'terms' => 'competition') ),
);
$the_query = new WP_Query( $args );
$posts_ids = $the_query->posts;
}
$the_query = new WP_Query( $args );
$posts_ids = $the_query->posts;
return $posts_ids; // Always return the content, whether modified or not.
}
function my_custom_woocommerce_competition_my_tickets_endpoint_post_ids_past() {
$limit = 1;
$current_user_id = get_current_user_id();
$postids = competitions_for_woocommerce_get_user_competitions();
$posts_ids = array();
if ( count( $postids ) > 0 ) {
// Return past user's competition products.
$args = array(
'fields' => 'ids',
'post_type'=> 'product',
'post__in' => $postids,
'show_past_competitions' => true,
'meta_query' => array(
array(
'key' => '_competition_closed',
'operator' => 'EXISTS',
),
),
);
$the_query = new WP_Query( $args );
$posts_ids = $the_query->posts;
}
return $posts_ids; // Always return the content, whether modified or not.
}