From: Anthony Talarico Date: Tue, 12 Jan 2016 21:29:55 +0000 (-0500) Subject: testing url for sub cats X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=8064ad5ce76f6ddf59678bcf4e11209499c87041;p=WP-Plugins%2Fmichsci-products.git testing url for sub cats --- 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; ?>