Overview of the Issue
When you have a custom product base set to e.g. ”/catalogue/%post_id%/” in SettingsPermalinks in WordPress, and you translate that base, you might encounter an error 404 (Not found) for the translated products
Workaround
This issue is fixed in WPML 4.9. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Go to: /wp-content/plugins/wpml-string-translation/classes/slug-translation/new-match-finder/wpml-st-slug-new-match-finder.php
There in the function:filter_slug_using_tag, just after this exact code:
private function filter_slug_using_tag( $slug ) {add this new code:
if ( preg_match( '#%post_id%#', $slug ) ) {
$slug = preg_replace( '#%post_id%#', '([0-9]+)', $slug );
}Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question