I have an issue with existing website where I need to add WooCommerce. The website functions.php and other template files is built with some kind of a catalog:
function register_product() {
$labels = array(
'name' => _x('Catalog', 'post type general name','LADS'),
'singular_name' => _x('Product', 'post type singular name','LADS'),
'add_new' => _x('Add','LADS'),
'add_new_item' => __('Add','LADS'),
'edit_item' => __('Edit','LADS'),
'new_item' => __('Add','LADS'),
'all_items' => __('All','LADS'),
'view_item' => __('View','LADS'),
'search_items' => __('Search','LADS'),
'not_found' => __('Nothing Found','LADS'),
'not_found_in_trash' => __('Nothing Found','LADS'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'catalog' ),
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'taxonomies' => 'product_category',
'supports' => array('title','editor','thumbnail','excerpt','comments','revisions','custom-fields')
);
register_post_type( 'product' , $args );
}
add_action('init', 'register_product');
Full code part here: https://pastebin.com/RYLHCXWz
The catalog is using WP post type "product" which makes it showing catalog entries and they conflict with WooCommerce as it is using the same post name by default.
Is it possible to force WooCommerce to use a different post type by default? For example "product1"?