-
-
Hi,
I would like to have a right sidebar appear when you browse to the contents of a single category product page. This is the only page I haven’t been able to get a sidebar to successfully appear.
The page I refer to is (example)
https://example.com/product-category/categoryname
There is no way to actually enable a sidebar for this page because there is no physical page for it. I have enabled a sidebar on my shop page (which is set to show categories) and that is working properly. But when you click a category to view its products, the sidebar disappears. When I look at the code I see that it is not including the sidebar section at all and the container is set to “fullwidth”.
I have taken a look through the WooCommerce files as well and the file that generates the contents of the categories (taxonomy-product_cat.php) uses the archive-product.php template file which does have a sidebar reference in it. But its not working for this page.<span id=”OuterMainContent_MainContent_lblHeading” style=”font-weight: bold;”>
</span>What I think the problem is, in the theme you can change the layout of each of the pages (such as the shop page) to show a right sidebar. But there is no physical way to set the product category page to change its layout. So its stuck on a full width layout. Is this something that you could help with?
Thanks so much.
-
Hello,
The category page is an autonomic WooCommerce template. It does not depend on theme configurations. If you want to edit it, then you will have to edit plugins files.
Sorry but this type of customization is not included in theme support.Best regards!
-
Hi Mihaila,
Thanks for your reply. I do understand that it is part of the WooCommerce template. The template that WooCommerce uses is the archive template. This template does include the sidebar support. So its actually the theme conflicting with it and not showing the sidebar on that page. I am sure everyone else using the tower theme and WooCommerce would see the same thing. Is there any way around this?
Thanks.
-
Hello,
Please go to file woocommerce.php and find thi sline:
if($layout == 'sidebar_right' || $layout == 'dual') if($layout != 'dual') get_sidebar(); else get_sidebar('dual'); ?>
Replace with this:
if($layout == 'sidebar_right' || $layout == 'dual') if($layout != 'dual') get_sidebar(); else get_sidebar('woocommerce_sidebar'); ?>
Save and refresh. Make sure to have selected layout with sidebar in General Options > Layout > Pages Default Layout.Best regards!
- This reply was modified 8 years, 10 months ago by Mirela.
-
Hi Mihaila,
Excellent! Works perfectly now. Thanks so much for your help much appreciated!
-
Hi Mihaila,
Sorry one more question. The sidebar now appears on my individual product pages (single product). Is there a way to disable it when viewing individual products?
Thanks
-
Hello,
You can remove it with css. Just add this code into your custom css box:
.single-product .row > .span3 { display: none;} .single-product .row > .span9 { width: 100%;}
Best regards!
-
-
You must be logged in to reply to this topic.