Microsoft KB Archive/216940

= How to Use a Scriptor to Sum the Price of All of Items in an OrderForm =

Article ID: 216940

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Commerce Edition

-



This article was previously published under Q216940



SUMMARY
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.



MORE INFORMATION
 Insert a Scriptor in the Order Subtotal Stage. Replace [_oadjust_adjustedprice] with the item that you want to sum.  Replace [_oadjust_subtotal] with a new property of the orderform, which can be created in the scriptor by simply referencing it in this line of code: 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 

Keywords: kbhowto KB216940

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.