Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
  • #21717


    I want to display 3 or 4 columns in up-sells products!prettyPhoto

    so the 5 products just after Sundried Tomato Cream

    And I don’t see where I can set the number of products to display in the following…

    I got 4 at max?





    Please open up /config-woocommerce/config.php located in the theme folder and first look for lines 58-59 that look like

    $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

    first 4 is number of items per line, second 4 is total number of items. . So if you put 5 and 10 respectively , you would have 5 items, with additional 5 loading via ajax (page doesn’t reload).


    i do dimly remember this functionality had some issues in the past, and if that is still the case, (after you make above changes, nothing happens)…..

    ….then find line 819 in the same file that looks like


    and change it to look like:

    woocommerce_related_products(5, 5); which would give 5 products shown per line with a total of 5 products shown.




    Sorry it doesn’t work…

    I set this

    $avia_config = 4; // columns for related products and upsells

    $avia_config = 20; // number of items for related products and upsells


    woocommerce_related_products(20, 4); // X products, X columns

    I should have 20 products on the page, and I got 11…


    on some others pages I got only 7, and I should have 20 also…


    Hi clamant75,

    As far as I know there is no way to say exactly how many related products a given product will have. IE, you can’t know for certain how many products will show as related since they can’t be specified through any woocommerce option.

    So although you may say you have 20 other products “related” woocommerce doesn’t see it that way and so it only shows those products as being related.

    If you want to do Upsells, where you have specific control of the products shown you can set that up on the individual product.





    Hi Devin,

    there’s still 2 problems:

    1 > the grid of the linked products (up-sells products)

    I’ve applied your code but I got only 2 columns to display that products instead of 4…

    On woocommerce doc, they say same thing than you but to apply in functions.php file:

    // Redefine woocommerce_output_related_products()

    function woocommerce_output_related_products() {

    woocommerce_related_products(20,4); // Display 20 products in rows of 4


    2 > the number of products displayed in total…

    I’ve applied all categories and all tags to each product

    It’s a bit strange not to see them all appearing below the linked products?

    One I got 1 product, once I got 5…

    Nothing changes, and I don’t see the logic??


    I want to precise that to display the page without sidebar

    I’ve applied a dynamic template to the page,

    and link the shop base page to a false page (Blog) in woo commerce settings…

    But I checked what it would be if I were applying the good page (Boutique)

    and it doesn’t resolve anything…


    There is really nothing that *we* can do about the related products. Its a function of the plugin and you would need to post on the WooCommerce forums for an issue with its logic.

    As for the layout, the default layout seems to have been broken at some point in your customizations. The WooCommerce pages are unable to have dynamic templates applied to them so any layout changes need to be done with code to the config.php file in the woocommerce-config folder.


    Hi Devin,

    ok I’m gonna contact Wootheme

    but concerning “…the default layout seems to have been broken at some point in your customizations…”

    I don’t consider that cause I made a copy of the site and restore your theme by default…and the layout is the same


    In your config-woocommerce>config.php file, look for:

    woocommerce_upsell_display(); // products and columns are inherited from related products

    and change it to:

    woocommerce_upsell_display($avia_config['shop_single_column_items'],$avia_config['shop_single_column']); // products and columns are inherited from related products

    That should force the upsells to have the same layout.





    Thanks Devin, it works fine for the up-sells products…

    Concerning the related products, I posted on woocommerce wordpress forum but no response till now…

    So I’m waiting




    Let us know what they say. I tried to find some additional docs on it but all it says is that it should be automatic and if you want manual control to use Up-Sells/Cross sell. I very well could be misunderstanding it so hopefully they will have something for you (and us :] )





    that’s the response:

    “Your best bet would be to unhook the related products function and then hook in your own products loop.

    Take a look in woocommerce-hooks.php to see where the related products are hooked in.”

    But of course I don’t know how to manage that… ;-(


    If you really need that specifically, I’d recommend as a quick freelance source (I often freelance there).



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

The topic ‘Displaying more columns in up-sells products and more items?’ is closed to new replies.