Custom user defined fields on the checkout page

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
myvo04
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 29
Joined: Thu Apr 24, 2008 8:14 am

Custom user defined fields on the checkout page

Post by myvo04 » Tue Mar 03, 2009 12:07 pm

We would like to add some custom fields to the checkout page and would like that information stored in the order summary to be retrievable in the admin interface for later reference. How would you recommend accommodating user-defined fields such as this in the customer user interface and the administration site?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom user defined fields on the checkout page

Post by mazhar » Wed Mar 04, 2009 10:16 am

You can either create your custom table to join custom information with orders or you can make use of ac_CustomFields table.
Read the following thread for ac_CustomField usage
viewtopic.php?f=42&t=8651

fchilvarguer
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Mon Mar 23, 2009 12:38 pm

Re: Custom user defined fields on the checkout page

Post by fchilvarguer » Mon Mar 23, 2009 12:44 pm

I'm evaluating AbleCommerce at the moment and I'm having a hard time finding documentation on how to add custom fields to the Order object.

What I am trying to accomplish: Add 2 marketing questions to the checkout page and have the answers be stored with the associated Order.

Can anyone point me where I can find:
1. What table(s) do need to be modified/created? Should I use the ac_CustomFields table?
2. How/Where do I change the Order object to add those new properties? It seems that the Order class is in the CommerceBuilder.Orders namespace and there's no source code to it.

Any information would be great.

Thanks,
Fernando

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom user defined fields on the checkout page

Post by mazhar » Tue Mar 24, 2009 4:14 am

2. How/Where do I change the Order object to add those new properties? It seems that the Order class is in the CommerceBuilder.Orders namespace and there's no source code to it.
Yes its in back end code and you can't modify it.
1. What table(s) do need to be modified/created? Should I use the ac_CustomFields table?
Yes either you can use ac_CustomFields or you can create your own table store this information and link to order table. Then you can use this table to store information you want to keep for order. Here are some code templates that can help you generate data access ode for your custom table

viewtopic.php?f=47&t=9530

fchilvarguer
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Mon Mar 23, 2009 12:38 pm

Re: Custom user defined fields on the checkout page

Post by fchilvarguer » Tue Mar 24, 2009 10:58 am

Thanks mazhar, I was able to generate my classes!!
So I tested everything and it all works regarding the custom class and DAL.

So moving to the next issue: where in the checkout process would I add my custom code to write the new fields?

I added my text boxes to ConLib/OnePageCheckout.aspx but I can't find the code where the order is actually saved on ConLib/OnePageCheckout.aspx.cs. I need the Order number as the key to my custom table so I can insert my custom information.

I've been mainly looking at the CheckedOut and CheckingOut methods but I can't find it...

Am I looking at the wrong place? Am I blind? :)

Thanks again,
Fernando

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom user defined fields on the checkout page

Post by mazhar » Tue Mar 24, 2009 11:04 am

Order is created in backend code. The very first location where order id is available is CheckedOut method of OnePageCheckout. You can access order id in there using

Code: Select all

e.OrderId
The other solution could be to put your textbox and code on MyReciept page.

fchilvarguer
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Mon Mar 23, 2009 12:38 pm

Re: Custom user defined fields on the checkout page

Post by fchilvarguer » Tue Mar 24, 2009 4:06 pm

GREAT! Thanks for all your help.

So I was able to implement my customizations without a problem. The customer answer my custom questions during checkout and I'm able to capture that information in the database.

Next, I used the Data Port to export Orders from my store. Of course, as expected, my custom fields were not there.

QUESTION: What's the suggested method of retrieving that custom data? Is there a web service I can modify to export that data as part of the Order?
I'm trying to avoid having to export the orders via Data Port then exporting my custom fields "manually" by querying the database and assembling it all together on my end.

Is there a way to easily accomplish this?

Thanks.
Fernando

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom user defined fields on the checkout page

Post by mazhar » Wed Mar 25, 2009 4:06 am

No custom data can't be imported as a part of order using DataPort.

fchilvarguer
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Mon Mar 23, 2009 12:38 pm

Re: Custom user defined fields on the checkout page

Post by fchilvarguer » Wed Mar 25, 2009 10:31 am

I'm actually trying to EXPORT the custom data.

So what I'm trying to figure out is here is the API/WebService method that Data Port uses to export data and modify it so
when a user uses Data Port to export order data, the custom fields will be part of the Orders XML structure.

Thanks,
Fernando

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom user defined fields on the checkout page

Post by mazhar » Wed Mar 25, 2009 10:44 am

No the support DataPort uses is not meant or can be used for custom use. You can write you own web service which can load and expose the order.

Post Reply