Commerce Server General - Checkout - saving to order user-defined subtotal

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > September 2005 > Checkout - saving to order user-defined subtotal





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Checkout - saving to order user-defined subtotal
Ripos

2005-09-21, 5:52 pm

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
Colin Bowern

2005-09-21, 5:52 pm

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


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



Ravi Shankar

2005-09-21, 5:52 pm

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:

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

Ripos

2005-09-22, 8:58 pm

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 Dictionar=
y =

of a
LineItem object?

PS. your answer was Very helpful. Thank you.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com