woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.31k stars 10.75k forks source link

Multisite cross-locale #11089

Closed Lewiscowles1986 closed 8 years ago

Lewiscowles1986 commented 8 years ago

EXPLANATION OF THE ISSUE

Using WordPress 4.5.2 and WooCommerce 2.5.5 (probably prior versions also); If the language of a site changes it seems to break permalinks. Clicking on a link in a product category, or the main store redirects to a locale-specific string that returns 404

STEPS TO REPRODUCE THE ISSUE

  1. I setup a multi-site environment, setup a new site in English
  2. I Install WooCommerce
  3. I setup all products
  4. I change the site-language
  5. I navigate to the shop page
  6. I click a product link

    SYSTEM STATUS REPORT

WordPress Environment
Home URL:       https://#####/de
Site URL:       https://#####/de
WC Version:     2.5.5
Log Directory Writable:     ✔ /usr/share/nginx/vhosts/#####/public/wp-content/uploads/sites/5/wc-logs/
WP Version:     4.5.2
WP Multisite:       ✔
WP Memory Limit:        256 MB
WP Debug Mode:      ✔
Language:       en_GB
Server Environment
Server Info:        nginx/1.4.6
PHP Version:        5.6.99-hhvm
PHP Post Max Size:      
PHP Time Limit:     0
PHP Max Input Vars:     
SUHOSIN Installed:      –
MySQL Version:      5.5.49
Max Upload Size:        
Default Timezone is UTC:        ✔
fsockopen/cURL:      ✔
SoapClient:      ✔
DOMDocument:         ✔
GZip:        ✔
Multibyte String:        ✔
Remote Post:         ✔
Remote Get:      ✔
Database
WC Database Version:        2.5.5
woocommerce_sessions        ✔
woocommerce_api_keys        ✔
woocommerce_attribute_taxonomies        ✔
woocommerce_termmeta        ✔
woocommerce_downloadable_product_permissions        ✔
woocommerce_order_items     ✔
woocommerce_order_itemmeta      ✔
woocommerce_tax_rates       ✔
woocommerce_tax_rate_locations      ✔
Active Plugins (2)
Contact Form 7      by Takayuki Miyoshi – 4.4.2
Salient Visual Composer     by Michael M - WPBakery.com | Modified by ThemeNectar – 4.3.5
Jetpack by WordPress.com        by Automattic – 4.0.3
WooCommerce     by WooThemes – 2.5.5
Salient Visual Composer     by Michael M - WPBakery.com | Modified by ThemeNectar – 4.3.5
Contact Form 7      by Takayuki Miyoshi – 4.4.2
Redirection     by John Godley – 2.4.4
Lazy Load       by – 0.6
CODESIGN2 Content Section Plugin        by CODESIGN2 – 2.6
MultiSite Clone Duplicator      by Julien OGER, Pierre DARGHAM, GLOBALIS media systems – 1.3.2
Multisite Post Duplicator       by Mario Jaconelli – 0.9
MultilingualPress       by Inpsyde GmbH – 2.4.3
Multisite Language Switcher     by Dennis Ploetner – 1.0.8
Disable Emails      by WebAware – 1.2.5
WordPress Importer      by wordpressdotorg – 0.6.1
Woocommerce Product Tab Pro     by Proword – 1.8
BigCommerce -> WooCommerce Product Importer     by CODESIGN2 – 1.8
WC Buckaroo BPE 3.0 Gateway (2.4.X Compatible)      by – 2.1.0
CD2 Import AJAX Helper      by CODESIGN2 – 1.25
Settings
Force SSL:      ✔
Currency        EUR (€)
Currency Position       left
Thousand Separator      ,
Decimal Separator       .
Number of Decimals      2
API
API Enabled:        ✔
API Version:        3.1.0
WC Pages
Shop Base:      #44611 - /shop/
Basket:     #44612 - /basket/
Checkout:       #44613 - /checkout/
My Account:     #44614 - /my-account/
Taxonomies
Product Types:      external (external), grouped (grouped), simple (simple), variable (variable)
Theme
Name:       ###### Salient Child Theme
Version:        0.0.19
Author URL:     https://www.codesign2.co.uk/
Child Theme:        ✔
Parent Theme Name:      Salient
Parent Theme Version:       5.5.53
Parent Theme Author URL:        http://themenectar.com
WooCommerce Support:        ✔

Steps to remit (at least temporarily)

mikejolley commented 8 years ago

This is an issue with permalinks and translation. Settings > Permalinks > save will fix it. It would be the same for any post type or taxonomy, e.g. translating the product category base.

Lewiscowles1986 commented 8 years ago

Actually saving without manually overriding the permalinks does not fix (by manually overriding I mean specifying /produkt/ as a constant value rather than using the canned options

mikejolley commented 8 years ago

Additionally, doing a manually flush via code wouldn't be safe. Some rules could be excluded. Best to leave to user.

Actually saving without manually overriding the permalinks does not fix

Does is all other reports of this ever. The permalink is translated. Saving permalinks fixes the rules.

Lewiscowles1986 commented 8 years ago

Again, saving the permalink Does not fix the issue unless I specify a manual string. Please stop being so dismissive

Lewiscowles1986 commented 8 years ago

I tried saving without changing options. I tried changing to another option. Saving the permalinks did nothing unless a string constant was provided

mikejolley commented 8 years ago

Please stop being so dismissive

Don't be dismissive of my dismissal :p

Your rewrite rules clearly are not being updated. Whether thats multisite related or not I cannot be sure, but thats the issue here; rules need to be updated if the permalink base changes due to translation. That does not make this a bug.

mikejolley commented 8 years ago

Saving the permalinks did nothing

So if you change it to some random string, it still 404s? Then thats a clear sign that your rules are not updating.

mikejolley commented 8 years ago

Rules:

2016-06-10 at 15 42

Link:

2016-06-10 at 15 42 2

See if it 404s in your case.

Lewiscowles1986 commented 8 years ago

changing to a random string works; however changing back from a random string expecting /produkt/ to work as it's the german translation for product, and where woocommerce is pointing to gives a 404.

mikejolley commented 8 years ago

And if you manually set to produkt?

I notice you're using language switcher plugins. What if those are setting /product/ because the backend lang us not german too?

Lewiscowles1986 commented 8 years ago

woocommerce-language-problem

Lewiscowles1986 commented 8 years ago

If it's a plugin conflict; I can accept that; I am an advocate against too many plugins; it might-well-be something to do with multilingualpress, I will file a report with them also; perhaps they are doing something strange. As pictured (above) even when the back-end language is German; it seems to be a problem. I'll work it out, I wanted a bug report in-case it was a WooCommerce problem; I just knew that working around permakinks wasn't cutting it for me.

Setting it manually to /produkt/, doing the same for categories and tags was my original work-around as mentioned in original report; the report is because that seems less than ideal, but it might not be a Woo problem.

mikejolley commented 8 years ago

With standard you're relying on translation. So thats product/ in english and produkt/ in german. The rules should save using whatever value is translated, but yes, as I said plugins could affect that especially with switchers involved.

Setting manually would be best if you never want it to change.