It shouldn’t be. Products are posts of type wpsc-product, and categories are a WordPress taxonomy of type wpsc_product_category.
So – to get the categories that a product is assigned to:
$categories = wp_get_object_terms ($post->ID, ‘wpsc_product_category’);
Actually, trying to display the data gives an error “Cannot use object of type stdClass as array”, since this is a multi-dimensional array.
I’ve had to resort to using this function (http://www.phpro.org/examples/Convert-Object-To-Array-With-PHP.html), and then echo’ing each potential array value like this, as an iteration using a for/count loop was taking more than 30 seconds…
<?php
$categories = wp_get_object_terms ($post->ID, ‘wpsc_product_category’);
$prodcats = objectToArray( $categories );
echo “<div class=’prodcats-items’>” . $prodcats[0][‘name’] . ‘ ‘;
echo $prodcats[1][‘name’] . ‘ ‘;
echo $prodcats[2][‘name’] . ‘ ‘;
echo $prodcats[3][‘name’] . ‘ ‘;
echo $prodcats[4][‘name’] . ‘ ‘;
echo $prodcats[5][‘name’] . ‘ ‘;
echo $prodcats[6][‘name’] . ‘ ‘;
echo $prodcats[7][‘name’] . ‘</div>’;
?>
The following works fine for me without any messing around – or having to assume a fixed number of categories.
$categories = wp_get_object_terms ( $post->ID, 'wpsc_product_category' );
foreach ( $categories as $category ) {
esc_html_e ( $category->name );
echo " ";
}
It’s worth noting that wp_get_object_terms can return different formats depending on what you need. See http://codex.wordpress.org/Function_Reference/wp_get_object_terms