Home Forums WoodMart support forum Product categories carousel – mobile view

Product categories carousel – mobile view

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #294477

    ahmad2020
    Participant

    Hi,
    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.

    #294686

    Hello,

    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

    #297569

    ahmad2020
    Participant

    Thanks 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/13zzidd

    and 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.
    #297918

    Eric Watson
    Participant

    Hello,

    In this situation are you able to provide us your FTP access so we could troubleshoot it and provide you with a solution?

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)