ShoppingCart.CartItems with ProductOptions in EMailTemplate macro

Dave B asked on March 13, 2015 16:16

Hi,

I'm trying to update an email template that loops through the items in the cart and displays a transformation for each. I'd like to use CartItems instead of ContentTable because of the strong-typing. I've been trying something like this:

{% foreach (item in ShoppingCart.CartItems) { %}
    {% item.ProductOptions.Count %}<br />
{% } #%}

but obviously it's not working. Any ideas?

Recent Answers


Virgil Carroll answered on March 14, 2015 16:43

Are you sending this email after the order is complete? If so the shopping cart has already been emptied and put into the order prior to this email being sent out. You need to access the final order data to do this.

0 votesVote for this answer Mark as a Correct answer

Dave B answered on March 16, 2015 21:04

Hey Virgil,

This is actually before payment, so I believe the Shopping Cart items still exist. I got some direction from Kentico Support to use a custom macro to accomplish this. Thanks for the response!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.