Get All Product Posts – using get_posts()

You can use the WordPress function get_posts() to get out all product posts you will need to adjust the $args to do a check for the post_type of  ‘wpsc-product’ for more information on get_posts see the WordPress Codex on get_posts


$args = array(

‘post_status’ => ‘publish’,

‘post_parent’ => 0,

‘post_type’   => ‘wpsc-product’


$products = get_posts($args);


You can add any of the additional Args to this array.