added list and grid view conditional
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 17 Dec 2015 20:09:06 +0000 (15:09 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 17 Dec 2015 20:09:06 +0000 (15:09 -0500)
views/list_products.php

index 59e7a91..29ad49f 100644 (file)
@@ -1,6 +1,8 @@
-<div class="row">
+<?php if($_COOKIE['view'] == "grid"){ ?>
+    <div class="row view">
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
-        <div class="product small-12 medium-3 columns<?php if ($product->end){ echo ' end';}?>">
+    
+        <div class="product small-12 columns<?php if ($product->end){ echo ' end';}?>">
             <div class="row">
                 <div class="prodImg small-12 columns"><a href="<?php echo $product->href; ?>">
             <?php echo get_the_post_thumbnail( $product->ID, array(320, 285)); ?></a>
             </div>
         </div>
     <?php endforeach; endif; ?>
-</div>
+        </div>
+<?php } ?>
+
+<?php if($_COOKIE['view'] == "list"){ ?>
+   
+    <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
+    <div class="row view">
+<!--        <div class="product small-12 columns<?php if ($product->end){ echo ' end';}?>">-->
+           
+                <div class="prodImg small-12 large-4 columns"><a href="<?php echo $product->href; ?>">
+            <?php echo get_the_post_thumbnail( $product->ID, array(320, 285)); ?></a>
+                </div>
+                <div class="subCat small-12 large-4 columns">
+                    <a href="<?php echo $product->href; ?>"><?php echo $product->term; ?></a>
+                </div>
+                <div class="prodTitle small-12 large-4 columns">
+                    <a href="<?php echo $product->href; ?>"><strong><?php echo $product->post_title; ?></strong></a>
+                </div>
+          
+<!--        </div>-->
+        </div>
+    <?php endforeach; endif; ?>
+       
+<?php } ?>
+
+
+
+
+
+