Page 1 of 1
Custom user defined fields on the checkout page
Posted: Tue Mar 03, 2009 12:07 pm
by myvo04
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?
Re: Custom user defined fields on the checkout page
Posted: Wed Mar 04, 2009 10:16 am
by mazhar
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
Re: Custom user defined fields on the checkout page
Posted: Mon Mar 23, 2009 12:44 pm
by fchilvarguer
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
Re: Custom user defined fields on the checkout page
Posted: Tue Mar 24, 2009 4:14 am
by mazhar
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
Re: Custom user defined fields on the checkout page
Posted: Tue Mar 24, 2009 10:58 am
by fchilvarguer
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
Re: Custom user defined fields on the checkout page
Posted: Tue Mar 24, 2009 11:04 am
by mazhar
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
The other solution could be to put your textbox and code on MyReciept page.
Re: Custom user defined fields on the checkout page
Posted: Tue Mar 24, 2009 4:06 pm
by fchilvarguer
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
Re: Custom user defined fields on the checkout page
Posted: Wed Mar 25, 2009 4:06 am
by mazhar
No custom data can't be imported as a part of order using DataPort.
Re: Custom user defined fields on the checkout page
Posted: Wed Mar 25, 2009 10:31 am
by fchilvarguer
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
Re: Custom user defined fields on the checkout page
Posted: Wed Mar 25, 2009 10:44 am
by mazhar
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.