I want to change pagination slug, currently 'page' to 'strana' on WooCommerce archive pages.
Default setting with urls http://localhost/obchod/ and http://localhost/obchod/page/2/ works fine.
When I change pagination base and resave permalinks it not works.
Final url should look like: http://localhost/obchod/strana/2/
This is my code for changing the pagination base:
function custom_rewrite_rules() {
global $wp_rewrite;
$wp_rewrite->pagination_base = 'strana';
}
add_action('init', 'custom_rewrite_rules');
I always resave permalinks on WordPress or I use $wp_rewrite->flush_rules();, but non of these works.
Note that this code works for WordPress pagination, but not for WooCommerce pagination shop pages.
What Am I doing wrong?