Using WP e-commerce, I’m trying to print a tree having all categories and products within.
So far, I’ve only managed to print the categories themselves.
<?php wpsc_start_category_query(array('category_group'=>get_option('wpsc_default_category'), 'show_thumbnails'=> get_option('show_category_thumbnails'))); ?>
<li>
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_link <?php wpsc_print_category_classes_section();
echo 'id';wpsc_print_category_id(); ?>"
<?php wp_get_object_terms( $object_ids, $taxonomies, $args ); ?>
<?php title="<?php wpsc_print_category_name(); ?>">
<?php wpsc_print_category_name(); ?></a>
<?php wpsc_print_subcategory("<ul>", "</ul>"); ?>
</li>
<?php wpsc_end_category_query(); ?>
Can I somehow mix them together with products?
see your products are kind of custom posts type so you can display all the categories by get_categories(); function it will return an array of all the categories related to some custom post type which is in your case products and with the help of foreach loop and get_posts(category => $category); you can display different categories and there related posts