Add to marshaled_data in BasketGroup
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > Add to marshaled_data in BasketGroup




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Add to marshaled_data in BasketGroup  
John


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-04 09:27 PM

Hi , I'm trying to add a custom key/value entry to a line item to indicate g
ift 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 T
hen
'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 appea
rs to not like my adding custom properties to the line item, what am I doing
 wrong?

Thanks





[ Post a follow-up to this message ]



    Re: Add to marshaled_data in BasketGroup  
William Hickson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: Add to marshaled_data in BasketGroup  
David Messner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-04 09:35 PM






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:13 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register