Skip Navigation

[Resolved] WooCommerce view and product archive loop issues

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1896765

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.

#1896905

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#1899023

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.

#1904307

Hi Waqar, we’re still working on debugging this issue…

#1904781

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for the update Kayla and Marco.

Good luck with the debugging and I'll wait to hear back from you.

#1909591
Screen Shot 2021-01-18 at 10.12.20 AM.png
Screen Shot 2021-01-18 at 9.35.38 AM.png
Screen Shot 2021-01-18 at 9.31.34 AM.png

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.

#1911719

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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 )

#1911885
Screen Shot 2021-01-20 at 2.37.51 AM.png

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.

#1911953

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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: hidden link ).
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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.