How can i convert OrderForm("_discounts") to a simplelist
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 > How can i convert OrderForm("_discounts") to a simplelist




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

    How can i convert OrderForm("_discounts") to a simplelist  
Ajay


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


 
04-06-04 07:35 AM

I have to convert OrderForm("_discounts") to a simplelist, since i
have to search for some items . But its giving cast type error.
Actually I am working on 'Gift With Purchase', so that i have to
manually find the free items and add to basket.

Thanks for any help

Ajay





[ Post a follow-up to this message ]



    RE: How can i convert OrderForm("_discounts") to a simplelist  
Jorge Sanchez


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


 
04-06-04 08:43 PM

Hi Ajay

Look at these lines, may be you can find them a little interesting.

basketDiscountListItems = CType(txContext.CartOrderForm.Item("_qualifying_di
scounts"), SimpleList)
allDiscounts = CType(txContext.CartOrderForm.Item("_discounts"), ContentList
)
For Each basketDiscountItem In basketDiscountListItems
freeDiscount = allDiscounts.Search("item_id", basketDiscountItem)
If CInt(freeDiscount.Fields("order_level").Value) = 0 Then ' ITEMLEVEL
If CInt(freeDiscount.Fields("offer_type").Value) = 2 Then ' Percentage
If CInt(freeDiscount.Fields("offer_value").Value) = 100 Then
' Assume: EXPRESSION NAME = PRODUCT ID
tempExprID = freeDiscount.Fields("award_expr").Value
Dim prodID as String = expressionStoreObj.GetExprName(CInt(tempExprID))
' If the product doesn't have variants then you can add it to the basket.
End If
End If
End If
Next

Just for reference:

Dim tempExprID as Object
Dim basketDiscountListItems as SimpleList
Dim allDiscounts as ContentList
Dim freeDiscount as RowCollection
Dim basketDiscountItem As Object

Hope this help.

Jorge






[ Post a follow-up to this message ]



    RE: How can i convert OrderForm("_discounts") to a simplelist  
Ajay


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


 
04-07-04 11:58 AM

Hi Jorge,
Thanks a lot for your help. I could solve my problem.

Regards
Ajay
>-----Original Message-----
>Hi Ajay
>
>Look at these lines, may be you can find them a little
interesting.
>
>            basketDiscountListItems = CType
(txContext.CartOrderForm.Item("_qualifying_discounts"),
SimpleList)
>            allDiscounts = CType
(txContext.CartOrderForm.Item("_discounts"), ContentList)
>            For Each basketDiscountItem In
basketDiscountListItems
>                freeDiscount = allDiscounts.Search
("item_id", basketDiscountItem)
>                If CInt(freeDiscount.Fields
("order_level").Value) = 0 Then ' ITEMLEVEL
>                    If CInt(freeDiscount.Fields
("offer_type").Value) = 2 Then ' Percentage
>                        If CInt(freeDiscount.Fields
("offer_value").Value) = 100 Then
>                            ' Assume: EXPRESSION NAME =
PRODUCT ID
>                            tempExprID =
freeDiscount.Fields("award_expr").Value
>                            Dim prodID as String =
expressionStoreObj. GetExprName(CInt(tempExprID))
>                            ' If the product doesn't have
variants then you can add it to the basket.
>                        End If
>                    End If
>                End If
>            Next
>
>Just for reference:
>
>Dim tempExprID as Object
>Dim basketDiscountListItems as SimpleList
>Dim allDiscounts as ContentList
>Dim freeDiscount as RowCollection
>Dim basketDiscountItem As Object
>
>Hope this help.
>
>Jorge
>
>.
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:54 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