1

I use Drupal Commerce version 8.x-2.15. I have a multilingual Drupal site with multiple languages based on domain.

mystic.com -> EN language mystic.eu -> NL language

etc

I added relationships:

(order_items: Order item) Product variation
(Product variation) Product

To get the image_field available to show a thumbnail in my cart form. This works fine.

After I added those relationships and I add one product to my shopping cart and I see now the number of times that I translated my product back in the shopping cart, like: My product My product My product My product

(so above product is translated into 4 languages).

I've fixed this by adding a filter to the view:

Product: Translation language Is one of Content language selected for page

It looks like this is working but I see now 2 values (see screenshot) enter image description here

It doubled the added product. But the price and quantity shows 1.

3
  • Did you add any contextual filters? You've checked that you're combining variations in the cart? Commented Nov 28, 2019 at 19:11
  • @TonyTheFerg I have a contextual filter Order: ID. How do I check combining variations in the cart?
    – meez
    Commented Nov 28, 2019 at 20:50
  • Make sure to check that the product variation is set to Combine order items containing the same product variation.. This is under Manage Displayfor the product-type in question. @ admin/commerce/config/product-types/YOUR-PRODUCT-TYPE/edit/display. For the Variations field, click the settings icon to the right, and ensure that Combine order items containing the same product variation. is checked. Commented Nov 28, 2019 at 22:30

2 Answers 2

0

In the commerce_cart _form view under Advanced, edit the Query Settings, and set it to DISTINCT.

10
  • This is already set in Manage Display...
    – meez
    Commented Nov 28, 2019 at 21:03
  • Is your contextual filter default as it came? Commented Nov 28, 2019 at 21:07
  • Also have you tested removing relationship requirements? (not the relationship itself, but the requirement of it) Commented Nov 28, 2019 at 21:15
  • I am not sure. It's set to Provide default value type Fixed
    – meez
    Commented Nov 28, 2019 at 21:16
  • ok. that should be fine then Commented Nov 28, 2019 at 21:18
0

I just ran into the same situation and in my case the solution was to filter the products on the current language or neutral / not applicable language.

The duplicate result was a translation of that related product. Afterwards the "DISTINCT" option could be removed.

So try filtering on current language and language neutral / not applicable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.