-
Notifications
You must be signed in to change notification settings - Fork 256
Issue #2860840 : Product variantion add to cart not translated. #682
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
Issue #2860840 : Product variantion add to cart not translated. #682
Conversation
…roduct variantion add to cart not translated.
| */ | ||
| public function getTranslatedReferencedEntities($field_name) { | ||
| $refereced_entities = $this->get($field_name)->referencedEntities(); | ||
| return $this->ensureTranslations($refereced_entities); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo error on $refereced_entities. I guess you miss a 'n' in $referenced_entities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. merci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of changes here. And we don't have any i18n testing. There's some initial adjustments to be made.
| /** | ||
| * Provides the base class for Commerce content entities. | ||
| */ | ||
| class CommerceContentEntityBase extends ContentEntityBase implements CommerceContentEntityInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a base class, it must be abstract
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this only provides a public method for trnslated references. So really only relates to Product.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the usage could be extented on other place - for example any getStore(s) needs
and thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would stores need this? It doesn't have an architecture which has a concept of "child references"
| $attributes[$field_name] = [ | ||
| 'field_name' => $field_name, | ||
| 'title' => $field->getLabel(), | ||
| 'title' => $this->t($field->getLabel()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to wrap this in translatable markup, as the field is config and config is already translatable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know, but there the field label won't get translated
i will update with some getTranslationFromContext somehow
…o 2860840-add-to-cart-multilingual
…o 2860840-add-to-cart-multilingual
…o 2860840-add-to-cart-multilingual
77bfcc5 to
c15564f
Compare
1028fc1 to
005e904
Compare
…o 2860840-add-to-cart-multilingual
6be1d5c to
b8a7444
Compare
…o 2860840-add-to-cart-multilingual
…ing after order add/edit
…ormalized and serialized
# Conflicts: # modules/product/tests/src/Kernel/ProductVariationGeneratedTitleTest.php # modules/product/tests/src/Kernel/ProductVariationStorageTest.php
# Conflicts: # modules/product/src/Entity/ProductVariation.php # src/Entity/CommerceContentEntityBase.php
# Conflicts: # modules/product/tests/src/Kernel/ProductVariationGeneratedTitleTest.php
db26e27 to
7df708f
Compare
|
Committed in 7af1dd8 |
No description provided.