Developer forum

Forum » PIM » PIM feed - messy variant structure?

PIM feed - messy variant structure?

Michael Knudsen
Reply

Hello forum,

- I'm trying to build a PIM feed with products and variants using the 'XML feed provider' and since I need to transform the XML, I have been looking at the raw XML output when enabling fields from the 'VariantInfo' section of the feed. To me, the XML output seems a bit messy, but I might be wrong.

One of the products have 3 variant dimensions 'Bredde', 'Farve' and 'Motor type' and the <VariantInfo> looks like the image below.

<VariantInfo> contains the first variant dimension ('Bredde'), but in order to get the option value of 'Bredde', I need to go to the next level of a nested <VariantInfo>?  Dosen't seems logical to me.

Furthermore, the <VariantInfo> contains ALL variants options and not only the variant options that belongs to a certain <ProductId> + <VariantId> !? Dosen't seems logical to me.

Is it just me, that think the <VariantInfo> is a bit messy?

 

Br. Michael Knudsen


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Michael

Variant info is a tree structure of the options and combinations made for rendering a variant selector - so as it is it might not be what you need in your feed. In this case you have a relatively deep structure.

The viewmodel it self have a number of 'extension methods' that you can use in a Razor template to get the structure differently - see all of them here: https://doc.dynamicweb.com/apix/api/Dynamicweb.Ecommerce.ProductCatalog.ProductViewModel.html - but if you are just using the property selectors on the feeds, you cannot use that option.

If you have input on how you would like a deep varaint structure to be outputtet, please post the idea for it. Maybe we can make a change to give you something more useful.

BR Nicolai

 
Michael Knudsen
Reply

Hello Nicolai,

- and thanks for your feedback, I certainly agree that variants adds a complexity in the data structure, but once you have a certain <ProductId> + <VariantId> (a specific varaint), I would expect the variant options for this specific variant. Don't know if this should be a setting on the feed or an extension to the current <VariantInfo> eg.

<VariantInfo>
    <VariantSelected>
  <VariantGroupInfoName>Bredde</VariantGroupInfoName>
<OptionName>550 mm</OptionName>
</VariantSelected>
<VariantSelected>
<VariantGroupInfoName>Farve emhætte</VariantGroupInfoName>
<OptionName>Hvid</OptionName>
</VariantSelected>
<VariantSelected>
  <VariantGroupInfoName>Motor type</VariantGroupInfoName>
  <OptionName>Med motor</OptionName>
  </VariantSelected>
  <VariantInfo>
  ... all the nesting as today ...
    </VariantInfo>
</variantInfo>
 
I'll see if I can find some time to describe a detailed feature request on <VariantInfo> improvments.

Br. Michael Knudsen

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Michael

It will be an alternative to VariantInfo - but that is just a technical detail. And the mentioned extensions might already have it, we just need to expose it for you on the feed.

So question is what would be a good format for a 3+ level deep variants.

Looking forward to your feedback.

 

You must be logged in to post in the forum