} 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();
}
* @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);
if ( $iterator == $totalProducts ) {
$product->end = true;
}
+ $cat->href = "?michsci_category=";
$product->href = $current_url
. ( ( strpos( $current_url, '?' ) ) ? '&' : '?' )
. "product=" . $product->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="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>