Woocommerce sidebar not loading in theme

While this question is probably technically off topic since it relates to woo, there’s definitely some stuff that could be answered that will help other users in the future, plus, I really have been there with the multi-day frustration stuff and would have killed for a life line.

There’s a few things at play here, what you’re looking at in the code you posted is a template file, straight forward enough. The sidebar is “appearing” because that file calls get_sidebar(). I’m simplifying, but what that function does is essentially include the contents of another file based on what you pass it. Because it’s being passed nothing, it is almost certainly including sidebar.php from your theme.

In sidebar.php, there should be a call to the function dynamic_sidebar(). The entire contents of sidebar.php make up “the sidebar”, meaning all the markup, any static content, etc. dynamic_sidebar(), depending on what you pass it, will look for a particular widgetized area. You can see the defined widgetized areas in your theme by going to Appearance > Widgets in the admin section. Woocommerce, when installed, should include several widgets, one of which is the Woocommerce Layered Nav your client wants.

Each area in the admin section is created on the fly by the theme or by plugins by calling the function register_sidebar(). When that function is called, it’s passed an array that can contain a name and/or an id, among many other things. That name or id is what you pass to dynamic_sidebar(). For example, I could register a sidebar in my functions.php like so:

register_sidebar( array(
    'id' => 'left-sidebar'
    'name' => 'Left Sidebar'
) );

That would create a widgetized area in the admin section called “Left Sidebar” that I could drop widgets into.

Then, in any file, but usually a sidebar, you call it with dynamic_sidebar().

dynamic_sidebar( 'left-sidebar' );

If, when you find sidebar.php, and it doesn’t have a call to dynamic_sidebar(), then that file is not calling a widgetized area, and you’ll need to do your own register_sidebar(), drop the widget into the right area under Appearance > Widgets and then call that area by adding dynamic_sidebar() to appropriate file.