How to Use a Scriptor to Sum the Price of All of Items in an OrderFormID: Q216940
|
The DefaultOrderSubtotal component, which usually appears in the Order Subtotal stage of an order processing pipeline, calculates the subtotal for an order and stores the resulting value in the order._oadjust_subtotal member of the OrderForm. This value represents the sum of the item._oadjust_adjustedprice name/value pair for every item in the OrderForm?s items SimpleList. The DefaultOrderSubtotal component cannot be used to sum the prices if the price associated with a particular item is not reflected in the item._oadjust_adjustedprice name/value pair. It is still possible to sum the price of the all of the items in the OrderForm. This can be useful in situations where two prices are associated with a single item and a sum of all prices needs to be computed.
y=0
for each x in orderform.items
y = y + x.[_oadjust_adjustedprice] * x.[quantity]
next
orderform.[_oadjust_subtotal] = y
MSCSExecute = 1
end function
sub MSCSOpen(config)
end sub
Additional query words:
Keywords :
Version : winnt:3.0
Platform : winnt
Issue type : kbhowto
Last Reviewed: May 21, 1999