Support » Plugin: WooCommerce Grid / List toggle » List on Desktop, Grid on Mobile

  • awideman (@awideman) was on this list asking about how to accomplish this. Others too but no answer was given.
    Change your option in Customiser to ‘List’ and then add the following to functions.php:

    add_action( 'woocommerce_after_shop_loop', 'kvf_shop_loop_list_init' );
    
    function kvf_shop_loop_list_init() {
    	if ( wp_is_mobile () ) {
        ?>
    	
    <script type="text/javascript">
        jQuery( "ul.products" ).addClass( jQuery.cookie( "gridcookie" ) || "grid" );
    </script>
    
    <?php
    	}
    }

    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sorry, this didn’t work! I’ll post if I find a solution.

    Thanks for taking the time to follow up on this issue and post this kaicho! I tried the code too and it didn’t work. Let me know if you have any luck – it would be a massive improvement to my site!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.