Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working for WooCommerce product #55

Closed
Stock-Webdesign opened this issue Feb 8, 2014 · 8 comments
Closed

Not working for WooCommerce product #55

Stock-Webdesign opened this issue Feb 8, 2014 · 8 comments

Comments

@Stock-Webdesign
Copy link

I can link my English product post to the German one but the language switcher does not link to it on the front end. It links to German home instead.

@lloc
Copy link
Owner

lloc commented Feb 11, 2014

I installed WooCommerce and faced a problem similar to this here: https://github.com/lloc/Multisite-Language-Switcher/wiki/Change-the-generated-URLs

A workaround would be:

function my_msls_options_get_permalink( $url, $language ) {
    if ( 'de_DE' == $language ) {
        $url = str_replace( '/product/', '/produkt/', $url );
    }
    return $url;
}
add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );

But a will let this issue open as bug.

@lloc lloc added the Bug label Feb 11, 2014
@webfocusdesign
Copy link

I'm running into the same issue but your workaround is working great for now. Thanks!

@lloc
Copy link
Owner

lloc commented Sep 1, 2014

Here is an interesting solution if you create your own custom post types with localized slugs ... http://wordpress.stackexchange.com/questions/30021/theme-localization-of-slugs-custom-post-types-taxonomies

@brocheafoin
Copy link

I'm seeing the same problem with WooCommerce's custom taxonomies. WooCommerce now uses custom rewrite rules which the user can define in Settings > Permalinks. If I set a different "Product Category Base" for each site, then MSLS generates links that pick the right slug for the term but the rewrite rules (category base) from the current site.

Example

Product Category Bases

en_US: product-category
fr_FR: categorie-produit

Product Categories

en_US: bicycles
fr_FR: velos

The fr_FR link generated on /product-category/bicycles/ is /product-category/velos/ instead of /categorie-produit/velos/

The filter mentioned in the workaround above is not called in MslsOptionsTax->get_postlink(), so there is no way to alter the URL.

In any case, URLs should be built with the rewrite rules from the corresponding blog/language. I've taken a crack at it but have not gotten it to work yet. I'm not familiar with WP_Rewrite, unfortunately...

@lloc
Copy link
Owner

lloc commented Feb 5, 2015

Interesting! I will look into this very soon...

@Rogi842
Copy link

Rogi842 commented Mar 5, 2016

Hi Dennis,
I would like to ask whether a solution/workaround has been found already for the problem mentioned by last commenter, brocheafoin (commented on 5 Feb 2015 ) ?
Also, probably superfluously but anyway, the problem in my case in detail below;

I have 2 Wordpress websites with each their own domain and configured for Wordpress multisite, with MU-domain-mapping succesfully installed.
Furthermore, I have Woocommerce and Multisite Language Switcher installed and they work excellently together, except with 'product categories'.

site 1: degoudeneeuw.eu
site 2: thegoldenage.nl

Explanation of problem;
when I go to thegoldenage.nl --> Jewellery --> Brooches --> Design Brooches
and then click on Country Flag: the Netherlands (above American Flag), I get: 'Die pagina kon niet gevonden worden' (= page not found) ERROR 404.

the url of the english(US) page;
http://thegoldenage.nl/product-category/jewellery/brooches/design-brooches/
the url of the error page (Netherlands language);
http://degoudeneeuw.eu/product-category/sieraden/broches/design-broches/
Note: the correct url should be with categorie instead of category
(correct: http://degoudeneeuw.eu/product-categorie/sieraden/broches/design-broches/)

Can you give any advice or solution for the problem ?
Thanks in advance

@n3b0r
Copy link

n3b0r commented May 4, 2018

@lloc your solution works for us, thanks ;)

@lloc lloc added the Woo label Dec 30, 2018
@lloc
Copy link
Owner

lloc commented Nov 14, 2024

I'm going to close this in favor of: #399

@lloc lloc closed this as completed Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants