Error in product listings, setting infinite scroll and random elements

  • Posts: 127
  • Thank you received: 3
3 years 10 months ago #319920

-- url of the page with the problem -- : abierto.uy
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.3

Good Morning

I have a problem setting up a product listing. I would like all the products in the category to be displayed, displayed randomly and for the screen to have infinite scrolling active, so that more products are loaded as you navigate the page.

I configured both options, see attached screenshot, but it does not work, only the number of products configured in the grid (rows, columns) of the articles section of the configuration are shown.

The "infinite scroll" option only works if the "random elements" option is "no"

Is there a particular way to configure the options so that I can get the list I need?

Thanks greetings !

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 10 months ago #319924

Hi,

When you activate the random option, the randomness it calculated each time you display a page of the pagination.
If we allowed you to have random and infinite scroll working together, you would get random elements and scrolling down, you would get again more elements which would be also selected randomly among all the products of the listing, so you'll see some products several times and you won't see some products.
That's not good for your customers nor for your SEO which is why we disable the infinite scroll when the random option is activated.

If you really want to do it, you can change the line:
$infinite_scroll = !$enableCarousel && ((int)$this->params->get('infinite_scroll', 0) == 1) && ((int)$this->params->get('random', 0) == 0);
to:
$infinite_scroll = !$enableCarousel && ((int)$this->params->get('infinite_scroll', 0) == 1);
in the file product / listing_div.php via the menu Display>Views.

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

  • Posts: 127
  • Thank you received: 3
3 years 10 months ago #319941

Hello, thanks for the answer

I understand, with this information I will analyze a better solution for the listings

Thank you very much, greetings!

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

Time to create page: 0.057 seconds
Powered by Kunena Forum