--- /dev/null
+
+ <div class="sidebar shop-sidebar">
+<!-- <h1>Test</h1>-->
+ <?php
+//
+ $taxonomy = 'product_cat';
+ $orderby = 'name';
+ $show_count = 0; // 1 for yes, 0 for no
+ $pad_counts = 0; // 1 for yes, 0 for no
+ $hierarchical = 1; // 1 for yes, 0 for no
+ $title = '';
+ $empty = 0;
+
+ $args = array(
+ 'taxonomy' => $taxonomy,
+ 'orderby' => $orderby,
+ 'show_count' => $show_count,
+ 'pad_counts' => $pad_counts,
+ 'hierarchical' => $hierarchical,
+ 'title_li' => $title,
+ 'hide_empty' => $empty
+ );
+ $all_categories = get_categories( $args );
+ foreach ($all_categories as $cat) {
+ if($cat->category_parent == 0) {
+ $category_id = $cat->term_id;
+ echo '<br /><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
+
+ $args2 = array(
+ 'taxonomy' => $taxonomy,
+ 'child_of' => 0,
+ 'parent' => $category_id,
+ 'orderby' => $orderby,
+ 'show_count' => $show_count,
+ 'pad_counts' => $pad_counts,
+ 'hierarchical' => $hierarchical,
+ 'title_li' => $title,
+ 'hide_empty' => $empty
+ );
+ $sub_cats = get_categories( $args2 );
+ if($sub_cats) {
+ foreach($sub_cats as $sub_category) {
+ echo $sub_category->name ;
+ }
+ }
+ }
+ }
+ ?>
+
+ <a href="<?php echo esc_url( get_permalink( woocommerce_get_page_id( 'shop' ) ) ); ?>">
+ <h1>Products</h1>
+ </a>
+<!-- Adding parent_id="0" to the shortcode attributes below places it back the way it was, just showing top-level cats -->
+ <?php echo do_shortcode('[product_categories number="" hierarchical="1" orderby="name" order="asc" columns="1" hide_empty="0" ids=""]'); ?>
+ </div>
+
+<script>
+jQuery(document).ready(function($) {
+var url = window.location.href;
+ // 'current' class style to sidebar item that matches the current url
+ $('.shop-sidebar ul.products li a').each(function() {
+ if ($(this).prop('href') === url) {
+ $(this).addClass('current');
+ }
+ if($(this).attr("class") === "current"){
+ $(this).parent("li").addClass("current");
+ }
+ });
+});
+</script>
\ No newline at end of file
</div>
<div id="content-wrapper" class="row woocommerce-wrapper">
<?php if (is_shop()) { ?>
- <div class="small-12 medium-9 columns medium-centered main woo-tags">
+ <div class="small-12 medium-7 columns left main woo-tags">
<?php
/**
* woocommerce_before_main_content hook
?>
</div><!-- .main .woo-tags -->
<?php } else if (is_product_tag() || is_product_category()) { ?>
- <div class="small-12 medium-9 columns medium-centered main woo-tags">
+ <div class="small-12 medium-7 columns left main woo-tags">
<?php
/**
* woocommerce_before_main_content hook
?>
</div><!-- .main .woo-tags -->
<?php } else if (is_product()) { ?>
- <div class="small-12 medium-9 columns medium-centered main woo-single-product">
+ <div class="small-12 medium-7 columns left main woo-single-product">
<?php
/**
* woocommerce_before_main_content hook
?>
</div><!-- main woo-single-product -->
<?php } ?>
+ <div id="woo-sidebar" class="small-12 medium-5 columns right">
+ <?php include 'parts/shop-sidebar.php';?>
+ </div>
</div><!-- .row .content -->
</main>
<?php