| Author |
Message |
Ripos
Guest
|
Posted:
Wed Sep 21, 2005 4:51 pm Post subject:
Checkout - saving to order user-defined subtotal |
|
|
In the Cart class we define our own scheme of calculating SubTotal field..
That's OK for showing it in the ShoppingCart, but when we use
SaveAsOrder(), then
original field is saved.
All instances of this field is read-only and the class Basket is sealed in
the assembly.
How can we save our own SubTotal field to the order?
We use CS2002+FP1+SP3+Starter site |
|
| Back to top |
|
 |
Colin Bowern
Guest
|
Posted:
Wed Sep 21, 2005 4:51 pm Post subject:
Re: Checkout - saving to order user-defined subtotal |
|
|
Hello Ripos,
When you execute a SaveAsOrder the returning value is a PurchaseOrder object.
That is where you should be pulling values from after executing that method.
You can access all of the fields at the Order Group or Order Form level
through that object. The PurchaseOrder object is essentially a dictionary
object so all fields, like in the basket and order form objects, are accessible
with keys (e.g. Receipt["saved_cy_total_total"])
If you want to persist your own fields in the database outside of the marshaled
data contents you need to create a column in the table with the same key
name. For example we have added several fields to the database:
saved_cy_oadjust_subtotal
saved_cy_orderlevel_discounts_subtotal
saved_cy_shipping_total
etc..
Hope that helps.
Colin
| Quote: | In the Cart class we define our own scheme of calculating SubTotal
field
.
That's OK for showing it in the ShoppingCart, but when we use
SaveAsOrder(), then
original field is saved.
All instances of this field is read-only and the class Basket is
sealed
in
the assembly.
How can we save our own SubTotal field to the order?
We use CS2002+FP1+SP3+Starter site
|
|
|
| Back to top |
|
 |
Ravi Shankar
Guest
|
Posted:
Wed Sep 21, 2005 4:51 pm Post subject:
RE: Checkout - saving to order user-defined subtotal |
|
|
Hi Ripos,
The SubTotal is calculated in the "Basket" pipeline through a component. You
should replace it with one that calcualtes the subtotal the way you want it.
You would need to write this component.
--
Ravi Shankar
"Ripos" wrote:
| Quote: | In the Cart class we define our own scheme of calculating SubTotal field..
That's OK for showing it in the ShoppingCart, but when we use
SaveAsOrder(), then
original field is saved.
All instances of this field is read-only and the class Basket is sealed in
the assembly.
How can we save our own SubTotal field to the order?
We use CS2002+FP1+SP3+Starter site
|
|
|
| Back to top |
|
 |
Ripos
Guest
|
Posted:
Thu Sep 22, 2005 4:51 pm Post subject:
Re: Checkout - saving to order user-defined subtotal |
|
|
Ok. This is a good solution. But can you help me with understanding of
mapping
dictionary keys to the columns of DB.
Consists resulting Order object of OrderGroup's columns only?
Some of columns (such as 'saved_cc_number') are found at OrderFormHeader..
How can
I wrote to those fields?
If some fields are in OrderLineItems table, have I to write to Dictionary
of a
LineItem object?
PS. your answer was Very helpful. Thank you. |
|
| Back to top |
|
 |
|
|
|
|