-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cart: fatal errors if not all translations are available #18
Comments
Got it! Thanks. Question: In this scenario (the translation of the product variation doesn't exist) do you think that the Attribute name and value should be translated, or should be kept as in the original language? |
The software should not go ahead and sell the item in a language that the Shop has not provided unless there is some special global setting to enable/disable such behaviour. If the product is not available for sale in user selected language, ideally:
The software can't guess the reason why the product is not available for sale in that language, there could be different scenarios:
In summary the visibility of the product in the cart should match the visibility of the product on the site. |
Hi, fyi, I managed to get this error on live without switching languages. If this happens, note the shop manager can't clear the cart, |
Hi Jonathan, I have committed on the July, 6th a fix for the issue in the development branch. It will be releases in v1.0.0 release. This release will be available under wordpress.org by the end of the month. Regarding your feedback to my questions, thank you. The logic to control which product can be sold where, is controlled in WooCommerce. under which countries you sell to and is based on the shipping address (or billing address, for virtual products). It should not depend of the display language. My question was not about the product itself, but rather the attribute names and values:
|
thanks, in this scenario, if the English version is shown in the cart while switched to German language, then would the user be switched back to English language if the user clicks onto this product? Normally in the situation that there is no translation in German, Polylang will simply not show the page/post/product or other custom post in German, and redirect to the German home page instead - though showing base language by default could be a desirable option, it's not there for now. Regarding your question, since the situation is rather invalid either answer is probably ok, however since the product does not exist in German, and the user never selected "Awesome Product - English" "Farbe", it should be fine to show "Awesome Product - English" "Black", which is actually what the user ordered. What about this scenario:
|
Yes, the Product detail page in English will be served to the user.
Ok, my feeling exactly. I will add logic to implement it like so.
Currently, if a German translation/equivalent is not found, the French translation will be shown. It will shown the one that was added to the card.
It will not try the default/base language. If there isn't a translation in the language currently being displayed, it will show the one added to the cart. |
Hi, if a customer switches languages on a cart and any of the products are missing there will be a fatal error:
Fatal error: Call to a member function get_permalink() on boolean in ...../wp-content/plugins/woopoly-master/src/Hyyan/WPI/Cart.php on line 140
While this is clearly the fault of the shop owner for not completing the translations, the system should not return fatal errors to the customer, and should continue to show the products in the cart which do have translation.
--- testing on 1.0.0b release ------
The text was updated successfully, but these errors were encountered: