woo_widget_cssclass = 'widget_product_categories'; $this->woo_widget_description = __( 'A list or dropdown of product categories.', 'woothemes' ); $this->woo_widget_idbase = 'woocommerce_product_categories'; $this->woo_widget_name = __('WooCommerce Product Categories', 'woothemes' ); /* Widget settings. */ $widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description ); /* Create the widget. */ $this->WP_Widget('product_categories', $this->woo_widget_name, $widget_ops); } /** @see WP_Widget */ function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Product Categories', 'woothemes' ) : $instance['title'], $instance, $this->id_base); $c = $instance['count'] ? '1' : '0'; $h = $instance['hierarchical'] ? '1' : '0'; $d = $instance['dropdown'] ? '1' : '0'; $o = isset($instance['orderby']) ? $instance['orderby'] : 'order'; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; $cat_args = array('show_count' => $c, 'hierarchical' => $h, 'taxonomy' => 'product_cat'); if ( $o == 'order' ) { $cat_args['menu_order'] = 'asc'; } else { $cat_args['orderby'] = $o; } if ( $d ) { // Stuck with this until a fix for http://core.trac.wordpress.org/ticket/13258 woocommerce_product_dropdown_categories( $c, $h ); ?>
/>
/>
/>