Developer forum

Forum » Ecommerce - Standard features » Best combination of expressions for displaying all SKU (Variant or Master)

Best combination of expressions for displaying all SKU (Variant or Master)

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to figure out the best combination of expressions for displaying every SKU that can be ordered.

By this, I mean if a product has variants, I want to display the variants but not the master product. If a product does not have variants, I want to display the master product (although in this case, it's simply a product because it does not have variants).

What would be the best combination of Expressions in the query?

Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I believe this will do it:

The first one will only include masters with no extended variants or where no of the extended variants are marked as "show in list". Then you can use the checkbox on products to enable variants in the list - i.e. if you only want to show the colors, but not sizes (2nd dimension)

Secon expression will add all extended variants to the result - i.e. blue-small, blue-medium etc.

But it depends on you variant structure - do you have more than one level - do you have both products with one and 2 levels etc.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I believe this will do it.

I only have one level variants.

So far I have tried:

But I believe that your suggestion is more elegant and more suitable for the purpose.

Thank you,

Adrian

 

You must be logged in to post in the forum