testing url for sub cats
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 12 Jan 2016 21:29:55 +0000 (16:29 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 12 Jan 2016 21:29:55 +0000 (16:29 -0500)
index.php
views/list_products.php

index 1fa4732..769d4b7 100644 (file)
--- a/index.php
+++ b/index.php
@@ -462,7 +462,7 @@ function michsci_shortcode($atts)
     } else if ( $cat_id = filter_var( $_REQUEST['category'], FILTER_VALIDATE_INT ) ) {
         //michsci_list_categories($cat_id);
     } else if ( !$catid_id && !$product_id ) {
-        michsci_list_products();
+        michsci_list_products($cat_id);
         michsci_list_categories();
     }
 
@@ -531,7 +531,7 @@ function michsci_get_terms_dropdown($cat_id)
  * @access public
  * @return void
  */
-function michsci_list_products()
+function michsci_list_products($cat_id)
 {
     global $wpdb, $wp;
     $cat = get_term($cat_id, MICHSCI_CATEGORY_NAME);
@@ -568,6 +568,7 @@ function michsci_list_products()
         if ( $iterator == $totalProducts ) {
             $product->end = true;
         }
+        $cat->href =   "?michsci_category="; 
         $product->href = $current_url
             . ( ( strpos( $current_url, '?' ) ) ? '&' : '?' )
             . "product=" . $product->ID;
index bbc4a99..7d22e0a 100644 (file)
                      <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="subCatGrid small-12 columns">
-                    <a href="<?php echo $product->href; ?>"><?php echo $term->name; ?></a>
+                    <a href="<?php echo $cat->href . $term->term_id; ?>"><?php echo $term->name; ?></a>
                 </div>
                 <div class="prodTitleGrid small-12 columns">
-                    <a href="<?php echo $product->href; ?>"><strong><?php echo $term->name; ?></strong></a>
+                    <a href="<?php echo $cat->href . $term->term_id; ?>"><strong><?php echo $term->name; ?></strong></a>
                 </div>
         </div>