Developer forum

Forum » Development » Handling variants for different languages

Handling variants for different languages

Sune Fengel
Reply
We have a site with four languages and a ecommerce solution.
I cant figure out how to couple the variantgroups to the different languages.
Atm they are only shown in the danish language brand, and the others just say variantgroup doenst exist under the current language. I dont want the variants translated, only do be able to show them no matter what language branch I'm on.

best regards Sune

Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi there,

You still need to translate them, whether you change the text or not. In other words, open the Variant Group / Option, switch to the other languuage and hit the Save button.

Alternatively, see if Management Center | eCommerce | Advanced Settings | Language | Hide untranslated elements does what you need.

Cheers,

Imar
 
Sune Fengel
Reply
I saved the Variants under Management Center->eCommerce Settings->Product Catalog->Variants in each language and saved my test product in each language, still no variants output.
As for Management Center | eCommerce | Advanced Settings | Language | Hide untranslated elements I dont have a language option/node under advanced settings, so it doesnt appear as if I can tweak anything there...

best regards Sune
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
That's odd. Which version of DW are you using? Can you provide a link to the site?

Imar
 
Sune Fengel
Reply
As far as I can tell from the management section, the DW version is 19.2.2.1.
The site is: www.brynje.dk
The problem occurs on this XML output which is rendered via a custom module

Danish output:
http://www.brynje.dk/Default.aspx?ID=67

English output:
http://www.brynje.dk/Default.aspx?ID=236

An excerpt from the custom module code: 

XmlNode variantsNode = doc.CreateElement("variants");
productNode.AppendChild(variantsNode);
 foreach (VariantGroup vargroup in prod.VariantGroups){
    foreach(VariantOption opt in vargroup.VariantOptions){
        //appending the variants
    }
}

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I am not sure why exactly, but you need the Shopping Cart v2 module installed for the Language node to show up in the Management Center. I just tested it in one of my sites and it disappears when I turn that module off.

Did you also localize the Variant Options and not just the groups?

Imar

 

 
Sune Fengel
Reply
I haven't localized the variant options (intentionally at least) and I wouldn't know how to.
I'm attaching a screendump of my administration panel, maybe you have some available options I dont have on my site?

best regards Sune
Dynamicweb_administration.png
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer
maybe you have some available options I dont have on my site?
Yes. I enabled the Shopping Cart v2 module ;-) You may need to talk to your distributor / partner to have it enabled for you (if you need it of course).

Localizing options is the same as with groups. Go into a variant Group and then click the colored icon at the end of each option. Then save it.

When you use a normal Dynamicweb Product Catalog page, do you see the variants appear in the correct language? That is, maybe there's something in your custom code that doesn't retrieve the correct translated items?

Imar
Votes for this answer: 0
 
Sune Fengel
Reply
That did the trick!
I just have to save each specific variant option under each language.

Thanks for your help Imar and a good weekend to you.

best regards
- Sune
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
 
I just have to save each specific variant option under each language.
Yep, that's indeed the case. If you don't save it for a specific language, Dynamicweb assumes the item is not translated, and thus hides it by default.

Have a good weekend too!

Imar

 

You must be logged in to post in the forum