Developer forum

Forum » Development » Field groups and context language

Field groups and context language


Reply
Hi there,

Just discovered that when loading field group values using getPropertyProductValues(Product prod), the context LanguageID is used for retrieving the values rather than the LanguageID of the product passed to the method. Field group values and field groups from different languages are completely disconnected from each other, so a product might have some fields in one language and none in an other language.

I'm working on a solution where products have a long list of fields, but they do not differ from language to language. I'm attempting to load default language settings on alternative languages, and since the context language changes on the various areas, the alternative languages have no field group information. I've worked around this by switching the context language in a ProductTemplateExtender, rendering the field groups and then switching the context language back again. It's not pretty, but it works. But is there any chance of a standard approach for fixing that?

BR.
Lars

Replies

 
Nicolai Høeg Pedersen
Reply
Hi Lars

We will have it investigated. It would require some serious testing before releasing a fix though.

Thanks for the input, and glad you found a work around.

BR
 
Reply
Perhaps an extra overload method would be the way to go? Although, I wouldn't assume that this would affect many solutions. In my case we want reuse field groups from one language on all other languages, and thus we need to change the context temporarily. But your're probably right - better test this thoroughly;)
 
Nicolai Høeg Pedersen
Reply
Yes - and field groups are being deprecated with 7.2 for the new catalog frontend. Will be replaced by "Product Categories" - same as product fields, just grouped and set on the product group instead of the product.

And it would be so much easier to set up and find the appropiate labels/values.
 
Reply
How will this work if one product belongs to two different groups?

Will it be possible to perform translation on both field names and values or on or the other?

If you have a WIP version, I'd be happy to test it on a real life example.

BR.
Lars
 
Nicolai Høeg Pedersen
Reply
It works exactly like product fields.

If a product is in two groups of different types, both set of properties will be shown - so you have all possibilities to fuck it up or place the product in 10 groups with 100 fields on each reaching 1000+ fields :).

I'll let you know as soon as we have something that can be used...
 
Reply
Sounds exciting, looking forward to f**k something up with it:)

 

You must be logged in to post in the forum