Developer forum

Forum » Ecommerce - Standard features » Inherit ProductNumber from Variant in main language

Inherit ProductNumber from Variant in main language

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have the following situation: DW 9.5.8, Rapido 3.0, 2 languages, products with variants.

In Settings/Ecommerce/Advanced/Fields I have set ProductNumber to be ReadOnly between languages, hoping that this will force an inheritance of the value, from Main language to Child language.

It seems that the inheritance works for most of the fields but when I try to localize a variant that is already defined in the MasterLanguage, the default value for ProductNumber is inherited from Master product instead of the Variant I try to localize. The same goes for ProductName.

My expectation was to inherit the values from the Variant defined in the main language and not from the product since I am localizing a Variant.

Is this a bug or a feature? Does it make sense to make it work as I described above?

Is there any way to automatically create the Variant (Extended Variant) in all languages when it is created on the Master Language? I have already checked "Activate products on all languages on create" but the variant is only created as a "Simple" variant. 

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply

Inheritance will not work for simple variants in any ways.

You write read only - there is also a readonly setting which does not have anything to do with inheritance - so just want to make sure you use the "Across all languages" setting?

If you have a variant as an extended, inheritance works. 

Otherwise feel free to create a screencast so we can see exactly what you do.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the response.

In my case, I am talking about Extended Variants.
I have created a screencast: https://www.screencast.com/t/QuFhfqQDi

The solution URL is: https://dev.allmedia.dotfusion.ro

Feel free to mess with it as much as you like. It is a Dev instance. Please let me know if there's anything missing from my screencast.

Thank you,
Adrian

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply

Hi Adrian,

Firstly: setting the ReadOnly property will not (should not) have any effect on inheritance of values. It is only a question about whether or not the value can be changed in product details view. If you want for variants to inherit from master, uncheck [Number / Across all variants] in the Fields view. 

When the inheritance works when localizing, it is because the extended variant is either created or updated with values from master (if fields are unchecked in Fields view) upon localizing.

My expectation was to inherit the values from the Variant defined in the main language and not from the product since I am localizing a Variant.

If the [Number / Across all languages] is unchecked, changing the Product Number on any master or variant, will affect all the others. As in: changing value on master, will push the value to variants. And changing on any variant will push value to other variants and master.

The same is the concept for [Number / Across all variants].

Does that clarify - or am I missing out on something?

Is there any way to automatically create the Variant (Extended Variant) in all languages when it is created on the Master Language? I have already checked "Activate products on all languages on create" but the variant is only created as a "Simple" variant. 

No, not using the UI. But using a ProductSaved notification subscriber you can code your way out of it.

Let me know if the above answers your questions.

Best regards
Morten Snedker

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Morten,

Thank you for looking into it.

Not sure if you watch my recording, therefore I will try to explain what I am trying to accomplish. For ease of explanations, I will just explain the ProductNumber part.

Assuming I already have a Master product defined and the options in Fields are: [Number / Across all variants] = TRUE and [Number / Across all languages] = FALSE. Read Only is unchecked for both of them, therefore no reason to take it into account.

My master language is SK and my child language is CZ. Here are the operations I am making:

  1. I am defining a variant in SK and save it (at this point I have a simple variant in both SK and CZ)
  2. I open the variant again (in SK) and add a product number to it. At this point, I have an extended variant in SK with a ProductNumber and a simple variant in CZ
  3. I save everything
  4. I switch to CZ and open the newly created variant. Since this is a Simple variant, I want to turn it into an Extended variant. At this point, my expectation would be that the ProductNumber (which in this scenario cannot be edited because of the [Number / Across all languages] = FALSE) would be the ProductNumber from the variant I am trying to localize. Instead, the ProductNumber is inherited from the master product (which in most situations will not have a ProductNumber at all.

Does it clarify my setup, the operations, and the expected result? I see no reason to allow [Number / Across all languages] = FALSE if the property is not inherited from the master language.

The reason for this request is that Products will very often have the same ProductNumber in all languages, which makes it easier for the admin to only set the ProductNumber when the variant is defined in the master language. Same goes for other properties of the variant that have the same inheritance set.

Thank you,

Adrian

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply

Hi Adrian,

I can reproduce the scenario that extended variants are not created. I will take it by the dev team and report back here.

BR
Morten

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Morten,

Thank you very much.

Looking forward to the resolution.

Adrian

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi Adrian

did you find a solution? I am trying to get all the variants to inherit the productname from the master variant, but with no luck.

/Hans

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Hans,

Unfortunately, no. So far my only solution is to upgrade to a newer version but that's not gonna happen for a while.

I have notified my customer about it and we are planning an upgrade soon, hoping that this issue would have been solved already.

Adrian

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Ok, thank you

When you say newer version, is this possible in a newer version? I have not figured out how to solve this on version 9.12.3. Should it be possible in such a new version?

/Hans

 
Nicolai Pedersen
Reply

Hi Hans

You write you want to inherit product name from master variant. You cannot, if that is what you mean.

You can have structure like this - a product with 2 variant dimensions, color and size.

  • Master product
    • Variant combination 1 (Red, Small) <= default variant
    • Variant Combination 2 (Red, Medium)
    • Variant Combination 3 (Blue, Medium)
    • etc...

You can have all variant combinations inherit the product name from the master product by setting the "Inherit across all variants" in field settings

You cannot, however, inherit the product name from the "Variant combination 1" set as default variant - you can inherit from a Master product or from a default language only.

Consider the setting below:

  • Product name can be changed on each language, but variants will inherit the name from the master product
  • Product number can be changed on each variant, but will be the same in all languages

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi Nicolai

thank you for your reply. Here is my setup https://www.screencast.com/t/EWsbk222FBWw

Not sure if I understand you correctly. What I want is for the variants to adopt the productname from the master product. The productname is the same across all languages.

Is that not possible to do? Or is there another way of getting the productname to be the same across all variants - eg. via SQL? They have almost 4.000 products, and therefore it would take way too long to type the productname in manually for all the variants.

 

/Hans

 
Nicolai Pedersen
Reply

They will be if you hit save...

It looks integrated and if the integration imports another name, that is used...

 

You must be logged in to post in the forum