From 8064ad5ce76f6ddf59678bcf4e11209499c87041 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 12 Jan 2016 16:29:55 -0500 Subject: [PATCH] testing url for sub cats --- index.php | 5 +++-- views/list_products.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 1fa4732..769d4b7 100644 --- 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; diff --git a/views/list_products.php b/views/list_products.php index bbc4a99..7d22e0a 100644 --- a/views/list_products.php +++ b/views/list_products.php @@ -15,10 +15,10 @@
- name; ?> + name; ?>
- name; ?> + name; ?>
-- 2.17.1