I have a view of products being displayed on a page, as well as a custom archive for products set in Toolset. The query for the page view includes a shortcode parameter for product category slug, while the product archive has a similar query filter as a url parameter. Both of these are using the same content template for loop items.
Sometimes when visiting either of these, whether logged in or not, the number of results correctly correlates to the number of products expected but the output is wonky. For the view on the page, it reiterates the current page's information through the content template over and over again. On the product archive, it will iterate the first returned product over and over again. Sometimes the first few items in the loop display just fine and then the rest are these strange "repeats." A page refresh will often fix things for awhile (as in all the products show up as expected) and then the wonky output comes back. It seems to happen the first time, or after waiting a day or so to visit these pages again.
Any ideas what could cause these queries to "stutter" like this? Not seeing issues with other types of views or archives on the same website, just the WooCommerce-related ones.
Hi,
Thank you for contacting us and I'd be happy to assist.
Intermittent issues most commonly result from data being cached at plugins, server, or CDN level.
To narrow this down, a good test would be to deploy the website's clone on a different online or a localhost server and also test with all extra plugins disabled (i.e. other than Toolset and WooCommerce).
In case the issue still persists, you're welcome to share the results with us and we'll have it investigated, accordingly.
regards,
Waqar
Hi Waqar,
I'm following up on this. I've had WPEngine exclude these specific paths from the cache, and the cache was cleared. On the page showing the view I already had included cached="off" in the wpv-view shortcode. Unfortunately the intermittent issue is still persisting on both the page and the archive, so we must dig deeper to find the culprit. I'll update you once we've finished the rest of your suggestions.
Hi Waqar, we’re still working on debugging this issue…
Thanks for the update Kayla and Marco.
Good luck with the debugging and I'll wait to hear back from you.
We still need to do further debugging but have noticed in the meantime that when editing a product that the "screen options" section is showing 9 instances of "WooCommerce Views filter fields." Only one instance of the metabox actually appears on the page, however (#8)– but the others are there, just empty with display:none. Attaching screenshots. Could this be related to the issues we're having, or a separate issue? We are using the Woocommerce Views filter fields in conditionals inside the template for each product in the loop.
Thank you for sharing this.
I've performed some tests on my but couldn't make the "WooCommerce Views filter fields" repeat the way are in your screenshots.
Can you please go to WP Admin -> Toolset -> Custom Fields -> Post Fields and see how many instance of this field group do you see?
( the normal/expected behavior is that there should only be one )
Hi Waqar,
Unfortunately, there are 29... Curiously only 6 are for Products and the rest are for "all post types." I'm not sure at what point they started multiplying... The plugin was installed before it was renamed WooCommerce Blocks and the documentation for it updated to blocks. We're still using the classic view editors and such.
An update on the quirky view / archive is that it seems likely a cache issue, indeed. Not getting the intermittent weirdness using Local. Turning off object cache through the WPEngine portal under site utilities also seems to have cleared it up. So we're going to need to figure out the caching situation with WPEngine on that.
Thanks for the update and that is indeed strange.
If you'd like us to investigate into these multiple instances of "WooCommerce Views filter fields" fields group, you're welcome to share a clone/snapshot of the website.
( please let me know and I'll split a new ticket for that )
To safely delete the extra ones manually on your own, you can follow these steps:
1. Create a full backup copy of the website.
2. From the field group management page, you can find the instance of this group with the lowest "group_id" value and deactivate the rest( screenshot: enlace oculto ).
3. Check few product edit screens and see if the custom fields values are showing correctly in the available field group. Please also test some page where you've used these custom field values for filters.
4. If everything is normal, you can delete the deactivated field groups.
And glad that the cache issue has been narrowed down to a server and I'm sure your host will be able to help you with the optimal settings.