Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
First of all, I'm a newbie to this forum, so sorry if i'm posting the thread to incorrect place.

I ve been trying to search for the usage of function wpsc_category_image() (WP e-commerce wordpress plug-in), there were some results but unfortunately I still cannot achieve what I expected.

I want to show all images of wpsc categories, and tried the below codes:
HTML
    <div class="wpsc_categories wpsc_category_grid group">
    <?php wpsc_start_category_query(array('category_group'=> 1, 'show_thumbnails'=> 1));?>
    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item  <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>" style="background:url(<?php echo wpsc_category_image(); ?>)">
    </a>

<?php wpsc_end_category_query(); ?>


From what I have read from Internet, these codes should work fine, but somehow the function wpsc_category_image() returned nothing.

Could you guys please tell me the problem in this? I would be very appreciated, I promised my friend to help him make the website, but this is where I still got stuck
Posted
Updated 4-Dec-13 14:56pm
v2

1 solution

According to the plugin docs[^], the array that you pass as the parameter uses parent_category_id, not category_group.

Here's the example they use that you may want to follow:

PHP
<?php wpsc_start_category_query( array( 
        'parent_category_id' => $category_id, 
        'show_thumbnails' => $show_thumbnails, 
        'show_name' => $show_name 
    ) 
); ?>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900