Developer forum

Forum » Ecommerce - Standard features » Showing multiple variation names i Cart

Showing multiple variation names i Cart

Michael Houmark
Reply

Hi,

When adding 'multidimensional' variations of products (eg. color and size). Ecom:Product.VariantID.Extented and Ecom:Order:OrderLine.ProductVariantID returns a combined ID of the chosen product "V01,V94", but what i really want is to show the names of the variations they represent (eg. Small and Black). (Ecom:Order:OrderLine.ProductVariantText returns "")

 

Is it possible to split the combined ID, and lookup the names of varitions? or is there an easier way to solve the problem?

 

- Michael


Replies

   
Michael Houmark
Reply

Hi Nicolai,

 

I tried something like this:

<!--@LoopStart(VariantGroups)-->
<!--@LoopStart(VariantOptions)-->
    <!--@If(Ecom:Order:OrderLine.ProductVariantID<contains>Ecom:VariantOption.ID)-->
    <div>
        <span class="variation"><!--@Ecom:VariantGroup.Name-->:</span> 
        <!--@Ecom:VariantOption.Name-->
    </div>
    <!--@EndIf-->
<!--@LoopEnd(VariantOptions)-->
<!--@LoopEnd(VariantGroups)-->

 

But the if-statement returns false, even if i try:

<!--@If(Ecom:Order:OrderLine.ProductVariantID="VO1")--> 

 

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Michael

 

Ecom:Order:OrderLine.ProductVariantID comes from outside the loop and Ecom:VariantOption.ID inside. Therefore you cannot use them together in a conditional.

You can try this though: <!--@If(Parent(Ecom:Order:OrderLine.ProductVariantID)<contains>Ecom:VariantOption.ID)-->

It might work - otherwise I think you have to convert to Razor to get full scripting capabilities.

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum