Home › Forums › WoodMart support forum › Product Carousel for tablet/phone landscape
Product Carousel for tablet/phone landscape
- This topic has 13 replies, 2 voices, and was last updated 6 years, 6 months ago by
Artem Temos.
-
AuthorPosts
-
August 13, 2018 at 2:41 am #72396
at22134ParticipantI noticed the following when I select carousel to show 8 products at a time:
Desktop shows 8
Phone/Tablet Landscape mode shows 8
Phone/Tablet Portrait mode shows 2Is it possible to make the carousel show 4 for Phone/Tablet Landscape mode. Things become too small otherwise.
Thanks for your help!! Much Appreciated!
August 13, 2018 at 6:10 am #72402
Artem TemosKeymasterHi,
Could you please send us a link to your website where we can see this issue?
Kind Regards
August 13, 2018 at 2:47 pm #72466
at22134ParticipantAugust 13, 2018 at 3:22 pm #72470
Artem TemosKeymasterPlease, provide us some screenshots for the better explanation too.
Thank you in advance.
August 13, 2018 at 3:32 pm #72471
at22134ParticipantThe issue that I have now is:
desktop – the carousel is using 8 products (correct)
iphone landscape – the carousel is also showing 8 products (should this be showing something like 4 products? Still showing 8 makes the products appear too small)
iphone portrait – carousel is showing 2 products (correct)Attachments:
You must be logged in to view attached files.August 13, 2018 at 3:34 pm #72475
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php
function woodmart_get_owl_items_numbers( $slides_per_view, $post_type = false ) { $items = array(); $items['desktop'] = ( $slides_per_view > 0 ) ? $slides_per_view : 1; $items['desktop_small'] = ( $items['desktop'] > 1 ) ? $items['desktop'] - 1 : 1; if ( $items['desktop'] == 6 ) $items['desktop_small'] = 4; $items['tablet'] = ( $items['desktop_small'] > 1 ) ? $items['desktop_small'] : 1; $items['mobile'] = ( $items['tablet'] > 2 ) ? $items['tablet'] - 2 : 1; if ( $items['tablet'] > 4 ) { $items['mobile'] = 4; } if ( $items['mobile'] > 2 ) { $items['mobile'] = 2; } if ( $post_type == 'product' ) { $items['mobile'] = woodmart_get_opt( 'products_columns_mobile' ); } return $items; }
August 13, 2018 at 3:40 pm #72476
at22134ParticipantI added the code to child theme functions.php but still no change
August 13, 2018 at 3:56 pm #72477
at22134ParticipantWhy do I get the feeling the file is not linking properly?
Attachments:
You must be logged in to view attached files.August 13, 2018 at 8:01 pm #72497
Artem TemosKeymasterSorry, try to replace with this
function woodmart_get_owl_items_numbers( $slides_per_view, $post_type = false ) { $items = array(); $items['desktop'] = ( $slides_per_view > 0 ) ? $slides_per_view : 1; $items['desktop_small'] = ( $items['desktop'] > 1 ) ? $items['desktop'] - 1 : 1; if ( $items['desktop'] == 6 ) $items['desktop_small'] = 4; $items['tablet'] = ( $items['desktop_small'] > 1 ) ? $items['desktop_small'] : 1; $items['mobile'] = ( $items['tablet'] > 2 ) ? $items['tablet'] - 2 : 1; if ( $items['tablet'] > 4 ) { $items['tablet'] = 4; } if ( $items['mobile'] > 2 ) { $items['mobile'] = 2; } if ( $post_type == 'product' ) { $items['mobile'] = woodmart_get_opt( 'products_columns_mobile' ); } return $items; }
If it will not help, send us your FTP access please.
August 13, 2018 at 9:08 pm #72511
at22134ParticipantThat last code works great. Thanks so much. Saved my life!
August 13, 2018 at 9:18 pm #72512
at22134ParticipantSorry, may I ask if it’s possible to also change the tablet number of products to show?
At the moment (on my ipad), I see that both landscape and portrait modes show 7 products in the carousel at any given time. Is it possible to reduce that to make the products appear abit larger?
Cheers~
August 14, 2018 at 6:12 am #72522
Artem TemosKeymasterTry to replace it with this code
function woodmart_get_owl_items_numbers( $slides_per_view, $post_type = false ) { $items = array(); $items['desktop'] = ( $slides_per_view > 0 ) ? $slides_per_view : 1; $items['desktop_small'] = ( $items['desktop'] > 1 ) ? $items['desktop'] - 1 : 1; if ( $items['desktop'] == 6 ) $items['desktop_small'] = 4; $items['tablet'] = ( $items['desktop_small'] > 1 ) ? $items['desktop_small'] : 1; $items['mobile'] = ( $items['tablet'] > 2 ) ? $items['tablet'] - 2 : 1; if ( $items['desktop_small'] > 5) { $items['desktop_small'] = 5; } if ( $items['tablet'] > 4 ) { $items['tablet'] = 4; } if ( $items['mobile'] > 2 ) { $items['mobile'] = 2; } if ( $post_type == 'product' ) { $items['mobile'] = woodmart_get_opt( 'products_columns_mobile' ); } return $items; }
August 14, 2018 at 6:38 am #72532
at22134ParticipantWorks great, thanks so much for your help!
August 14, 2018 at 6:57 am #72538
Artem TemosKeymasterGreat, you are welcome!
-
AuthorPosts
The topic ‘Product Carousel for tablet/phone landscape’ is closed to new replies.
- You must be logged in to create new topics. Login / Register