Skip to main content

How can I pull the name of the most expensive product out using code?

Here's what I'm trying to achieve…

I want to create an email to gather reviews for the most expensive item in a sales order.

Say, John ordered three items:

  1. Item A: $200

  2. Item B: $500

  3. Item C: $100

I want John to review Item B (the most expensive product) by replying to the email.

The Ideal Outcome:

Hey John, would you be willing to give me a testimonial for {{ most expensive item in an order }}?

------------------------

Please let me know if this is possible. Thanks for your help!

Hi @ezreal,

 

Thanks for reaching out to the Klaviyo Community!

 

At this time we are unable to filter the products displayed based on the most expensive item in the order. You do have a few other custom display options:

  • Because items in an order are stored as lists, you do have the option to only display the first, second, etc item in an order. 
  • You could have a play around with django tags to apply if/else logic so that these emails only display items over a certain value. 

Both of the recommendations above would require custom work on the dynamic table blocks. If you need help configuring this, feel free to review our agency partners directory

 

Have a great weekend!

Julie


Reply