I have a loop to display products. It checks if there is a url query “product_cat” and displays different loops if it exists. I think there must be a simpler way of writing it but I can’t figure it out. Here’s a simplified version of my code:
I’ve run into this problem before, but I could not find a way of conditionally changing the parameters of the Loop field. It’s best to implement a solution that avoids this scenario.
One way to resolve this is to make your URL structure consistent and use a product_cat value of ‘default’ or ‘all’ when it’s not applicable.