Save which language was used during checkout

Created on 14 September 2022, almost 2 years ago
Updated 8 June 2024, 20 days ago

Describe your bug or feature request.

We use Commerce Email → module to send notification e-mails when the payment was received and the package is sent to the customer. The problem is if the user didn't register an account, we don't know which language to use in the later e-mails. The order itself doesn't contain any info about that.

I would like to suggest that we save the language code when the order is placed:

$order->setData('checkout_langcode', \Drupal::languageManager()->getCurrentLanguage()->getId());

If a bug, provide steps to reproduce it from a clean install.

✨ Feature request
Status

Needs review

Version

2.0

Component

Internationalization

Created by

🇸🇰Slovakia kaszarobert

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.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 12 months ago
    785 pass
  • 🇭🇺Hungary tikaszvince

    reroll patch to make possible to apply on 2.36

  • 🇩🇪Germany Anybody Porta Westfalica

    I just ran into something related and I'm not sure, if it should be solved combined here or as separate issue. I'm NOT using the patch from this issue (yet):

    If you create an order in one language, proceed with the first checkout step (confirm so that the order status changes from cart to something else) and then go back to a regular page with cart, the cart is empty, if you're changing to a different language. Going back into the checkout with that different language, also shows the checkout empty.

    Returning to the original language, the cart content and the checkout shows again. Of course, it would be expected ot see the contents in both languages, just like before the checkout started.

    Is this closely related to this issue or should I better create a separate one?
    Can you reproduce it?

  • 🇫🇷France flocondetoile Lyon

    Is this closely related to this issue

    I don't think. This issue is about adding the langcode on the order once it's completed. To be able to know in which language the order has been completed.

    Can you reproduce it?

    Tried on one of my commerce project and I don't reproduce your issue. I wonder if you do't have some custom code / contrib module which implements permissions based on the language for product / order item.

  • 🇩🇪Germany Anybody Porta Westfalica

    @flocondetoile thanks for your feedback! I'll try to reproduce that in a vanilla Drupal Commerce installation. No modules for that, but of course might be a side effect of another module. I'll try and if I'm able to reproduce it, create a separate issue, thanks!

  • 🇮🇹Italy trickfun

    Path stores checkout language but how can send checkout receipt or resend receipt in checkout language?

    Now i receive mail with user preferred language for some text and user interface language for other text.

    May be usefull to resend mail in checkout language form admin.
    Thank you

Production build 0.69.0 2024