Browser: Chrome 110, Brave
OS: Windows
I had a problem with Woocommerce Product archive query loop. Using the query loop for fetching all products from within a category.
Problem
I was seeing the wrong products (every time the same selection of wrong products from several categories) under all categories when logged on as a shop user. I am using infinity loading and when scrolling further down it also said ‘product not found’. The products were not in a particular category or related in any other way.
The biggest problem with this is that everything looked normal when logged in as admin or not logged in (normal visitor). Not sure since when this happened.
Possible solution
Of course i first thought it was a caching problem, but after some tinkering it only changed when i set ‘is main query’ for the products query. I have more queries on that page. I never needed this before (was working fine). Strange in this case is why it did only query the wrong products when logged in as a normal customer user (caching all disabled). Also created new user to check.
I turned ‘is main query’ off again and everything is still ok. Before this i also did the ‘update filter index’ in the Bricks settings (not sure if there is another bricks clearing cache for queries).
I want to leave ‘is main query’ on, but then the breadcrumbs show ‘page 1’ while i am using infinity loading. If someone knows how to disable pagination info in breadcrumbs, let me know.
If anyone knows more, let me know. Maybe check also several product categories and see if they are displaying the right products on product archive pages. Do this under a test account (‘customer role’) if using Woocommerce.