Woocomerce .html end product error

need help, I added .html end at WooCommerce with function at rewrite. And now all, ok, but when clicking at product I got error 404,not found, example: http://ozrubai.lt/parduotuve/vyriskas-dzemperis-solid.html, when clicking at product I got error, but all categories is good. Only products, what can be ?

my code at rewrite

.html pakeitimas galunes

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

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

The page I need help with: http://www.ozrubai.lt

Read more here:: Woocomerce .html end product error

Leave a Reply

Your email address will not be published. Required fields are marked *