get_results($sql,ARRAY_A); $output = "
".print_r($categories,true).""); $siteurl = get_option('siteurl'); if(get_option('permalink_structure') != '') { $seperator ="?"; } else { $seperator ="&"; } foreach((array)$activated_widgets as $widget_container) { if(is_array($widget_container) && array_search(TXT_WPSC_DONATIONS, $widget_container)) { $no_donations_sql = "AND `".WPSC_TABLE_PRODUCT_LIST."`.`donation` != '1'"; break; } } foreach((array)$categories as $category) { $full_view = null; if($category['display'] == 'full') { $sql = "SELECT DISTINCT `".WPSC_TABLE_PRODUCT_LIST."`.*, `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id`,`".WPSC_TABLE_PRODUCT_ORDER."`.`order`, IF(ISNULL(`".WPSC_TABLE_PRODUCT_ORDER."`.`order`), 0, 1) AS `order_state` FROM `".WPSC_TABLE_PRODUCT_LIST."` LEFT JOIN `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."` ON `".WPSC_TABLE_PRODUCT_LIST."`.`id` = `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`product_id` LEFT JOIN `".WPSC_TABLE_PRODUCT_ORDER."` ON ( ( `".WPSC_TABLE_PRODUCT_LIST."`.`id` = `".WPSC_TABLE_PRODUCT_ORDER."`.`product_id` ) AND ( `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id` = `".WPSC_TABLE_PRODUCT_ORDER."`.`category_id` ) ) WHERE `".WPSC_TABLE_PRODUCT_LIST."`.`active` = '1' AND `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id` IN ('".$category['id']."') $no_donations_sql ORDER BY `order_state` DESC,`".WPSC_TABLE_PRODUCT_ORDER."`.`order` ASC"; $product_list = $wpdb->get_results($sql,ARRAY_A); // sorry about the global variable, but it was the best way I could think of to avoid people having to upgrade the gold cart $GLOBALS['wpsc_category_id'] = $category['id']; if(function_exists('product_display_list') && (get_option('product_view') == 'list')) { $output .= product_display_list($product_list, $group_type, $group_sql, $search_sql); } else if(function_exists('product_display_grid') && (get_option('product_view') == 'grid')) { $output .= product_display_grid($product_list, $group_type, $group_sql, $search_sql); } else { $output .= product_display_default($product_list, $group_type, $group_sql, $search_sql); } } else { $sql = "SELECT DISTINCT `".WPSC_TABLE_PRODUCT_LIST."`.*, `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id`,`".WPSC_TABLE_PRODUCT_ORDER."`.`order`, IF(ISNULL(`".WPSC_TABLE_PRODUCT_ORDER."`.`order`), 0, 1) AS `order_state` FROM `".WPSC_TABLE_PRODUCT_LIST."` LEFT JOIN `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."` ON `".WPSC_TABLE_PRODUCT_LIST."`.`id` = `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`product_id` LEFT JOIN `".WPSC_TABLE_PRODUCT_ORDER."` ON ( ( `".WPSC_TABLE_PRODUCT_LIST."`.`id` = `".WPSC_TABLE_PRODUCT_ORDER."`.`product_id` ) AND ( `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id` = `".WPSC_TABLE_PRODUCT_ORDER."`.`category_id` ) ) WHERE `".WPSC_TABLE_PRODUCT_LIST."`.`active` = '1' AND `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."`.`category_id` IN ('".$category['id']."') $no_donations_sql ORDER BY `order_state` DESC,`".WPSC_TABLE_PRODUCT_ORDER."`.`order` ASC"; $product_list = $wpdb->get_results($sql,ARRAY_A); $output = "
"; } $output .=""; if($product['image'] != '') { $output .= "\n\r"; } $output .= ""; if ($full_view != null) { $output .= " | ";
} else {
$output .= " ";
}
if (get_option('hide_name_link')!=1) {
if(($product['special']==1) && ($variations_output[1] === null)) {
$output .= "$specialSpecial / Sale Price - " . stripslashes($product['name']) . "";
} else {
$output .= "$special" . stripslashes($product['name']) . "";
}
} else {
if(($product['special']==1) && ($variations_output[1] === null)) {
$output .= "$specialSpecial / Sale Price - " . stripslashes($product['name']) . "";
} else {
$output .= "$special" . stripslashes($product['name']) . "";
}
}
if ($full_view !=null) {
if($product['description'] != '') {
$output .= " ".nl2br(stripslashes($product['description'])) . " "; } if($product['additional_description'] != '') { $output .= ""; $output .= ""; $output .= TXT_WPSC_MOREDETAILS.""; $output .= ""; $output .= nl2br(stripslashes($product['additional_description'])) . ""; $output .= " "; } } /* adding to cart stuff */ $output .= ""; if (get_option('addtocart_or_buynow')=='1') { if (get_option('payment_gateway')=='google') { $output .= google_buynow($product['id']); } } if ($full_view != null) { if(get_option('product_ratings') == 1) { $output .= " "; } $output .=" | ";
$output .="