Open
Reported for: WooCommerce Multilingual & Multicurrency 5.3.9
Overview of the issue
You may experience an ERR_TOO_MANY_REDIRECTS
error when using WooCommerce Multilingual & Multicurrency while setting product permalinks to Shop base with category.
This issue occurs when products are set to Translatable – use translation if available or fallback to default language, and product categories are also translatable. When switching to a secondary language, the translated product URL fails to resolve correctly, causing an infinite redirect loop.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Open your theme’s function.php file.
- Add the following code:
add_filter( 'wc_product_post_type_link_product_cat', 'custom_modify_product_cat', 10, 3 ); function custom_modify_product_cat( $primary_term, $terms, $post ) { // Example: Replace the primary term if the product has a specific category if ( $post->post_type === 'product' ) { foreach ( $terms as $term ) { $termid = apply_filters( 'wpml_object_id', $term->term_id, $term->taxonomy, TRUE ); $term = get_term( $termid, $term->taxonomy ); return $term; } } return $primary_term; }
I am using permalinks with custom base “/product/” and have exactly the same issue. I get infinite loop crashes and it only resolves if I resave permalinks.
The fault lies in the fact that there is an error in the htaccess that direct to secondary language (loop)
Hi, Thanks for the feedback, The ERR_TOO_MANY_REDIRECTS error could be explained by many scenarios, and the behavior you’re describing appears to differ slightly from what’s addressed in this erratum.
If you’re still encountering the issue, please open a support ticket so we can investigate further.