• Resolved issamwebmaster

    (@issamwebmaster)


    Hello,

    i tired looking for a solution to display more than 12 (upsell) products in product page, but i didn’t found a solution.
    I added 20 products and i see only 12 products.
    can you help me please.

    thank you

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Stef

    (@serafinnyc)

    You need to hook that in order to increase the number. I don’t believe anything’s changed there, but I could be wrong. If you’re comfortable with code you can simply add these hooks. Default is usually 2

    For Cross Sell

    // Set the number of items to show on Cross Sell. 
    function tbg_cross_sells_custom_totals($total) {
        $total = 26; //Whatever number. I made a carousel for my client
    
        return $total;
    }
    add_filter( 'woocommerce_cross_sells_total', 'tbg_cross_sells_custom_totals', 99 );

    For Upsell

    add_filter('woocommerce_upsell_display_args', 'tbg_upsell_display');
    
    function tbg_upsell_display($args) {
        $args['posts_per_page'] = 26;  // Change this number to however many upsells you want to show
        return $args;
    }
    

    In this code snippet, the customize_upsell_display function modifies the posts_per_page parameter to control the number of products shown in the upsell area. You can change the number 6 to any number that suits your needs.

    You can add this code snippet to your theme’s functions.php file or a custom plugin. This change will then be reflected in the upsell display on your WooCommerce product pages.

    Thread Starter issamwebmaster

    (@issamwebmaster)

    Thank you for the response but not working, still show only 12 products!!
    Any other solution ? i tired chatgpt and google before asking here.

    Stef

    (@serafinnyc)

    Then something in your theme or an app is overriding the overriding ???? I’ve been using these two for years.

    I use the one hook on the checkout page for a client to display a carousel or 30 products.

    • This reply was modified 6 months, 3 weeks ago by Stef.
    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi there @issamwebmaster,

    I understand you’re having trouble displaying more than 12 upsell products on your product page.

    In order to change this, you’ll need to add custom code to your theme’s functions.php file.

    However, helping out with custom coding of this nature is outside the scope of support that our support staff can help out with here, although I would recommend the following:

    1. Running the exact question you’re asking, through an AI platform like ChatGPT, for recommendations.
    2. Checking whether there are existing plugins in the WordPress plugin repository that might be doing that already.
    3. Joining our WooCommerce Slack community (it does have a developer channel where you can ask coding questions): https://woo.com/community-slack/

    Hope it helps!

    Hi! We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Upsells & Cross sells limited to 12 products’ is closed to new replies.