It is not exactly the answer but here it will get formatted better than in the comments section.
To solve your problem I would start with the simplest possibile working set. Then line by line I would extend the solution checking if it still works after each step. You could start with:
function custom_post_types() {
$args = array(
'public' => true,
'label' => 'Products'
);
register_post_type( 'product', $args );
$args = array(
'label' => 'Product category',
'rewrite' => array( 'slug' => 'product_category' ),
'hierarchical' => true,
);
register_taxonomy( 'product_category', 'product', $args );
}
add_action('init', 'custom_post_types', 0);