04-14-04 08:33 PM
John,
We do this frequently in our code (C# unfortunately). Perhaps the error is
not related to the new dictionary item. Here is a snippet of our code.
_orderForm = _basket.OrderForms[_strOrderFormName];
_orderForm.LineItems[k]["cy_price_override"] =
Convert.ToDecimal(priceOverride.Text);
_basket.Save();
.
William
"John" <tmorrisnospam@firsteggnospam.com> wrote in message
news:71904EB0-616E-4AA9-A0C6-977A61257D23@microsoft.com...
> Hi , I'm trying to add a custom key/value entry to a line item to indicate
gift wrap selection, here's the code:
>
> Dim thisOrderForm As Orders.OrderForm = _basket.OrderForms(0)
> Dim orderFormDict As IDictionary = thisOrderForm.Dictionary
> Dim lineItemDict As IDictionary
> Dim itemsList As ISimpleList = CType(orderFormDict("Items"),
ISimpleList)
> Dim enu As IEnumerator = itemsList.GetEnumerator()
> While enu.MoveNext
> lineItemDict = CType(enu.Current(), IDictionary)
> Dim liEnu As IEnumerator = lineItemDict.GetEnumerator()
> If Me.Sku.CompareTo(CType(lineItemDict("product_variant_id"),
String)) = 0 Then
> 'this is the line item
> If Me.IncludeGiftWrap Then
> lineItemDict("GiftWrapId") = _getGiftWrapSelection()
> Else
> lineItemDict("GiftWrapId") = String.Empty
> End If
> lineItemDict("GiftWrapMessage") = Me.GiftMessage
> Exit While
> End If
> End While
>
> _basket.Save()
>
>
> The final line, _basket.Save() throws an error about COM mismatch. It
appears to not like my adding custom properties to the line item, what am I
doing wrong?
>
> Thanks
[ Post a follow-up to this message ]
|