ID ); $apptivo_ecommerce_loop['loop'] = 0; $apptivo_ecommerce_loop['show_products'] = true; if (!isset($apptivo_ecommerce_loop['columns']) || !$apptivo_ecommerce_loop['columns']) $apptivo_ecommerce_loop['columns'] = apply_filters('loop_products_columns', 4); ?> '.__($products_notfound_message, 'apptivo_ecommerce').'

'; return; } $cat_slug = $term; $term = get_term_by('slug', $cat_slug, 'item_cat'); $categoryID = get_post_meta($term->term_id, '_apptivo_category_id',$single = true); if( $_GET['page'] == '' || $_GET['page'] < 1 ) { $pageNo = 1; if(isset($_SESSION['apptivo_ecommerce_sort_type'])) : unset($_SESSION['apptivo_ecommerce_sort_type']); endif; $sortBy = 0; }else { $pageNo = $_GET['page']; if(isset($_SESSION['apptivo_ecommerce_sort_type'])) : $sortBy = trim($_SESSION['apptivo_ecommerce_sort_type']); else: $sortBy = 0; endif; } $from_index = ($pageNo*$count_posts) - ($count_posts-1); if(isset($_GET['s']) && $_GET['post_type'] == 'item') : //Search Item Ony list($item_lists,$total_items_in_apptivo) = searchitems($_GET['s'],$count_posts,$pageNo, $sortBy); else: // Get All items and get items by category ID. //list($item_lists,$total_items_in_apptivo) = app_getItemsByCategoryId($categoryID,$count_posts,$pageNo, $sortBy); list($item_lists, $total_items_in_apptivo) = appv6_getItemsByCategoryId($mainCategoryID, $count_posts, $pageNo, $sortBy); endif; $item_lists = (array)$item_lists[0]; $items_details = $item_lists; $items_details_cnt = count($items_details); $total_items = $total_items_in_apptivo; if($item_lists[0] != '' || !empty($item_lists[0])) : //pagination $reload = $_SERVER["REQUEST_URI"]; $pos = strpos($reload, '/?'); if ($pos === false) { $reload = $_SERVER["REQUEST_URI"]."?type=product"; } else { $reload = $_SERVER["REQUEST_URI"]; } $reload = explode('&page',$reload); if($_GET['page'] == '' || !is_numeric($_GET['page']) || $_GET['page'] == 0) : $cur_page = 1; else : $cur_page = $_GET['page']; endif; $total_pages = ceil($total_items/$count_posts); if($cur_page > $total_pages) : $cur_page = $total_pages; endif; //End Pagination $apptivo_pagination_type = apptivo_ecommerce_clean(get_option('apptivo_ecommerce_products_pagination_type')); ?> 1 && ($apptivo_pagination_type == 2 || $apptivo_pagination_type == 3)) : $sort_style = "width:40%;float:left;"; else: $sort_style = "float:right;"; endif; ?>
Sort By
1 && ($apptivo_pagination_type == 2 || $apptivo_pagination_type == 3)) : echo '
'; echo products_pagination($reload[0],$cur_page,$total_pages); echo '
'; endif; ?>
'.__($products_notfound_message, 'apptivo_ecommerce').'

'; } ?>
1 && ($apptivo_pagination_type == 1 || $apptivo_pagination_type == 3)) : echo products_pagination($reload[0],$cur_page,$total_pages);endif;