This is the simplest way to add .html
, which involves overriding the default permastructure:
function wpse_178112_permastruct_html( $post_type, $args ) {
if ( $post_type === 'product' )
add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%.html", $args->rewrite );
}
add_action( 'registered_post_type', 'wpse_178112_permastruct_html', 10, 2 );
http://codex.wordpress.org/Function_Reference/add_permastruct
For categories:
function wpse_178112_category_permastruct_html( $taxonomy, $object_type, $args ) {
if ( $taxonomy === 'product_cat' )
add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%.html", $args['rewrite'] );
}
add_action( 'registered_taxonomy', 'wpse_178112_category_permastruct_html', 10, 3 );