• Resolved Albert

    (@planetshaker)


    This worked fine for 4 years, suddenly it stopped:

    In english, our WooCommerce products have this path domain.com/product/…

    In German, it’s like domain.de/produkt/…

    Coming from the english page, it now suddenly takes product instead of produkt, while the page slug is correct. What can be the issue? Landing on a 404 now every time…

    • This topic was modified 2 months, 1 week ago by Albert.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Did you by any chance use a hook to help WooCommerce with the translated slug? The hook
    msls_options_get_permalink is also documented here:

    /**
    * @param string $postlink
    * @param string $language
    * @return string
    */
    function my_msls_options_get_permalink( $url, $language ) {
    if ( 'de_DE' == $language ) {
    $url = str_replace( '/products/', '/produkte/', $url );
    }
    return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    Thread Starter Albert

    (@planetshaker)

    Thanks for the code, it worked – although I don’t know why the error suddenly appeared as I wasn’t using hooks…

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.