• Resolved jseverson

    (@jseverson)


    Hi,
    I’ve run into an issue with WooCommerce on a client’s website that I’ve been unable to figure out.

    When we log into the admin on the live website and go to Products, the products are out of order under the default “All” sort option. There are 38 products total. If you click through to page 2, instead of displaying the remaining 18 products, it just shows the first 20 products in a different order.

    If I click on “Published” or “Sorting”, the 38 products then appear in the correct order and all products are viewable across 2 pages of results. Likewise, if I sort by category, everything comes up correctly. And if I click on “Name” to sort the products by name, I’m also able to see all of the products across 2 pages of results.

    WordPress and plug-ins are showing as up-to-date. I’ve also tried deactivating plug-ins with no changes in this issue.

    I have a copy of the website running on my local machine and we also have a dev environment. In both cases, the “All” sort option is working correctly.

Viewing 5 replies - 16 through 20 (of 20 total)
  • Hi there @jseverson,

    Is there a custom PHP script that I can add to the functions.php file to force the default sort in the Products admin to sort by date published or ID? Or, better yet, as a drop-in plugin?

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    You might need to be looking at wp-admin/includes/class-wp-list-table.php because this table is generated by WordPress code, not WooCommerce.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    As a workaround, you could also try to change Number of items per page on All Products page in Screen Options, however, that might be not a too viable solution as your product count increases. I’d personally think that looking into further troubleshooting the issue with your host would be a better next step.

    I have also noticed that while you did plugin conflict test, you didn’t try to switch a theme to Storefront (or you haven’t mentioned it at least), that would be another thing to try.

    @blackchrome please create a separate thread for your issue and we’ll be glad to look into it!

    Cheers!

    • This reply was modified 5 years, 1 month ago by Elvira K..
    Thread Starter jseverson

    (@jseverson)

    As a workaround, you could also try to change Number of items per page on All Products page in Screen Options, however, that might be not a too viable solution as your product count increases.

    That would only affect the number of products displayed on the front end, no? The front end is working fine. It’s only the “All” option in the Products admin that is broken.

    And it isn’t even the count that is broken. It displays 2 pages of products, which is correct, of 38 products total. But page 1 displays 20 products in the wrong order while page 2 displays 18 of the same 20 products from page 1 but in reverse order.

    And I have switched themes. I’ve done the standard troubleshooting steps of switching to one of the default WordPress themes. I’ve tried Twenty Nineteen and Twenty Twenty. I’ve also deactivated all plug-ins except WooCommerce. I even deactivated WooCommerce in the hope that whatever the issue is, deactivating would reset something.

    I’ve pretty much exhausted all possible solutions other than possibly forcing it to work via code.

    I can open a ticket with my host and I will. But, being in this industry for 20 years, I know exactly how it will go. They will tell me it’s a plug-in issue and they are going to direct me right back to you.

    No other item on the site is broken. It’s only the WooCommerce “All” sort option that isn’t working correctly. So that seems to indicate it’s either a WooCommerce plug-in issue or a WooCommerce data issue. Neither of which can the web host help me with.

    Hi there @jseverson,

    That would only affect the number of products displayed on the front end, no? The front end is working fine. It’s only the “All” option in the Products admin that is broken.

    Screen Options in wp-admin > Products applies to your products view:

    Screen options
    Link to image: https://d.pr/i/eljrYi

    As I said, I don’t know if that will work for you, but it’s worth trying.

    No other item on the site is broken. It’s only the WooCommerce “All” sort option that isn’t working correctly. So that seems to indicate it’s either a WooCommerce plug-in issue or a WooCommerce data issue.

    There is definitely an issue here, no questions about that. However, based on sleuthing you did, it sounds like it is directly connected to how your database data is behaving when hosted in live environment specifically. The issue needs more in-depth dev-level troubleshooting and analyzes of your environments and database data. Did you have a chance to have a look at your live site’s .htaccess file?

    If you would like to take a shortcut and fix the issue with code, you can definitely do that. As I mentioned, I’ll keep this thread open for a while, but I’d also recommend you post in more dev-level resources that I referenced earlier.

    Alternatively, if you need to hire a developer to write this custom code for you, we highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/).

    Cheers!

    Thread Starter jseverson

    (@jseverson)

    @treibalen Thanks for that. That sort of fixed the issue.

    They have 38 products so I upped the product view to 40. When I do so, it shows all products. I’m not sure what field it is sorting by but it does appear to show all products.

    If I drop it down to 30, or back to the default of 20, I run into the same issue with sorting.

    It’s really weird. But, at this point, I think this may be what my client will have to live with.

    Hi there @jseverson,

    I’m glad to hear that the workaround worked.

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

    Cheers!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘“All” Products Sort Not Working’ is closed to new replies.