Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #241370

    thobri
    Participant

    Hi there

    I am using woocommerce and have 17 products in shop. Now the shop displays 12 items per page. If I want to display, say 24, how do I do this?

    I have tried both the customizer – woocommerce (24 post per page) and the shop-loop tab in the woocommerce settings, changing number of products per page.
    But still shop displays only 12 items per page.

    Can you please help?

    Thanks in advance.

    Regards
    Thobri

    #241377

    Paul R
    Moderator

    Hi Thobri,

    Can you confirm that you are fully updated? (Theme and Plugins)

    Latest version numbers are:

    X theme v 3.2.3
    Revslider Version 4.6.5
    Visual Composer Version 4.3.5
    X shortcodes Version 3.0.5

    If you find anything to be out of date, you can review our update guide.

    Thanks

    #241616

    thobri
    Participant
    This reply has been marked as private.
    #241707

    Darshana
    Moderator

    Hi there,

    By default WooCommerce will show 12 products per page. Please try adding the following code into your functions.php file.

    I’d advise that you setup a child theme first and then you can add the code into your Child Theme’s functions.php file. This allows you to make code changes that won’t be overwritten when an X update is released.

    
    // Display 24 products per page.
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 ); 
    

    WooCommerce documentation: (http://docs.woothemes.com/document/change-number-of-products-displayed-per-page/)

    Thanks!

    #242199

    thobri
    Participant

    Yes, I already tried that. Still displays only 12 items.

    So, I tried the customizer – which should work but does not.
    I tried the Woocommerce-setting in settings – which also ought to work but does not.
    And I tried the add_filter in functions.php – which still does not change anything.

    Really strange. I thought there might be some X-setting I did not know about that causes this…

    Any ideas?

    It is pretty bad as not as many customers sees page 2 as page 1. So I want to show all my products in page one – at least until I have more than 24.

    Looking forward hearing from you with a solution.

    Thanks a lot.
    Regards Thobri

    #242297

    Rue Nel
    Moderator

    Hello There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site

    – WordPress Admin username / password
    
– FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you very much.

    #242320

    thobri
    Participant
    This reply has been marked as private.
    #242386

    Rue Nel
    Moderator

    Hello Again,

    Thank your for the information!

    We are about to try the one line code as we suggested above in your theme and we failed because of file permission. File editing can only be done locally before uploading to your server.

    They only way to alter the number of products displayed in your shop page is by having the code we suggested above. We have tested it on our local install before posting it here. And it just works in our end.

    Please try again to insert this line of code in your child theme’s functions.php

    // Display 24 products per page.
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 ); 

    Please let us know how it goes.

    #242864

    thobri
    Participant
    This reply has been marked as private.
    #242877

    Rue Nel
    Moderator

    You are most welcome.
    We were glad we were able to help you resolve this issue.

    #343001

    Felixius
    Participant

    Can I chime in with a Q here?

    My client wants to display all products on the products page.

    How would I edit that line of code?

    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

    Felix

    #343080

    Rupok
    Member

    Hello @felixius

    Thanks for updating the thread. There is already a working solution on this thread. Please check the previous reply (https://community.theme.co//forums/topic/how-to-display-all-your-products-in-shop-page/#post-241707).

    Al you need to install Child Theme (https://community.theme.co//kb/how-to-setup-child-themes/) and add the code given on the reply and change the value with your own.

    Hope this helps.

    Cheers!

    #343085

    Thai
    Moderator

    Hi There,

    You can replace the 24 number with your product number:

    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 36;' ), 20 );

    Let us know how it goes!

    #343591

    Felixius
    Participant

    Thanks!

    #343710

    Friech
    Moderator

    You’re welcome, glad we could help, Cheers!