Product variation not translated on "add to cart" form

Created on 15 March 2017, almost 8 years ago
Updated 21 March 2023, over 1 year ago

Even if the product variation is translated, the "add to cart" is not translated in the product variation label.
Here is code that i added, please create patch for this.

Drupal\commerce_cart\Form\AddToCartForm;
function public function submitForm ....
after $purchased_entity = $order_item->getPurchasedEntity();

$language = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_INTERFACE)->getId();
    if($purchased_entity->hasTranslation($language)){
      $purchased_entity = $purchased_entity->getTranslation($language);
    }
🐛 Bug report
Status

Fixed

Version

2.0

Component

Cart

Created by

🇲🇩Moldova pavelculacov Chisinau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024