In a product display node, when you make the product reference to be translated by the entity translation module. You will get the products with the default language.
Use this patch to get the correct products with the page language.
For ex,
When you create a product display in En, you get the product reference to be translated by the entity translation. The added 10 products to En. Then you add a translate display in Nl, you added 20 products to the Nl. Then you will find that in Nl, it still display the 10 products you added to En.
This patch just to get the products display node to show the correct products when a page use not the default language.
Comment | File | Size | Author |
---|---|---|---|
#9 | commerce-2342991-9.patch | 1.56 KB | daiwik.addweb |
| |||
#3 | get_the_translated-2342991-3.patch | 1.49 KB | joelpittet |
commerce-commerce_cart-product_reference-product_ids-entity-translation-fix.patch | 784 bytes | wqmeng | |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedThe patch works correctly for me. It is a straight forward fix.
Comment #2
joelpittetOMG thanks, I was just about to write a similar patch. RTBC++
Comment #3
joelpittetDo we need the same thing for the default product as well?
I have a feeling this is not a commerce problem but an entity_translation or entity module problem because at one point in my dev cycle this worked as expected... though maybe someone a bit more familiar could let us know?
For me it may have been a related product field getting picked up from the field settings checkbox "Render fields from the referenced products when viewing this entity. ".
Still testing but, this patch may be a bit more complete. Though I'm going to try again without the patches.
Comment #4
joelpittetWell that field settings was a problem (argh again, got reverted somewhere on me). This patch still fixing my problem. Still feel there is a bigger problem here.
Comment #5
joelpittetGoing to look into this issue in the morning #2335885: 'langcode' option in info array is not applied
Comment #6
joelpittetThe issue I referenced in #5 doesn't do anything but is still related.
I did find that this patch here fixed the issue #2351905: Get field language instead of entity language from entity_metadata_field_get_language. So please give that a test because it fixes a bigger problem.
Comment #7
michfuer CreditAttribution: michfuer commentedI need some guidance on how to reproduce the bug. Here's what I tried after enabling the entity_translation module ver. 7.x-1.0-beta3.
Edited my "Product" product type and set Multilingual support to "Enabled via Entity translation"
Created Product A with an Afrikaans, and English version.
Created Product B with an Afrikaans, and English version.
Edited my Product Display content type and went to Publishing options->Multilingual support and selected "Enabled, with field translation". Then went to "manage fields" and edited the product reference field to enable the "Users may translate all occurrences of this field" option.
Next I created a product display and set the original language to English, and added an Afrikaans translation. For both language versions I referenced Product A and Product B.
As a user I navigate to the product display and when I select "English" for the display I see the product's field content in English, and same when I switch to Afrikaans. This is expected behavior to me.
The scenario described by the OP appears to be adding different products per language version to the same display, i.e. English gets Products A, B, C and Afrikaans gets Products D,E,F. Why wouldn't you create separate displays for these groupings?
Comment #8
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #3 does not apply to the latest commerce 7.x-1.x-dev and needs a reroll.
Comment #9
daiwik.addweb CreditAttribution: daiwik.addweb at AddWeb Solution Pvt. Ltd. commented@Chris2, Here's the patch Kindly review it & provide your valuable feedback on the same... Thanks!..