Skip Navigation

[Resolved] A view can't display more than 10 elements

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 6 replies, has 2 voices.

Last updated by ralphG 2 months, 4 weeks ago.

Assigned support staff: Nigel.

Author
Posts
#1680511

I am trying to:
Display more than 10 products on the homepage with a view. I don't want to have pagination enabled.

Link to a page where the issue can be seen:
hidden link
Or look at the screenshot

I expected to see:
All products displayed.

Instead, I got:
Only 10 products displayed, and even if I click on the dot, others products are not displayed...

#1680651

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

What are your View settings?

Check that you haven't added a limit setting of 10 posts.

More likely is that pagination is enabled, though you may not have added any pagination controls to navigate through the pages of results.

If you are editing your View with the legacy editor go to the Screen Options tab at the top of the page and make sure that the pagination settings are checked; you'll then be able to scroll down and see and verify the pagination settings. Select no pagination if you want to display all results at once.

#1680857

Hi,
Please see on screenshot my settings for the view.

Same for Screen options tab, all boxes are checked.

#1682187

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I think I need to see the back-end of your site myself to be able to try and identify the problem.

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

#1682415

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

The problem appears to be with customisations you have made in the child theme.

I could see the issue on your site, even though there is nothing in the View to limit the results.

But I could see in the debug info (screenshot) that something is additionally filtering the View to only show products where product_visibility is "featured". The View itself is not adding that.

I deactivated all plugins except for Types, Views, and WooCommerce and then created a test page "Toolset" where just the View is inserted using a View block.

The output was still not correct.

So I switched theme to twentytwenty, which resolved the problem.

I then switched to the parent Astra theme, which also worked as expected.

Only after switching back to the child theme did the problem appear.

I can't debug your child theme for you, I'm afraid, because it introduces customisations, but that is where the problem lies.

I've left your test site in this state so that you can see for yourself if you visit hidden link with different themes activated.

#1682729

Hi, indeed,
here is the code in functions.php that we use to show only featured products in this view :

/* 
 * Add a filter to 'coups de coeur view' to only show featured products 
 */
add_filter( 'wpv_filter_query', 'featured_products',99,3 );
function featured_products( $query_args,$views_settings, $view_id) {
	if ($view_id == 6053){
	$query_args = array(
	  'post_type'  => 'product',
	  'tax_query' => array(
		array(
		  'taxonomy'     => 'product_visibility',
		  'field'   => 'name',
		  'terms' => 'featured',
		  'operator' => 'IN'
		),
	  ),
	);
	}
    return $query_args;
}

We opened a ticket a while back in your support forum to help us filter products that are displayed in this view.
This way all products marked as featured in woocommerce might appear in the view, but I don't know why the view only show 10 products...

#1682739

Hi, Thank you for your remark which pointed me in the right direction,
I share the code for people who might need it :

add_filter( 'wpv_filter_query', 'featured_products',99,3 );
function featured_products( $query_args,$views_settings, $view_id) {
	if ($view_id == 6053){
	$query_args = array(
	  'posts_per_page' => -1,  // add this to show all products without pagination
	  'post_type'  => 'product',
	  'tax_query' => array(
		array(
		  'taxonomy'     => 'product_visibility',
		  'field'   => 'name',
		  'terms' => 'featured',
		  'operator' => 'IN'
		),
	  ),
	);
	}
    return $query_args;
}

My issue is resolved now.