Developer forum

Forum » Ecommerce - Standard features » Custom field on variants

Custom field on variants

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Maybe a bad title, but I'll try to explain my self :P

We have some products, which each have some variants (size/color).
As default we can see that this is handled as 1 product in EcomProducts, and with a list of variant combinations, all good.

Now lets say we want to add some data to each variant option, in our case EAN. Since EAN is a result of model, size and color in combination we need it to be added to the variant combination.
We have tested this by first adding separate teaser texts on each variant combination, since that works out of the box. It looks like a good solution, until we saw what really happened behind the scenes. DW had created a new product for each product we did add custom teaser text for, and I guess this is "working as expected", but it did have some implications that was unfortunate.

First of all when we tried to use the "Promotion" module in Rapido, and tried to search for the correct product we got one record for each of the combinations with custom teaser text. It made it impossible to find the correct product, and it looked messy. Before the changes we got only one record, even though there was more variant options. And second of all we got the products listed multiple times in the product list.

My question would then be; is it possible to add something like EAN to a variant combination without haveing to create a whole new instance of the product?


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Martin,

 

Once you add specific data to a variant (like stock and EAN number), Dynamicweb starts keeping it's own record. It's been like that since ever. It's what it calls Extended Variants.

 

However in your queries you can add an expression to only load documents where IsVariant is false and that will give you only the "main" product record.

 

Let me know if I understood you correctly and if that worked out for you.

 

Best Regards,

Nuno Aguiar

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Hi Nuno, and thanks for you answer.

Yes, I found out I could use that in the frontend.
But there is still a big problem in the backend, in the cases you would like to search for a product, lets say in the promotion module.
It then looks like this (screenshot), and it does not look good.

 

2018-05-28_1526.png
 
Nicolai Pedersen
Reply

Hi Martin

Usually you have different SKUs and it will look better, but not awesome. It is the backlog to make it more neat.

BR Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Martin,

 

I see. That makes sense. In fact I had requested some improvements to that UI (although from trying to assign related products).

 

Best Regards,

Nuno Aguiar

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply
Ok, but I just want to confirm that this is the best practice DW way of doing it, or if there is another way to add custom data to variant option combinations.
 
Nicolai Pedersen
Reply

Yes, that is best practice. I am very sure you do not want it differently in the long run...

 

You must be logged in to post in the forum