checking for cookies before loading products
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 17 Dec 2015 21:17:05 +0000 (16:17 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 17 Dec 2015 21:17:05 +0000 (16:17 -0500)
views/list_products.php

index 1825397..6f63eb9 100644 (file)
@@ -1,4 +1,4 @@
-<?php if($_COOKIE['view'] == "grid"){ ?>
+<?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
     <div class="row view">
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>