Hi DW.
I am trying to include the Gift Card code in my order receipt but it simply won't show. In my last step of the checkout flow I am showing the customers Receipt and I can get the Gift Card tags fine here:
if (!String.IsNullOrEmpty(GetString("Ecom:Order.HasGiftCards")))
{
foreach (var gc in GetLoop("GiftCards"))
{
<h2>@gc.GetString("Ecom:Order.GiftCard.Name")</h2>
<p><b>@Translate("giftcardcode", "GiftCard code")</b></p>
<p>@gc.GetString("Ecom:Order.GiftCard.Code")</p>
<p><b>@Translate("expirydate", "Expiry Date")</b></p>
<p>@gc.GetDate("Ecom:Order.GiftCard.ExpiryDate").ToString("dd MMM yyyy")</p>
}
}
But when I try to use the above in my e-mail template receipt it simply does'nt show.
if (!String.IsNullOrEmpty(GetString("Ecom:Order.HasGiftCards")))
{
<tr>
@foreach (var gc in GetLoop("GiftCards"))
{
<td colspan="3">@Translate("giftcardcode", "GiftCard code"): @gc.GetString("Ecom:Order.GiftCard.Code")</td>
<td colspan="3">@Translate("expirydate", "Expiry Date"): @gc.GetDate("Ecom:Order.GiftCard.ExpiryDate").ToString("dd MMM yyyy")</td>
}
</tr>
}
I've also tried tying it to my orderline loop like; foreach (LoopItem ol in GetLoop("OrderLines")) -> ol.GetString("Ecom:Order.HasGiftCards") and ol.GetLoop("GiftCards") but none of the attempts works. Can you please direct me towards the correct tags in the e-mail receipt?