How to set product category base same as shop base - and not have any 404 errors in subcategories?

edited December 2016 in WooCommerce
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

Sign In or Register to comment.