[Skip to main content](#vessel-content)

#   Carousel products display

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

7 years 1 month ago [\#311970](#311970) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[Carousel products display](/forum/4-how-to/898471-carousel-products-display#311970 "Hi,  We been trying to configure module to use carousel under product page.  This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.  As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....  I have looked into carousel.php and found that variable &quot;$products&quot; will return current visible products in:  so if i set 5 manually inside:  It looks fine...  So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...  I hope you understand the issue.  Thanks")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

We been trying to configure module to use carousel under product page.

This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.

As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....

I have looked into carousel.php and found that variable "$products" will return current visible products in:
Code:

$options['responsive'] = '{0:{items:2, slideBy:1}, 768:{items:3, slideBy:'.$slideByFor2.'}, 992:{items:'.$products.'}}';

so if i set 5 manually inside:
Code:

992:{items:'.$products.'}

It looks fine...

So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...

I hope you understand the issue.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5ODQ3MS1jYXJvdXNlbC1wcm9kdWN0cy1kaXNwbGF5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

7 years 1 month ago [\#311984](#311984) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Carousel products display](/forum/4-how-to/898471-carousel-products-display#311984 "Hi,  We been trying to configure module to use carousel under product page.  This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.  As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....  I have looked into carousel.php and found that variable &quot;$products&quot; will return current visible products in:  so if i set 5 manually inside:  It looks fine...  So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...  I hope you understand the issue.  Thanks")*

Hi,

This was made on purpose to avoid elements of the carousel to be duplicated to fit in the number of columns configured in the settings.
The issue was actually reported here more than 1 year ago:
[ www.hikashop.com/forum/5-support-en-fran...-content.html#284976](https://www.hikashop.com/forum/5-support-en-francais-french-support-/892975-affichage-categorie-parente-dans-module-content.html#284976)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5ODQ3MS1jYXJvdXNlbC1wcm9kdWN0cy1kaXNwbGF5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

7 years 1 month ago [\#311987](#311987) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Carousel products display](/forum/4-how-to/898471-carousel-products-display#311987 "Hi,  We been trying to configure module to use carousel under product page.  This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.  As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....  I have looked into carousel.php and found that variable &quot;$products&quot; will return current visible products in:  so if i set 5 manually inside:  It looks fine...  So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...  I hope you understand the issue.  Thanks")*

Hi,

Bad, i do not read French but anyway i had to use:
Code:

$items = $this-&gt;params-&gt;get('columns');

and change this:
Code:

if($products &gt; 1) {

to this:
Code:

if($products &gt; 0) {

And that fixed the issue.

It seems there should be extra check if less products are showing then selected in columns settings.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5ODQ3MS1jYXJvdXNlbC1wcm9kdWN0cy1kaXNwbGF5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

7 years 1 month ago [\#311988](#311988) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Carousel products display](/forum/4-how-to/898471-carousel-products-display#311988 "Hi,  We been trying to configure module to use carousel under product page.  This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.  As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....  I have looked into carousel.php and found that variable &quot;$products&quot; will return current visible products in:  so if i set 5 manually inside:  It looks fine...  So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...  I hope you understand the issue.  Thanks")*

Another thing. It would be great if there would be some params inside module configuration where you could define the responsive breakpoints and items to it. This would allow to have different look per module. Easy solution but very useful...

Right now it use same options defined in:
Code:

$options['responsive']

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5ODQ3MS1jYXJvdXNlbC1wcm9kdWN0cy1kaXNwbGF5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

7 years 1 month ago [\#311994](#311994) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Carousel products display](/forum/4-how-to/898471-carousel-products-display#311994 "Hi,  We been trying to configure module to use carousel under product page.  This module will display recently viewed products. Inside module config we set 2 rows and 5 columns. Total of products will be 10 and 5 visible as this is what i expect. It looks fine when you have 5 or more products showing in that module. However as this module is set to display only recently viewed items, the display of products until you reach 5 is wrong.  As example. If it shows only 1, it shows full width, i expect it show 1 with the width as it would be as 5, as set per configuration....  I have looked into carousel.php and found that variable &quot;$products&quot; will return current visible products in:  so if i set 5 manually inside:  It looks fine...  So shouldn't it return the column number u set in the configuration tab? As this is what it does if recently viewed settings are not used...  I hope you understand the issue.  Thanks")*

Hi,

Doing the modification you suggest didn't work on my end. Instead it duplicated the elements until the carousel had enough of them to display all the columns.
So I did some research and debug and found that this is an issue with the carousel library:
[ github.com/OwlCarousel2/OwlCarousel2/issues/2091](https://github.com/OwlCarousel2/OwlCarousel2/issues/2091)
So I've actually modified the code you were pointing at to: Code:

if($nb_products &lt; $this-&gt;params-&gt;get('columns')) { $options['loop'] = false; $columns = $this-&gt;params-&gt;get('columns'); $products = $this-&gt;params-&gt;get('item_by_slide'); } else { $columns = min($nb_products, $this-&gt;params-&gt;get('columns')); $products = min($nb_products, $this-&gt;params-&gt;get('item_by_slide')); }

That way, the loop is deactivated if there are not enough elements to make one slide, avoiding the duplication issue while still displaying the elements with the expected width.

Regarding the "responsive" option of the carousel library, changing this is too complex for a normal user. I believe it's best done as a view override for power users like you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5ODQ3MS1jYXJvdXNlbC1wcm9kdWN0cy1kaXNwbGF5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
