[Resolved] Show Variation Product on WooCommerce shop and other archive pages
This support ticket is created 3 years, 6 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.
Tell us what you are trying to do?
Trying to show WooCommerce individual variations as simple product s on shop page which is powered by Toolset WooCommerce Views.
I'm able to achieve it using 'Display Variations as Separate Shop Products' plugin: hidden link
What is the link to your site? hidden link
Everything works as expected. However as soon as i use any filters (Toolset Views Filters), the individual variations don't show. Only the main products
I raised support with IconicWP and they told me that we need to:
Show the post type "product_variation" aside from the parent product "Product" while the filters are running.
Given that there isn't a way to do this with Toolset you can perhaps try to modify the post type query for views to include the product_variation post type.
The above code only works once the page is loaded but doesn't not work when any filters are triggered. How can we have the code work even when the filters are triggered?
The main issue is that the "product_variation" post type is a hidden post type by Woocommerce. Our views plugin will only query posts types that are not hidden.
Even if we get them to display when the search is performed it will only be performed on the main product so you may not get the correct results.
Right now i'm setting the query on the archive to include the product_variations but there isn't a way to modify the search parameters for the archives.
Perhaps the only way to do this is for you to create a view, and add that view to a page that would act as your archive and redirect users to this page whenever they want to view the archive.
This way the view query can be modified to include the product_variation post type.