filter displays wrong number of products

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311618

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.3

Hi,

I have some issues with the display of the filters. I can't figure out where I go wrong...

This is the page with the filters: jouwnaambord.nl/naambordjes

I have 2 active filters. One is filtering on manufacturers and a second on a category. The forced menu is set to display 4 columns/2 rows. But when selecting f.e. aluminium, 3 rows are displayed. The first row shows only 2 products (there are 37 products in this category), and the second and thirdh row showing 4 (as it should). Why is this?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
4 years 5 months ago #311625

Hello,

Can you check in your Item Menu (with Id = 480), and more precisely in Products options tab, go in Data display part check that your option "Sub elements filter" isn't on "Grouped by category".
If, yes that's why your product are display like this, and so you have to select another option.

Regards

Last edit: 4 years 5 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311681

Hi Philip,

Thanks. I tried that before, but when I choose "all sub elements" this is what I get as result on page 2 of the filtered products (see screenshot)

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311701

Hi,

The number of columns and the number of rows you select define the total number of elements on a page.
This has to be fixed so that the MySQL query loading the product data from the database only loads the products necessary for the current page.
So when you select 4 columns and 2 rows, the system has to load 8 products on each page.
However, if you configure your listing to group the products by category, then on each page of the pagination, the products will be grouped by category. In that case, the products will still be displayed in the same number of columns.
And regarding the number of rows, it actually depends on the number of categories.
If each product on the current page is in a different category, then you'll end up with 8 rows as you'll have 8 groups of products.
That's how it is supposed to be.

So as Philippe said, if you don't want that, you don't want to group your products by category.

Now, regarding that issue with the "all sub elements" option, I'm not sure why you would have that. Turn on the error reporting and debug mode settings of the Joomla configuration and try again. You should then see an error message at the bottom of that page with more information as to why this is happening. Please provide the error message and we will be able to better understand the situation.

Please Log in or Create an account to join the conversation.

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311792

Hi,

In the error report of Joomla there's no errormessage. In Firebug I found this error in the consoletab (with all sub elements option):

Uncaught ReferenceError: List is not defined
at HTMLDocument.<anonymous> (naambordjes?limitstart=8&filter_Materiaal_13=245&tmpl=raw&filter=1:18)
at fire (797080ebb4af0a748489a87b1d8b20c3_0.js:189)
at Object.fireWith [as resolveWith] (797080ebb4af0a748489a87b1d8b20c3_0.js:195)
at Function.ready (797080ebb4af0a748489a87b1d8b20c3_0.js:202)
at HTMLDocument.completed (797080ebb4af0a748489a87b1d8b20c3_0.js:203)

When reset the sub elements filter to group the products by category the error is gone.

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311799

Hi,

We would need to directly look at the situation to be able to go further here.
Could you provide a backend / FTP access along with a link to this thread and instructions to reproduce the problem via our contact form so that we can look into it ?
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311826

Hi Nicolas,

I've sended the login data a week ago for item #311358 by contactform

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311830

Hi,

We didn't receive anything. Could you try to send it again ?
And make sure you provide both a backend and a FTP access, AND include a link to this thread so that we know why you're sending the access ?

Last edit: 4 years 5 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311886

Hi,

We got the accesses.
And I found the issue.
It comes from the view override of the file "listing_div" of the view "product" from your template.
It doesn't have the line:

<?php echo str_replace('&tmpl=raw','', $this->pagination->getListFooter($this->params->get('limit'))); ?>
and has instead the line:
<?php echo $this->pagination->getListFooter($this->params->get('limit')); ?>
We had to add that modification for the pagination to work properly after an AJAX filtering.
You should notify the issue to your template provider along with the patch so that they can add it to the template.

The following user(s) said Thank You: michelpouli

Please Log in or Create an account to join the conversation.

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311888

Hi Nicolas,

Thank you so much! That's really great, I will pass it on to the template developer.

Strangely enough, the issue also happened when I switched the pagetemplate to Protostar?

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 5 months ago #311891

Hi,

That patch was added as a hot fix to the 4.2.1. So maybe you installed a 4.2.1 from before the patch was in. Or youhave a view override of that view file in protostar for some reason ?

Please Log in or Create an account to join the conversation.

  • Posts: 503
  • Thank you received: 21
  • Hikashop Business
4 years 5 months ago #311986

No, there's no override, I will install the latest version. Thanks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum