I've got this inside my functions.php file.
function add_product_category_automatically($post_ID) {
global $wpdb;
if(!has_term('','product_relation',$post_ID)){
$cat = get_the_title($post_ID);
wp_set_object_terms($post_ID, $cat, 'product_relation');
}
}
add_action('publish_product', 'add_product_category_automatically');
It creates terms in the 'product_relation' taxonomy when a product is published. Is it possible to also have the terms automatically deleted when the product is moved to the trash?
Thanks

register_taxonomy(). What this code is creating is custom terms in that taxonomy. – scribu Dec 2 '11 at 15:47