Enable carousel in the Category and Product list view

  • Posts: 69
  • Thank you received: 5
  • Hikamarket Multivendor Hikashop Business
1 month 2 weeks ago #322666

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.2.26


is it possible to enable the carousel view modality for the category and product list view?

Because I saw that there is a carousel file in the Hikashop files and that there is a Module for this, but me I need to enable it in the View Component if is possible.

I need this function because I want to see all the images uploaded of a category or of a product with the carousel effect.

If is not possible I try to add this function with the code

Thank you for your support

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

  • Posts: 70485
  • Thank you received: 10576
1 month 2 weeks ago #322670


There is no option to do that.
However, it's possible by editing the product / listing_div.php and category / listing_div.php view files via the menu Display>Views and changing a bit the code.
There, you'll find this line:

$enableCarousel = (int)$this->params->get('enable_carousel', 0) && $this->module;
This will activate the carousel if the "enable carousel" option of the menu item / module is activated and the listing is displayed by a module.
If you change it to :
$enableCarousel = true;
it will activate the carousel for all the listings.
But then, you need to set the different parameters manually.
For example, you'll need such line:
$this->params->set('item_by_slide', XX)
where XX is the number of items per slide of the carousel. So if the listing is set to display 20 items per page of the pagination, then you want that XX number to be smaller than 20. For example 4, so that it displays 4 items per slide of the carousel.
You can check the different parameters necessary in product / carousel.php

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

Time to create page: 0.049 seconds
Powered by Kunena Forum