Developer forum

Forum » Ecommerce - Standard features » Variant relations in Ecom Assortments

Variant relations in Ecom Assortments

Barend Mosch
Reply

Hi there!

I've encountered a slight confusion about the way product-assortment relations are made in the database.

As far as I know a product can be part of one or more assortments, declared by a new record in the EcomAssortmentProductRelations with the productId and its variantId (empty for master products).

My question being, why is the variant ID here?

What is the idea behind assigning specific variants to assortments? Isn't assigning the master product to a different assortment the same?
In the current example product 121109 resides in assortment 'CoreCore' while one of its variants is assigned to assortment 'MatthewCore'.


In DW the product and all its variants are visible in both assortments.



The solution in question has products with over 1000 variants. Currently the master product and all variants have a record in the Assortment product relation table with exactly the same assortmentIDs. Is it necessary to create variant relations as wel?

Multiple questions here, hopefully this illustrates my confusion. Thanks in advance,

Barend Mosch


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

We have customers that use variants in assortments. Or family products - you can buy A, but not B in a family. I do not know why that is needed, but apparantly it is...

If you want a master and all its variants to be in an assortment, just include the master in the relation.

 

Votes for this answer: 1
 
Barend Mosch
Reply

Hi Nicolai,

Thanks for the quick response!

So its safe to assume that if all variants share the same assortment as the master, there is no need to create the variant relations. 1 master product-assortment relation is enough.

What if 1 variant in the family group differs? Should there be no master product - assortment relation?

Say the following test case:

Family product with 2 variants, no master product - assortment relation since that would add all variants to the assortment. But 2 different assortments 1 for each variant.

Im seeing the following in the Assortment interface in the Ecom: (same for MatthewsCore)

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

While I'm trying to dissuade a customer from their intended solution, it has still led me to some questions to fully understand the ootb behaviour of assortments.

So here goes:

  • If I only add variants to the assortment and not the master, what do I need to do on the product query connected to the Product Catalog App to show these products, since the masters are not in the assortment should I filter the list to variants?
  • Will I then be able to mix single products and variants, and what are the steps involved?
  • Will the Variant Selector (in Swift2) only show the variants in the assortment

Thanks,

Justin

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

@1: Yes - you would have to include variant records in the search result.

@2: If you just search products - without filtering variants or masters, you would get single products and variants. Then you can probably play with ismaster, isvariant etc in combos that gives you what you need.

@3: I believe that would be the case. Technically we are loading variant combinations and each combination has a product record - and that product record is checked for assortment.

 

You must be logged in to post in the forum