adding list view for products display
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Feb 2016 16:06:03 +0000 (11:06 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 11 Feb 2016 16:06:03 +0000 (11:06 -0500)
views/list_categories.php
views/list_products.php
views/product_detail.php

index fb99d85..4a4d801 100644 (file)
@@ -8,11 +8,8 @@
     <?php echo '<a href="'.  '?michsci_category=' . $cat_id . '" >' . print_r($ancestors, true) . "<br>"; ?>
 </div>
  <?php } ?>
-
-
-
 <div id="categoriesGridView" class="row">
-<?php //get_template_part('parts/sidebar-l'); ?>
+<?php get_template_part('parts/sidebar-l'); ?>
 <?php
     if ( isset( $taxonomy_terms) && is_array( $taxonomy_terms ) ) :
         foreach ( $taxonomy_terms  as $term ) : ?>
@@ -36,7 +33,7 @@
 <?php } ?>
 <?php if(!isset($_COOKIE['catView']) || $_COOKIE['catView'] == "list"){ ?>
 <div id="categoriesListView" class="row">
-
+    <?php get_template_part('parts/sidebar-l'); ?>
 <?php
     if ( isset( $taxonomy_terms) && is_array( $taxonomy_terms ) ) :
         foreach ( $taxonomy_terms  as $term ) : ?>
index c001c8e..321abd5 100644 (file)
@@ -1,8 +1,8 @@
-<?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
  <?php $cat_id = $_REQUEST[MICHSCI_CATEGORY_NAME]; ?>
 <?php $term = get_term($cat_id, MICHSCI_CATEGORY_NAME); ?>
+<?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
 <?php echo '<h1 id="catTitleOutput">' . $term->name . '</h1>'; ?>
-<?php get_template_part('parts/sidebar-l'); ?>
+<?php //get_template_part('parts/sidebar-l'); ?>
     <div id="gridView" class="row">
     <?php 
        echo category_description($cat_id);
 
 
 <?php if($_COOKIE['view'] == "list"){ ?>
+<?php echo '<h1 id="catTitleOutput">' . $term->name . '</h1>'; ?>
    <div id="listView" class="row">
-   <?php 
-      $catNum = $_REQUEST[MICHSCI_CATEGORY_NAME];
-      echo category_description($catNum);
-   ?>
+         <?php 
+       echo category_description($cat_id);
+       $cat_children = get_term_children($cat_id, MICHSCI_CATEGORY_NAME);
+    ?>
+          <?php $term = get_term($cat_id, MICHSCI_CATEGORY_NAME); ?>
+     <?php if($_COOKIE['subcat'] == "subcat"){ ?>
+    
+        <?php foreach($cat_children as $cats){
+            $term = get_term($cats, MICHSCI_CATEGORY_NAME); ?>
+            <?php $tags = wp_get_post_terms($product->ID,'michsci_tag'); ?>
+            <div class="subcat <?php echo $term->slug;?> list small-12 columns<?php if ($product->end){ echo ' end';}?>">
+                <div class="prodImgList small-12 medium-3 columns"><a href="<?php echo $cat->href . $term->term_id; ?>">
+                     <img id="catImg" src="<?php echo z_taxonomy_image_url($cats, array(320, 285)); ?>" class="image wp-post-image no-display" alt=" "  title="<?php echo $term->name; ?>" itemprop="image">
+                </div>
+
+                <div class="prodTitleList small-12 medium-3 columns">
+                    <a href="<?php echo $cat->href . $term->term_id; ?>"><strong><?php echo $term->name; ?></strong></a>
+                </div>
+        </div>
+        <?php  } ?>
+     <?php } else { ?>
         
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
 <!--    <div class="row view">-->
@@ -70,6 +88,7 @@
 <!--        </div>-->
     <?php endforeach; endif; ?>
    </div>
+ <?php } ?>
    <?php } ?>
 
 
index 1f4dadc..278712f 100644 (file)
@@ -38,9 +38,9 @@ $relatives = wp_get_post_terms($product->ID, 'michsci_category', $args);
                 print $shortcode_output;
         }?>
          <div class="gallery ">
-          <?php echo '<h4><a href="#glm_gallery"> Product Gallery </a></h4>'; ?>
-          <div id="tags">
-          <?php echo "<h4 id='tagsTitle'> Related Products </h4><br>"; 
+          <?php echo '<h4><a class="galleryLink" href="#glm_gallery"> Product Gallery </a></h4>'; ?>
+          <div class="tags">
+          <?php echo "<h4 class='tagsTitle'> Related Products </h4><br>"; 
                 $args = array(
                 "hide_empty"=>false
             );