Solved

Product variant title : 'default title' problem

  • 18 February 2023
  • 2 replies
  • 587 views

Badge +1

Hi, 

I have a problem with my order confirmation email.

In the 'order summary' part, I need to display both the title of each product, but also their variant.

Problem: for products that have no variants, I can't remove the 'Default Title'...

This is what I have done so far:

And this is how it work for a product that have no variant :

I need to display nothing for products that don't have variants, while displaying the name of the variants for products that do.

 

Thank you for your help !

 

PS: for products WITH variants, it works very well.

icon

Best answer by stephen.trumble 21 February 2023, 18:25

View original

2 replies

Userlevel 7
Badge +60

Hey @tomskasparov 

Thank you so much for reaching out for help with your template variables.

In this situation, you would want to set up if/else logic to show different content based on whether the variant exists. it will look something like this.

This will show the variant title if there is one or the main product title if there isn’t. The article I linked above talks about if/else logic so you can take a look at how this logic works. Hope this helps!

Badge

Hey @tomskasparov 

Thank you so much for reaching out for help with your template variables.

In this situation, you would want to set up if/else logic to show different content based on whether the variant exists. it will look something like this.

This will show the variant title if there is one or the main product title if there isn’t. The article I linked above talks about if/else logic so you can take a look at how this logic works. Hope this helps!

Hey, Steven! Thanks for this explanation! I am fairly new to Klaviyo and I have tried adding the above code lines to the Klaviyo template, but with no luck. I again get the variant name (or default). Could you please help me to understand where should this code be implemented and which portion of the above 3 paragraphs? Maybe I am copying more/less than it should. Thanks!

Reply