I resolved this issue. Thank you to Varktech for the code hints.
I changed the wpsc-list_view.php file to show a list of products, creating table headers.
Added the code to show the sku in the list:
<?php echo get_post_meta(wpsc_the_product_id(), '_wpsc_sku', true); ?>
Added a case to the wpsc-functions.php wpsc_product_sort_order_query_vars around line 826:
case "sku":
add_filter( 'posts_join_sku', 'wpsc_add_meta_table_sku' );
add_filter( 'posts_where_sku', 'wpsc_add_meta_table_where_sku' );
$query_vars["meta_key"] = '_wpsc_sku';
$query_vars["orderby"] = '_wpsc_sku';
break;
after the function I added the $where and $join statements:
function wpsc_add_meta_table_where_sku($where){
global $wpdb;
remove_filter( 'posts_where_sku', 'wpsc_add_meta_table_where_sku' );
return $where . ' AND ' . $wpdb->postmeta . '.meta_key = "_wpsc_sku"';
}
/**
* add meta table join section for ordering by sku
*
*/
function wpsc_add_meta_table_sku($join){
global $wpdb;
remove_filter( 'posts_join_sku', 'wpsc_add_meta_table_sku' );
if(strpos($join, "INNER JOIN ON (".$wpdb->posts.".ID = ".$wpdb->postmeta.".post_id)") !== false){
return ' JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts. '.ID = ' . $wpdb->postmeta . '.post_id';
}else{
return $join;
}
}
Only reason I posted this is for anyone else that may need to do something similar in the future. I hope it helps, as I could not find or get help other then from varteck.