[Resuelto] Woocommerce store base page not applying view template
This support ticket is created hace 8 años, 5 meses. 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.
I've successfully applied an archive view to all other woocommerce pages however the base URL doesn't seem to load the view and instead displays default woocommerce layout.
Shop Base (Not loading view): hidden link
Other Page (Loading View): hidden link
How can I apply the same view template to the shop base page?
Hello. Thank you for contacting the Toolset support.
If you want to customize your shop page using WooCommerce Views, you don't need to create a specific "page" to it with the Views shortcode(and then assign a shop page in WooCommerce settings). To do this correctly, all you need is to override this WooCommerce default shop page with Views WordPress archives.
I've followed those instructions and assigned the content template to the product archive view. This has worked for all shop subcategories but the WooCommerce 'shop' base page is not loading the content template like the article suggests it should.
Again you can view this by comparing my Woocommerce base page to a product category page:
Shop Base (Not loading view): hidden link
Other Page (Loading View): hidden link
On further investigation I think I've found some more relevant information.
In WooCommerce I have the following option set:
Shop Page Display: Show Categories & Subcategories
If I change this to "Show Products" the views template loads only products and displays as expected.
If I change this to "Show Both" the categories display first with no views template then the products display below them with the views template
I believe there must be a bug with either Views or WooCommerce Views that is not correctly applying the views template to the categories that appear when using the above option on the store base page.
First thing is to ensure that at least its not using the woocommerce core archive template. You should use the one supported by Views which is 'WooCommerce Views plugin default product archive template'.
Could you please check now:
=> hidden link
Please let me know, still you require further help.
"WooCommerce Views plugin default product archive template" is selected and the problem still persists.
If it wasn't selected I would expect to be seeing the issue across all product archive views and not just the shop base page.
I am fairly confident this is an issue with the Views plugin support of the "Show Categories & Subcategories" WooCommerce setting under WooCommerce -> Settings -> Products -> Display -> Shop Page Display as I mentioned in my last comment.
Our developer has confirm this issue and they have already fixed this issue but the development version still needs to go through the QA process. The fix will be made available with next release.
I've send you the development version as well as the guide to follow on your registered email ID. Please check your inbox and let me know if this fix your issue.
As I guessed and minesh confirmed with your developers I have an issue with the WooCommerce shop base page when it's set to display subcategories and not products (See above).
I've updated to the 1.11 release which I believe was supposed to resolve the issue but it had no effect.
To see the issue in action:
Shop Base (Not loading view): hidden link
Other Shop Page (Loading View): hidden link
My apologies for the mix up. I can confirm the dev version Minesh emailed me was for WooCommerce Views 2.5.5 which has now been released. I've got that installed and followed the instructions he provided for setting the WooCommerce Views product-archive.php to a edited version of the default without the "woocommerce_product_subcategories()" function.
This has fixed the view not loading on the shop base page but it has caused the shop base page to load products and not the master categories as I had WooCommerce configured to.
I think the woo_has_product_subcategory() conditional must be returning false for the store base page and loading products when we really want it to return true to display the categories. Any way to get around this?