To upgrade from Toolset Views 3.5 to Toolset Views 3.5.2 and it breaks my website. All my product archives don't work and show no results. When I roll back to version 3.5, everything is back to normal. What can cause this?
Link to a page where the issue can be seen:
The issue can't be seen at the moment because i'm back to version 3.5. But this is a example page where the problem can be seen when I upgrade the plugin : hidden link
I expected to see:
When I upgrade, I expect my product archives to stay the same
Instead, I got:
No result found on every single archive pages.
Also, a new error code started to show in my WP Debug. I don't know if that can be related : Notice: Undefined offset: 0 in /chroot/home/johnsbedrooms/cphomeorig/public_html/wp-content/plugins/wp-views/application/models/WooCommerce/WcQuery.php on line 337
I'm using PHP 7.4 at the moment. When I try to upgrade to PHP 8, I'm getting a bunch of other error message regarding deprecated line of code for Toolset views. I'm fine using PHP 7.4 for now because it is still supported. When Toolset views will support PHP 8 ?
I took the copy of the site and deployed it locally and was able to replicate the issue here.
I was able to get it to work by disabling your current archive and remaking a new one with the exact same specifications and this worked. The archive no longer displays the error Undefined offset: 0 in /chroot/home/johnsbedrooms/cphomeorig/public_html/wp-content/plugins/wp-views/application/models/WooCommerce/WcQuery.php on line 337
Please try this on your end and let me know if you were able to get the same results.
Thanks,
Shane
I found the issue. The problem is being caused by the price field that you're sorting the archive by.
To get the correct price field to sort by you will need to enable the Woocommerce price field at Toolset -> Settings -> Frontend Content and then Hidden custom fields.
Use the Select custom fields button to find and select the _price field. Once you've done this go back to your archive and change the archive to be ordered by this field now.
It should be set to order the field as a number so that it can be sorted correctly. This should resolve your issue on the latest version of Views.