Home › Forums › WoodMart support forum › Product categories carousel – mobile view
Product categories carousel – mobile view
- This topic has 3 replies, 3 voices, and was last updated 3 years, 5 months ago by Eric Watson.
-
AuthorPosts
-
May 21, 2021 at 4:48 pm #294477
ahmad2020ParticipantHi,
I need to display the “Product categories carousel” with more than 2 columns in mobile view.
Before I write this, I searched for the issue as many are facing, the only working solution I found is to use this code:add_filter('woodmart_categories_shortcode_custom_sizes', function() { return array( 'desktop' => 8, 'tablet_landscape' => 4, 'tablet' => 4, 'mobile' => 4, ); } );
Currently, the way to do it is changing the products as well, which is not the way I need it to be. (I only need to change the “Product categories”)
your support is appreciated.
thanks.May 22, 2021 at 4:51 pm #294686
Elise NoromitMemberHello,
Please provide your site admin access and page URL where you have the influence of this code on the product grid. I have tested at my side and it changes the product categories only.
Best Regards
June 4, 2021 at 11:05 am #297569
ahmad2020ParticipantThanks for your reply,
Now there are two issues:
(1)
I checked the code for which the code snippet given above should run,
in the file path:
/wp-content/themes/woodmart/inc/functions.php
Your function for
// Woodmart Get Owl Items Numbers$items['desktop'] = ( $slides_per_view > 0 ) ? $slides_per_view : 1; $items['tablet_landscape'] = $items['desktop']; if ( $items['desktop'] >= 5 ) { $items['tablet_landscape'] = 4; } $items['tablet'] = ( $items['tablet_landscape'] > 1 ) ? $items['tablet_landscape'] - 1 : $items['tablet_landscape']; $items['mobile'] = ( $items['desktop'] > 4 ) ? 2 : 1; if ( $post_type == 'product' ) { $items['mobile'] = woodmart_get_opt( 'products_columns_mobile' ); } if ( $items['desktop'] == 1 ) { $items['mobile'] = 1; }
is checking for the post type if it was a product as follows:
if ( $post_type == 'product' ) { $items['mobile'] = woodmart_get_opt( 'products_columns_mobile' ); }
this however is not getting executed in the best selling products carousel (see the attached image).
I only need to change the product category carousel which is called in your theme’s element:
https://prnt.sc/13zziddand not the following:
https://prnt.sc/13zzpzj(2)
When adding this code in functions.php:add_filter('woodmart_categories_shortcode_custom_sizes', function() { return array( 'desktop' => 8, 'tablet_landscape' => 6, 'tablet' => 4, 'mobile' => 4, ); } );
it causes the home page to get stuck with one column per line (one product category instead of the desired 4) then when scrolling down it responds.
I think there is a delay issue with the rendering ..please help thanks.
Attachments:
You must be logged in to view attached files.June 6, 2021 at 10:33 am #297918
Eric WatsonParticipantHello,
In this situation are you able to provide us your FTP access so we could troubleshoot it and provide you with a solution?
Regards
-
AuthorPosts
Tagged: carousel, product categories
- You must be logged in to create new topics. Login / Register