• Resolved kristinubute

    (@kristinubute)


    Hi

    I am only seeing 3 product columns in my Related Products instead of 4.
    The rest of my store is 4 columns of products.

    I have found this coding but didn’t work for some reason.
    https://docs.woocommerce.com/document/change-number-of-related-products-output/

    I also want them to SHOW in the Related Products similar products (not different) ones on this area … Mine are not showing the same type of Category in the Related Products which I would assume it would pickup from the same Category

    How do I fix this ?

    In the Woocommerce document, it says “These products cannot be specified in the admin, but can be influenced by grouping similar products in the same category or by using the same tags.”

    So why do mine not show up other categories from the same Category ?

    Thx
    Kristin

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter kristinubute

    (@kristinubute)

    Eg If I’ve click on a product in the Product Brand “Covergirl” then the Related Products in my opinion should show other Products in the “covergirl” Category Brand.

    It shouldn’t show another Brand in there completely as it is not the same grouping

    It is not for some reason.

    Thx
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    My theme is Storefront

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    What is your site URL?

    Thread Starter kristinubute

    (@kristinubute)

    Hi, site it not yet live, nearly live.

    Kristin

    Plugin Support Yuki K a11n.

    (@yukikatayama)

    Automattic Happiness Engineer

    For the snippet to change the number of columns, could you please paste here what you used? Did you change the numbers that are in the example to fit your use case?

    As for the same categories not showing in the Related Products section, typically this is by categories. You mentioned Brands a few times – do you mean that you are using another plugin for brands (i.e. https://woocommerce.com/products/brands/) or one of the categories is Brands, and products under Brands category does not show in Related Products?

    Thread Starter kristinubute

    (@kristinubute)

    Hi, sorry clarification. My customer has Brands Category and 30 Brand names under that category.

    Therefore when a client clicks on say Maybelline Brand name and clicks on an actual product to view more details about it on the single page, then underneath you have the Related Products. How does the Related Products work ?

    Does it pick Related Products from that Top Category called Brands ?

    ****

    The Snipped in functions.php for the Shop columns for entire Woocommerce site:

    /*adjustment for 4 shop columns*/
    add_filter( ‘storefront_loop_columns’, function() { return 4; } ); //change shop colunns//

    Not sure HOW to change the Related products to 4 Products showing as it is only showing 3.

    This was the SNIPPED I used in functions.php changed to 4 related products is all I want (not 3) and 4 columns

    add_filter( ‘woocommerce_output_related_products_args’, ‘jk_related_products_args’ );
    function jk_related_products_args( $args ) {
    $args[‘posts_per_page’] = 4; // 4 related products
    $args[‘columns’] = 4; // arranged in 4 columns
    return $args;
    }

    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Hi there!

    This explains how related products are chosen:

    https://docs.woocommerce.com/document/related-products-up-sells-and-cross-sells/#section-3

    For the number of columns, you don’t need that first snippet. Instead in the Customizer under Appearance > Customize, in the WooCommerce > Product Catalog section, you can choose the number of products and rows displayed. Just set that to four there.

    For the number of related products that snippet is missing the first part as shown here:

    https://docs.woocommerce.com/document/change-number-of-related-products-output/

    Hope that helps!

    Thread Starter kristinubute

    (@kristinubute)

    Hi

    Sorry

    Are you referring to the Theme Customiser firstly ? As I have no Appearance/Customise in there.

    Then I look under Woocommerce/ Settings / Products and can’t find it either.

    Please clarify.

    Thx
    Kristin

    Plugin Support Yuki K a11n.

    (@yukikatayama)

    Automattic Happiness Engineer

    Hi,

    Customizer can be accessed here, as shown in screenshot links:

    https://cld.wthms.co/35uUxH

    https://cld.wthms.co/skJMce

    Thread Starter kristinubute

    (@kristinubute)

    Hi, That doesn’t come up on my screen under the Storefront child theme in Customiser.

    Is it because I haven’t updated to the latest version or that shouldn’t matter.

    Thanks
    Krsitin

    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Yes, that only appears in WooCommerce 3.3.3 or above. You’ll need to be on that or preferably the latest 3.3.5 to see that option.

    All the best!

    Thread Starter kristinubute

    (@kristinubute)

    HI

    I have a number of formatting issues when I try to upgrade to Woocommerce 3.3.3 therefore I have left it on the safe stable version for now with the amount of plugins I have on this client site.

    I will be upgrading it later.

    So back to my issue I Had added in the coding in functions.php

    add_filter( ‘woocommerce_output_related_products_args’, ‘jk_related_products_args’ );
    function jk_related_products_args( $args ) {
    $args[‘posts_per_page’] = 4; // 4 related products
    $args[‘columns’] = 4; // arranged in 2 columns
    return $args;
    }

    It still only shows 3 columns on the Single Products Page “Related Products” area.

    Thx
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    add_filter( ‘woocommerce_output_related_products_args’, ‘jk_related_products_args’ );
    function jk_related_products_args( $args ) {
    $args[‘posts_per_page’] = 4; // 4 related products
    $args[‘columns’] = 4; // arranged in 4 columns
    return $args;
    }

    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Hi Kristin!

    It looks like you’re missing the global at the start. I’ve tested this and it definitely works:

    function woo_related_products_limit() {
      global $product;
    	
    	$args['posts_per_page'] = 6;
    	return $args;
    }
    
    add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' );
      function jk_related_products_args( $args ) {
    	$args['posts_per_page'] = 4; // 4 related products
    	$args['columns'] = 4; // arranged in 2 columns
    	return $args;
    }

    https://docs.woocommerce.com/document/change-number-of-related-products-output/

    Thread Starter kristinubute

    (@kristinubute)

    HI

    Thanks for all the help so far.
    I feel like I’m going completely mad !

    So that function was correct in my end just pasted it incorrectly in here. Still only showing 3 columns.

    I am using Storefront child theme also so you know.

    I think maybe I have some coding somewhere else that is causing this issue with only 3 products showing in the Related Products area. My main Product pages have a left sidebar and content area of 75% width.

    Maybe something there is causing the issue ?

    Just so you know, I have left sidebar as displayed: none; on the Single Page ONLY .. All other pages have the left sidebar Category menu.

    Previously someone had suggested going to the Customizer under Appearance > Customize, in the WooCommerce > Product Catalog section, you can choose the number of products and rows displayed. Just set that to four there.

    I have gone in there also (upgraded) and I see “Shop Page Display” and “Category Display” and “Default Product SOrting”, there is nowhere in there that says that I can choose the number of products and rows displayed, nothing at all.
    I have Version 3.3.4 Wopcommerce now.

    ALSO my main functions.php has coding on the top :
    /*adjustment for 4 shop columns*/
    add_filter( ‘storefront_loop_columns’, function() { return 4; } ); //change shop colunns//

    I’m assuming this is not causing an issue. This allows for 4 products throughout the site but not reflecting in Related Products.

    Thx
    Kristin

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Woocommerce Related Products display’ is closed to new replies.