Added .html to Woocommerce permalink but pagination don't work!

I'm recently added this code to my Wordpress website to add .html for my product category. It worked okay with the category (http://mywebsite.com/parent-category/product-category.html) but when I clicked the pagination, the link turned into (http://mywebsite.com/parent-category/product-category.html/page/2)

This is a code that i added to function.php on my site

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 );

Please help, I'm just a Wordpress newbie .

Thank you!!!!!!!!!!

Topic woocommerce-offtopic permalinks pagination html Wordpress

Category Web


Adding .html won't do anything for SEO's sake - in fact, it will more likely cause problems than anything else. WordPress (and therefore WooCommerce) don't use HTML files to display - it's PHP files, which is why if you go to a page like the login, by default it's something like example.com/wp-login.php. Out of the hundreds or thousands of WordPress sites I've worked with in my time working for WooCommerce, none of them needed to add .html to a page for any reason, so I would highly suggest against it.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.