Gift Card Attributes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi,
I think I've just found a bug with the attributes that apply to a gift card - recipient name, email etc.
In ProductTemplate.SingleVariant.cshtml there is this code

@{
                    var dataDictGiftCard = new ViewDataDictionary();
                    dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = string.Format("giftcard_{0}",Model.Id);
                    @Html.Partial("_GiftCardInfo", defaultProductVariant.GiftCard, dataDictGiftCard)
                }

so the HtmlFieldPrefix is the Model.Id (ie: ProductId)

but the AddToCart method looks for a formKey using the ProductVariantId, not ProductId:

if (formKey.Equals(string.Format("giftcard_{0}.RecipientName", productVariantId), StringComparison.InvariantCultureIgnoreCase))

I changed my theme to use
dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = string.Format("giftcard_{0}", Model.ProductVariantModels[0].Id);

Repro
1) Create a product
2) Create a product variant
3) Ensure that the product.Id is different to the productVariant.Id
4) Enter recipient details
5) Attempt to Add To Cart on the gift card product in the store
6) Please enter recipient... etc alert window shows


Greg
12 years ago
Greg,

Thanks a lot. Fixed
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.