Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a refresh of my site on a new VPS plan and on of the main changes is switching from the dreaded wp e-commerce to WooCommerce.

The URL to the WooCommerce store page is http://95.142.166.209/shop/ [I am accessing the site via the VPS IP address for now as my domain is being used for the live site - StackExchange doesn't allow IP URLs so you'll need to copy-paste the IP to your address bar (sorry)]

I am still in the process of styling and templates but I can't seem to figure out the sidebar. My WordPress theme has 2 sidebars defined in its functions.php: blog sidebar and shop sidebar. For some reason the only sidebar I can get to show on the store page is the blog sidebar which is only meant to show (surprisingly) on the blog.

I tried creating a template for the store and inserted the get_sidebar() function, referring to the ID of the shop sidebar in the process, but no joy.

I am of the belief that WooCommerce should register its own sidebar when installed but there is no sign of this in the WP backend under appearance->widgets.

I have trawled through the WooCommerce theme files but the only sidebar-related thing I can find is a php file containing get_sidebar('shop') which is obviously included by other theme files. There is no sign of a sidebar with ID 'shop' being registered anywhere.

Any idea how I can get the correct sidebar showing on the shop pages? Thanks

I see my question has been downvoted a couple of times - I'm sorry if it's unclear but it is a genuine question. If anything needs clarifying it would help if you left a comment rather than just downvoting.

share|improve this question

closed as off-topic by Pieter Goosen, TheDeadMedic, birgire, Rarst Jun 21 at 21:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
How about using Woo Support routes? –  kaiser Nov 20 '12 at 12:52

5 Answers 5

WooCommerce have a sidebars plugin: http://www.woothemes.com/woosidebars/

This will give you really comprehensive control- you can create new sidebar areas for whatever pages you like.

share|improve this answer
    
That could be an option but I'd rather avoid installing extra plugins when I can acheive the result in my theme. I just want to get to the bottom of why I can't seem to get my second shop sidebar to display. Does WooCommerce always use the index.php template or do the WC pages obey the templates they are given? –  harryg Nov 20 '12 at 10:09

WooCommerce will by default look in your theme directory for a page template named woocommerce.php and if it exists will use that template when it renders a page. This way you can override the default WooCommerce page in an upgrade safe way.

The easiest way to implement this is to copy your page.php or single.php to woocommerce.php (in the same directory) then edit the file to replace the content area with a call to WooCommerce.

<?php woocommerce_content(); ?>

This gives you and the theme nearly complete control over the layout and sidebars.

Take a look at this post on themeing WooCommerce, hopefully this will be helpful to you.

WooCommerce Template Structure

share|improve this answer
    
Edited to explain use of custom woocommerce.php file within the theme to allow total control over sidebars. –  Stephen Nov 21 '12 at 16:10

FINALLY!! I found an answer to a similar problem I was encountering with the Customizr theme. See it here.

Essentially, you easily create a custom sidebar, that is edited in Appearance > Widgets and will only show up in your shop pages.

Note: When following the example in this link, be sure to add <?php to the beginning of the code that makes up the sidebar-shop.php file.

Hope this helps you as much as it did me.

share|improve this answer

First step

Copy the woocommerce template files from your plugin into your theme folder (detail how to override default theme http://docs.woothemes.com/document/template-structure/)

Second Step

Create sidebar-shop.php in your theme folder

Third step

Add some text or echo string inside your sidebar-shop.php.

Fourth step

Refresh site you will see the default text string start displaying instead of default blog content

You can further customise your side bar as you want (detail http://codex.wordpress.org/Function_Reference/register_sidebar)

In the widget area add productcategory in the defined sidebar So now in your sidebar you will see product categories instead of default sidebar blog content

share|improve this answer

I am using inove and the consequences are "woocommerce puts the sidebar in the footer or below" and you cannot disable the sidebar in the admin console for Shop or Products, the others are available in the pages section, just choose template no sidebar.

What I had to do to resolve this is incredibly time consuming, possibly destructive to your whole site and nothing seemed to work of 3 days.

I modified single-product.php, archive-product.php in Plugin>Woocommerce>Templates this had the an effect on the sidebar but was still not right.

This is the typical thing I did to files, comment out the @hooked…. sidebar code like this

/**
* woocommerce_sidebar hook
* do_action( 'woocommerce_sidebar' );
* @hooked woocommerce_get_sidebar - 10
*/

Also tried modifications on woocommerce.php and edited style.css and many others in admin console Appearance>editor but delete all these modifications as they did not work.

In pages I selected Cart, Account, Shop and in Page Attributes on side made all pages Parent is Shop and use default template.

The final file edited wc-template-hooks.php fixed the problem, it is located in the Plugin>Woocommerce>Includes folder. I am unsure if you only edit this file then it will fix everything.

/**
 * Sidebar
 *
 * @see woocommerce_get_sidebar()
 * add_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
 */

Sidebar is now where it should be an fixed for me, thank you for all those other contributors which fixes may have worked for earlier versions. I am running everything up to date Jun 2014.

Chearz going to watch the soccer and have a few beers

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.