Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #792228

    Hi,

    I found this code for increasing columns of related products:

    function avia_chance_wc_related_columns(){
    global $avia_config;
    $avia_config['shop_single_column'] 	 	 = 4;			// columns for related products and upsells
    $avia_config['shop_single_column_items'] = 4;	// number of items for related products and upsells
    }
    add_action('wp_head', 'avia_chance_wc_related_columns', 10);

    Is there a similar code to increase the cross-sells columns in the cart?

    Thanks in advance

    #792485

    Hey westefan,

    Can you show me the page please so I can check which section it is and if it is controlled from WooCommerce or our framework?
    Thank you

    Best regards,
    Basilis

    #792667

    Hey Basilis,

    no worry placing products in the cart – the shop is in test mode

    Thanks, westefan

    #792901

    Hi westefan,

    Here is the code you can put in your funtions.php

    
    remove_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count');
    remove_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count');
    
    
    add_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count_mod');
    add_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count_mod');
    
    function avia_woocommerce_cross_sale_count_mod($count)
    {
    	return 5;
    }
    

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #792905

    Many thanks for your effort, Victoria – but the code doesn’t work.
    Any idea?
    Best regards, Stefan

    #792930

    Hi Stefan,

    Try adjusting the code like this:

    
    remove_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count', 10);
    remove_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count', 10);
    
    
    add_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count_mod', 21);
    add_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count_mod', 21);
    
    function avia_woocommerce_cross_sale_count_mod($count)
    {
    	return 5;
    }
    

    Best regards,
    Victoria

    #792936

    That works, Victoria, many thanks!

    Now 5 products are shown in 2 rows. Is it possible to adust the width of the single cross sells product, so that all 5 are in 1 row?

    Best regards, Stefan

    #792962

    Hi Stefan,

    Here is the css for that:

    
    div .products .product {
        width: 18.6%;
    }
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #792992

    Now it’s perfect, Victoria!
    Many thanks and have a wonderful day,
    Stefan

    #792995

    Hi,
    Glad Victoria was able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Increase columns for cross-sells products’ is closed to new replies.