Checkout - saving to order user-defined subtotal
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Checkout - saving to order user-defined subtotal

 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server
Author Message
Ripos
Guest





Posted: Wed Sep 21, 2005 4:51 pm    Post subject: Checkout - saving to order user-defined subtotal Reply with 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
Colin Bowern
Guest





Posted: Wed Sep 21, 2005 4:51 pm    Post subject: Re: Checkout - saving to order user-defined subtotal Reply with quote

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 Reply with quote

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 Reply with quote

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
 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB