Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was searching WP Ecommerce documentation, trying to find what function to use to add category to WPEC, but no luck. Is there some function or piece of code that can do this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can use wp_insert_term to add terms to the wpsc_product_category taxonomy:

$args = array(
    'description'=> 'term description.',
    'slug' => 'my-term'
wp_insert_term( 'My term', 'wpsc_product_category', $args );
share|improve this answer
Yep, thats it, tnx a lot. –  SomeoneS Jun 28 '12 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.