" > <a class="widget_category_title" href="<?php echo $link; ?> " ><span><?php echo esc_html($category->name); ?> </span></a> <?php if ($category_state_class != 'wpshop_category_empty') { ?> <ul class="wpshop_categories_widget <?php echo $category_class; ?> " id="wpshop_categories_widget_<?php echo $category->term_id; ?> " > <?php echo wpshop_categories::category_tree_output($category->term_id, $instance); /* Get the product of the current category if the current category has no sub category*/ global $category_has_sub_category; if (!$category_has_sub_category && $display_product == 'yes') { wpshop_products::get_product_of_category($category->slug, $category->term_id); } ?> </ul> <?php } ?> </li>