How to set product category base same as shop base - and not have any 404 errors in subcategories?
I added this code in functions.php file:
add_filter( 'rewrite_rules_array', function( $rules )
{
$new_rules = array(
'shop/([^/]*?)/page/([0-9]{1,})/?$' => 'index.php?product_cat=$matches[1]&paged=$matches[2]',
'shop/([^/]*?)/?$' => 'index.php?product_cat=$matches[1]',
);
return $new_rules + $rules;
} );
I was able to achieve the objective, but i still got 404 errors for the subcategories of subcategories.
How do I fix that?
Comments
what you ask for, requires files customization what in reference to Item Support Policy is not allowed. So if you want to modify files and don't know how, you should contact with your web developer.
Thanks!