• 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 15 replies - 1 through 15 (of 20 total)
  • Hi @jseverson – Sorry to hear you’re seeing this issue on your client’s site. That’s definitely an odd one…

    Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status.

    Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.

    Also, could you let me know what the URL slug is when you load up the default “All” sort option? Is it /wp-admin/edit.php?post_type=product?

    Thread Starter jseverson

    (@jseverson)

    Jess,
    Here is the report. I’ve removed the domain for privacy. The URL slug is correct.

    There are 4 WooCommerce related plug-ins that are marked as not having been tested with the installed version of WooCommerce. I had deactivated all 4 and it did not resolve this issue. I also have all 4 installed and active on both the dev site and my local site without any issues.

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://www.******.com
    Site address (URL): https://www.******.com
    WC Version: 3.8.1
    REST API Version: ? 1.0.2
    Log Directory Writable: ?
    WP Version: 5.3.2
    WP Multisite: –
    WP Memory Limit: 768 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.0.33 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version
    PHP Post Max Size: 512 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 6200
    cURL Version: 7.66.0
    OpenSSL/1.0.2t
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.2.25-MariaDB-log
    Max Upload Size: 512 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 3.8.1
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ?
    Total Database Size: 38.37MB
    Database Data Size: 30.80MB
    Database Index Size: 7.57MB
    wp_woocommerce_sessions: Data: 2.54MB + Index: 0.09MB + Engine MyISAM
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 0.08MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.23MB + Index: 0.25MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.27MB + Index: 0.48MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.45MB + Index: 0.45MB + Engine InnoDB
    wp_ctsop_plugin: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_gf_draft_submissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_gf_entry: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    wp_gf_entry_meta: Data: 0.05MB + Index: 0.08MB + Engine MyISAM
    wp_gf_entry_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_gf_form: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_gf_form_meta: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_gf_form_revisions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_gf_form_view: Data: 0.04MB + Index: 0.02MB + Engine MyISAM
    wp_ksp_layers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_ksp_sliders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_ksp_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_options: Data: 2.16MB + Index: 1.08MB + Engine InnoDB
    wp_pmxi_files: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_pmxi_history: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_pmxi_imports: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    wp_pmxi_posts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_pmxi_templates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_postmeta: Data: 8.52MB + Index: 3.03MB + Engine InnoDB
    wp_posts: Data: 3.52MB + Index: 0.28MB + Engine InnoDB
    wp_revslider_css: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_sliders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 1.52MB + Index: 0.63MB + Engine InnoDB
    wp_users: Data: 0.06MB + Index: 0.05MB + Engine InnoDB
    wp_verticalmarquee: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_vertical_thumbnail_slider: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wc_product_meta_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfBlockedIPLog: Data: 0.02MB + Index: 0.02MB + Engine MyISAM
    wp_wfBlocks7: Data: 0.02MB + Index: 0.02MB + Engine MyISAM
    wp_wfConfig: Data: 2.54MB + Index: 0.02MB + Engine MyISAM
    wp_wfCrawlers: Data: 0.02MB + Index: 0.01MB + Engine MyISAM
    wp_wfFileChanges: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfFileMods: Data: 1.54MB + Index: 0.32MB + Engine MyISAM
    wp_wfHits: Data: 0.71MB + Index: 0.12MB + Engine MyISAM
    wp_wfHoover: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfIssues: Data: 0.03MB + Index: 0.01MB + Engine MyISAM
    wp_wfKnownFileList: Data: 0.81MB + Index: 0.10MB + Engine MyISAM
    wp_wfLiveTrafficHuman: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfLocs: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_wfLogins: Data: 0.17MB + Index: 0.04MB + Engine MyISAM
    wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wfNotifications: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_wfPendingIssues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfReverseCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfSNIPCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfStatus: Data: 0.15MB + Index: 0.06MB + Engine MyISAM
    wp_wfTrafficRates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wpml_mails: Data: 4.84MB + Index: 0.01MB + Engine MyISAM
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (27) ###
    
    Gravity Forms: by rocketgenius – 2.4.16
    BackWPup: by Inpsyde GmbH – 3.7.0
    Black Studio TinyMCE Widget: by Black Studio – 2.6.9
    Classic Editor: by WordPress Contributors – 1.5
    Contact Form 7: by Takayuki Miyoshi – 5.1.6
    Content text slider on post: by Gopi Ramasamy – 7.6
    Cyclone Slider Pro: by Nico Amarilla – 2.10.4
    Duplicate Post: by Enrico Battocchi – 3.2.4
    Kadence Slider: by Kadence Themes – 2.3.0
    liMarqueeWP: by MASSCODE – 1.1.1-6.2.0
    Revolution Slider: by ThemePunch – 4.6.5
    SEO Ultimate: by SEO Design Solutions – 7.6.5.9
    Page Builder by SiteOrigin: by SiteOrigin – 2.10.13
    Tiger Technologies Plugin: by Tiger Technologies – 1.0
    User Role Editor: by Vladimir Garagulya – 4.52.2
    Velvet Blues Update URLs: by VelvetBlues.com – 3.2.9
    Vertical marquee plugin: by Gopi Ramasamy – 6.6
    WooCommerce Dynamic Pricing & Discounts: by RightPress – 2.0 – Not tested with the active version of WooCommerce
    WooCommerce Customer/Order CSV Export: by SkyVerge – 4.3.7 – Not tested with the active version of WooCommerce
    WooCommerce Authorize.Net AIM Gateway: by WooThemes / SkyVerge – 3.10.1 – Not tested with the active version of WooCommerce
    WooCommerce UPS Shipping: by WooCommerce – 3.2.7 – Not tested with the active version of WooCommerce
    WooCommerce: by Automattic – 3.8.1
    Wordfence Security: by Wordfence – 7.4.3
    WP Clone by WP Academy: by WP Academy – 2.2.9
    WP Mail Logging: by MailPoet – 1.9.5
    WP Mail SMTP: by WPForms – 1.8.1
    WordPress vertical Thumbnail Slider: by I Thirteen Web Solution – 1.2.11
    
    ### Inactive Plugins (4) ###
    
    Akismet Anti-Spam: by Automattic – 4.1.3
    Check Email: by Chris Taylor – 0.5.6
    cPanel & WHM? Site Software: by cPanel
    Inc. – 1.0
    
    WP Super Cache: by Automattic – 1.7.0
    
    ### Settings ###
    
    API Enabled: ?
    Force SSL: ?
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #788 - /shop/
    Cart: #789 - /cart-2/
    Checkout: #790 - /checkout/
    My account: #791 - /my-account/
    Terms and conditions: #401 - /terms-of-use/
    
    ### Theme ###
    
    Name: Virtue - Premium
    Version: 4.9.18
    Author URL: https://www.kadencewp.com/
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: virtue_premium/woocommerce/archive-product.php
    virtue_premium/woocommerce/content-product.php
    virtue_premium/woocommerce/content-product_cat.php
    virtue_premium/woocommerce/content-single-product.php
    virtue_premium/woocommerce/loop/loop-end.php
    virtue_premium/woocommerce/loop/loop-start.php
    virtue_premium/woocommerce/loop/rating.php
    virtue_premium/woocommerce/loop/sale-flash.php
    virtue_premium/product-searchform.php
    virtue_premium/woocommerce/single-product/add-to-cart/external.php
    virtue_premium/woocommerce/single-product/add-to-cart/grouped.php
    virtue_premium/woocommerce/single-product/add-to-cart/simple.php
    virtue_premium/woocommerce/single-product/add-to-cart/variable.php
    virtue_premium/woocommerce/single-product/product-image.php
    virtue_premium/woocommerce/single-product/product-thumbnails.php
    virtue_premium/woocommerce/single-product/related.php
    virtue_premium/woocommerce/single-product/sale-flash.php
    virtue_premium/woocommerce/single-product/up-sells.php
    virtue_premium/woocommerce/single-product.php
    virtue_premium/woocommerce/taxonomy-product_cat.php
    virtue_premium/woocommerce/taxonomy-product_tag.php
    
    ### Customer/Order CSV Export ###
    
    Order Export Format: default
    Customer Export Format: default
    Automatically Export Orders: disabled
    Automatically Export Customers: disabled
    
    ### Authorize.Net AIM ###
    
    Environment: Production
    
    ### Action Scheduler ###
    
    Complete: 26
    Oldest: 2019-12-21 21:23:43 -0800
    Newest: 2020-01-13 18:16:42 -0800
    
    Pending: 0
    Oldest: –
    Newest: –
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    
    • This reply was modified 5 years, 2 months ago by jseverson.

    Thanks for including that site status! When you click to the second page of pagination in your All sort, does this match your slug?
    /wp-admin/edit.php?post_type=product&paged=2

    Is your local copy of the site an exact copy, including theme and all plugins / versions? If not, could you try re-cloning the production site so that it’s an exact copy and let us know if you are seeing the issue?

    If your local version is an up to date copy of the live site, it sounds like this may be related to caching or something server-specific. Are you running any server-side caching in your production environment?

    Thread Starter jseverson

    (@jseverson)

    Yup, when I go to the 2nd page, the slug is: /wp-admin/edit.php?post_type=product&paged=2.

    Yes, my local version is an exact copy. I downloaded all of the files in the root as well as everything in wp-admin, wp-content, and wp-includes. And I took a fresh version of the MySQL database and set it up locally.

    My client has the site hosted with InMotion on one of their WordPress plans. It has a Cache Manager in cPanel. I’ve both purged that cache and disabled it. Neither fixed the issue.

    Is there anything under Status -> Tools that might help? I tried clearing the transients before posting to the forum. Would running the Update Database option possibly help? Or regenerating the product lookup tables?

    You are a few steps ahead me! Based on your site status report, your database is updated – you can skip that one.

    Let’s try:

    1. Regenerating the product lookup tables via Status > Tools
    2. Go to Dashboard > Settings > Permalinks and click “Save Changes” (you don’t need to make any changes, just save)

    Thread Starter jseverson

    (@jseverson)

    No luck.

    I also tried deactivating WooCommerce and re-activating it to see if that would solve this issue. I also created a new user account to see if it was something with my own admin account. Neither changed how the “All” sort option is presenting products.

    Any other ideas? I’m totally stumped.

    Is there possibly a piece of code that I can add to functions.php to try to force it to order by ID (or some other field) when the querystring doesn’t contain post_status or orderby?

    How odd! Could you confirm what PHP version you are running on your local site?

    Thread Starter jseverson

    (@jseverson)

    My local version is running PHP 7.1.22. The dev site is running 7.2.24. I can try upgrading PHP on the live site early next week to see if that resolves things.

    I’m wondering if I should try pointing the dev site to the live database to see if I then get the same results?

    We’re pretty stumped on this on our end as well.

    I think updating the PHP version on the live site, when possible, is a good plan. We recommend PHP version 7.2 or greater for the current version of WooCommerce.

    I would definitely be curious to hear the results of pointing the dev site to the live database!

    Also, I didn’t see it listed in your site status, but just in case – are you running Jetpack on the live site?

    Thread Starter jseverson

    (@jseverson)

    Ok, I updated my wp-config.php file on the dev site to point to the live database. I also hard coded the site URL into wp-config.php so that I could continue viewing the dev site.

    When I go to Products on the dev site while connected to the live database, I get the same result as the live site. When I switch back to the dev database, the “All” products sorts correctly and I’m able to view all products across the 2 pages of results.

    I just downloaded an SQL backup, emptied my local database and imported the new backup. When I log in and go to Products, everything is working as it should.

    Jetpack isn’t installed. Both the live and dev sites are running PHP 7.2 now.

    Hi there @jseverson,

    When I go to Products on the dev site while connected to the live database, I get the same result as the live site. When I switch back to the dev database, the “All” products sorts correctly and I’m able to view all products across the 2 pages of results.

    Great sleuthing here! You mentioned that your dev site is the exact copy as your live site, meaning that databases are identical too, is that correct? Is your dev database located locally in this case while live one is hosted?

    Additionally, if you open Google Dev Tools in your Chrome browser on All products and switch to page 2, do you see any errors on Console tab?

    If yes, can you please share a screenshot of what you see there. I recommend https://snipboard.io/ for easily sharing screenshots – please follow the instructions on the page, then paste the URL in your reply.

    Cheers!

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

    (@jseverson)

    Great sleuthing here! You mentioned that your dev site is the exact copy as your live site, meaning that databases are identical too, is that correct? Is your dev database located locally in this case while live one is hosted?

    There are 3 different installations: a live site, a dev site, and a local site. Each has their own database. Live and dev are hosted; local is sitting on my computer.

    Plug-in wise, the only difference between the live and dev site is that the live site has an active backup plug-in while the dev site has an active Maintenance plug-in. All other plug-ins are the same.

    The live site and my local site have the same files and the same database content. I grabbed a backup of the live database yesterday, dumped the contents of my local database, and imported the content into my local database.

    When I view the local site using the latest data from the live database, the “All” sort is working perfectly. When I view the dev site using its database, the “All” sort also works perfectly. When I point to the live database on the dev site, the “All” sort is broken just like on the live site.

    All I see in Console for the live site are some warnings; no errors. https://snipboard.io/uajk7q.jpg

    I also tried some additional troubleshooting and ideas today. First, I decided to create a new database and pointed the dev site to it. I then exported an .sql backup from phpMyAdmin and imported it into the new database. Using the live site data in this new database still resulted in the “All” function failing to work properly. I then tried repairing and optimizing the tables on the new database. That also didn’t fix this issue.

    Next, I dropped all of the tables in the new database. I then dropped the tables in my local version and imported the latest .sql file via SQLyog. Everything looked good locally. So, I exported an .sql of the tables from my local install and imported that file into the new database. That also didn’t resolve the issue.

    Lastly, I dropped the tables in the new database and tried doing a direct copy from the live database to the new database via phpMyAdmin’s Copy Database. Again, the same result.

    So, it seems like there is something in the live database that is causing the “All” sort function to not work correctly on the website’s hosting platform.

    Is there a code snippet that I can add to functions.php to force it to sort by date published if sorting by “All” that I can try to see if that will fix the issue?

    • This reply was modified 5 years, 2 months ago by jseverson.
    • This reply was modified 5 years, 2 months ago by jseverson.

    Hi @jseverson,

    That’s a tricky case we have here ??

    Indeed, it looks like not just content of your live site databases causes the issue, but only when it’s hosted in your live environment.

    The only explanation that I see is some differences in your live and dev environments even though they’re both hosted. I’d definitely recommend reaching out to your hosting provider to ask what could be the exact differences between these two if site and database content (including theme and plugins) are identical. What comes to my mind first, is checking your .htaccess files on these two.

    I hope that helps!

    Thread Starter jseverson

    (@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? The latter would be ideal since the designer didn’t set up a child theme for this site.

    I am also having this issue, from memory it started happening when we updated WooCommerce.

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