• Resolved xmflsct

    (@xmflsct)


    Hi,

    I have tried all the options described in other threads about columns, but none of them did help unfortunately.

    Before using this plugin, I add custom code in functions.php to have 6 columns in the related products:

    add_filter( 'woocommerce_output_related_products_args', function( $args )
    {
        $args = wp_parse_args( array( 'posts_per_page' => 50, 'columns' => 6 ), $args );
        return $args;
    }, 999);
    
    add_filter( 'woocommerce_product_related_posts_relate_by_tag', function() {
        return false;
    });

    After adding the plugin, this does not work anymore. Can you help me out? Thanks!

    • This topic was modified 7 years, 4 months ago by xmflsct.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vagelis

    (@eboxnet)

    Hello, thanks for using Woo Related Products.
    Use the function below to alter slider columns (you can alter the function per your needs ofc)

    function v_woo_related_slider() { 
      if (is_product()) {?>
    	<script>
    	jQuery(document).ready(function($) {
    	$("#woorelatedproducts").data('owlCarousel').destroy();
      	var owl = $("#woorelatedproducts");
    	  owl.owlCarousel({
    	      items : 4,
    	      itemsDesktop : [1000,3],
    	      itemsDesktopSmall : [900,3],
    	      itemsTablet: [600,2],
    	      autoPlay: 3500,
    	      itemsMobile : false,
    	  });
    	  });
    	</script> <?php 
    	}
    }
    add_action( 'wp_footer', 'v_woo_related_slider' );

    Next versions will include an option to set columns for Static display and slider.Until then use the above function.

    Thanks.

    Thread Starter xmflsct

    (@xmflsct)

    Thanks for your reply!!!

    It seems like the code is for the carousel which is not the mode I am using. I am using the default listing, and thus the default listing has 3 columns, but cannot figure a way to get it to 6 columns again..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Column issue (not solved with other threads)’ is closed to new replies.