# WooCommerce Sidebar on Sage 8

**URL:** https://discourse.roots.io/t/woocommerce-sidebar-on-sage-8/7551
**Category:** sage
**Created:** 2016-09-03T11:36:16Z
**Posts:** 2

## Post 1 by @jasperfrumau — 2016-09-03T11:36:16Z

Using Sage 8 and go the base store and store product pages up and running following mainly [https://roots.io/using-woocommerce-with-sage/](https://roots.io/using-woocommerce-with-sage/) and WooCommerce Documentation. I also added the WooCommerce sidebar code from the archive-product.php template and added it to the file in the theme root:

```
<?php
		/**
		 * woocommerce_sidebar hook.
		 *
		 * @hooked woocommerce_get_sidebar - 10
		 */
		do_action( 'woocommerce_sidebar' );
	?>
```

It does not load anything. In setup.php I can comment out not loading sidebars on archive pages, but that does not solve the issue having the WooCommerce sidebar not load. Ideas?

---

## Post 2 by @jasperfrumau — 2016-09-05T07:26:21Z

Well, never mind. Solution for now has been to create a new sidebar for the store and to display it on the store category page only. The file `templates/sidebar.php` has now:

```
<?php if (!is_woocommerce()) : ?>
		<?php dynamic_sidebar('sidebar-primary'); ?>
	<?php endif; ?>	
<?php if (taxonomy_exists('product_cat')) : ?>
	<?php dynamic_sidebar('shop-main'); ?>
<?php endif; ?>
```

The file `base.php` has another code snippet to load the sidebar for the product category page to the right:

```
<?php } elseif (taxonomy_exists('product_cat')) { ?>		
	<main id="main" <?php	Extras\main_class();	?>>
		<?php include Wrapper\template_path(); ?>
	</main><!-- /.main -->
	<?php if (Setup\display_sidebar()) : ?>
	<aside id="sidebar" <?php	Extras\sidebar_class();	?>>
		<?php include Wrapper\sidebar_path(); ?>
		</aside><!-- /.sidebar -->
<?php endif; ?>
	<?php do_action('ianua_after_main_content'); ?>					
<?php } else { ?>
```

Finally, `setup.php` has:

```
// Store Sidebar
  	register_sidebar([
      'name' => __('Shop Main', 'ianua'),
      'id' => 'shop-main',
      'before_widget' => '<section class="widget %1$s %2$s">',
      'after_widget' => '</section>',
      'before_title' => '<h4>',
      'after_title' => '</h4>'
    ]);
```

to load the new sidebar.
