Skip to content
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

2603482 order language behavior #352

Open
wants to merge 5 commits into
base: 8.x-2.x
Choose a base branch
from

Conversation

haringsrob
Copy link
Contributor

Hi,

I have made an attempt for the implementation that has the following requirements:

  1. langcode field on the order
  2. ensure it's populated (by CartProvider)
  3. ensure it can be selected when adding a new order, if there are multiple languages

@@ -56,6 +64,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Lin
$this->lineItemStorage = $entity_type_manager->getStorage('commerce_line_item');
$this->lineItemMatcher = $line_item_matcher;
$this->eventDispatcher = $event_dispatcher;
$this->languageManager = \Drupal::languageManager();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update services.yml to inject this into the service. Update create method to get it from service, make it an argument.

@haringsrob
Copy link
Contributor Author

Hi @mglaman,

I have updated the code.

Regards

// If the language is different, we need to save it again. If we are already
// planning to trigger the save, there is no need to do the additional
// checks.
if (!$needs_cart_save && $cart->getLanguage()->getId() <> $this->languageManager->getCurrentLanguage()->getId()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any usage of <> in the php code, I think this should be replaced by !==

@bojanz bojanz force-pushed the 8.x-2.x branch 5 times, most recently from 424752f to b5cc4b2 Compare August 11, 2016 16:15
@bojanz bojanz force-pushed the 8.x-2.x branch 2 times, most recently from c89efa0 to 3944b06 Compare August 22, 2016 07:56
@bojanz bojanz force-pushed the 8.x-2.x branch 2 times, most recently from c54a308 to 85d9f2e Compare September 2, 2016 14:08
@bojanz bojanz force-pushed the 8.x-2.x branch 2 times, most recently from f72b292 to 2503a92 Compare September 27, 2016 15:52
@steveoliver
Copy link
Contributor

This needs a re-roll, then we can do an updated review.

@haringsrob haringsrob force-pushed the 2603482-order-language-behavior branch from 41b705b to a64f773 Compare February 16, 2017 22:13
@haringsrob
Copy link
Contributor Author

@steveoliver @borisson,

I have updated the comments and rerolled onto latest 8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants