• dutt

    (@rajat-dutt)


    Dear team
    if you see on this product page
    [ redundant link removed ]
    at bottom of page in you may also like section products images are very big.
    however same case is for related products aswell but i apply this code to improve related product section.
    code is

    /**
     * @snippet       WooCommerce Change Number of Related Products
     */
     
    add_filter( 'woocommerce_output_related_products_args', 'bbloomer_change_number_related_products', 9999 );
     
    function bbloomer_change_number_related_products( $args ) {
     $args['posts_per_page'] = 6; // # of related products
     $args['columns'] = 6; // # of columns per row
     return $args;
    } 

    however i dont know how can i apply same rulefor you may also like products.
    requested you to help mein this case

    • This topic was modified 4 years, 7 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • To change the number of columns for the “You may also like” section, you can use this code:

    /**
     * Change number of upsells output
     */
    add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 );
    
    function wc_change_number_related_products( $args ) {
     $args['columns'] = 4; //change number of upsells here
     return $args;
    }
    Thread Starter dutt

    (@rajat-dutt)

    thanks it worked for me
    i add more rule in it

    /**
     * Change number of upsells output
     */
    add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 );
    
    function wc_change_number_related_products( $args ) {
     $args['posts_per_page'] = 6; // # of upsell here
     $args['columns'] = 6; //change number of upsells here
     return $args;
    }

    hope it works for others
    thanks again for your help
    good day

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘You may also like product Page section’ is closed to new replies.