Add a field (select/dropdown) to one page checkout
-
- Ensign (ENS)
- Posts: 9
- Joined: Mon Jul 18, 2011 7:47 am
Add a field (select/dropdown) to one page checkout
What is the code to add a select field or dropdown to the One Page Checkout? Ideally, we would want a select field on the first panel of the One Page Checkout, and this field would dump whatever the user selected into the admin somewhere. Help would be greatly appreciated.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Add a field (select/dropdown) to one page checkout
It's hard to add one on the first panel because that part is hidden when the payment forms come up and the selection is lost. I have done it by saving the selection to usersetting field and then changing it to an order customfield on the receipt page. Whenever I run into something like this, that is what I do because of hours spent in the past trying to do something like that on the checkout page. I learned to quit trying to fight the page and just do a work around.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Add a field (select/dropdown) to one page checkout
digdesigner, just so you know, this is not any kind of quick simple thing that you ask. It involves a lot of custom programming that you need to be prepared for. The general steps are as follows...
(Btw, If you're not already familiar with doing these things from other projects, I highly recommend that you not attempt to do this on your own. Find an ASP.NET developer that you can work with.)
First, you'll need to have the info related to the order somewhere, which means that you need to add a field to the orders table in the database. Personally, I don't like to edit the AC tables, so I create my own custom tables that are related to the existing tables, but that's not strictly necessary. I recommend at LEAST creating a prefix for the field unique to you that AC would never use, such as "dd_", so you could call your info field "dd_info", and set the datatype to be nvarchar(max) field.
Second, you need to determine where in the admin panel you're going to view/manage this info. Probably on the View Order page, so then you'll need to update that page to display the info out of the database.
Once all that's prepared, then and only then can you update the Checkout to receive this info from the user and store it. That is definitely a customization to the ConLib\OnePageCheckout.ascx user control. You need to customize one of the appropriate event handlers to read your DropDownList and update the database.
I also highly recommend that you program this in a way such that future updates from AbleCommerce don't overwrite it, and so that you can tell if something's changed. I manage all of my customizations by creating customized copies of the ConLib controls, and using my customized controls, instead of the default ones, from the Scriptlets.
(Btw, If you're not already familiar with doing these things from other projects, I highly recommend that you not attempt to do this on your own. Find an ASP.NET developer that you can work with.)
First, you'll need to have the info related to the order somewhere, which means that you need to add a field to the orders table in the database. Personally, I don't like to edit the AC tables, so I create my own custom tables that are related to the existing tables, but that's not strictly necessary. I recommend at LEAST creating a prefix for the field unique to you that AC would never use, such as "dd_", so you could call your info field "dd_info", and set the datatype to be nvarchar(max) field.
Second, you need to determine where in the admin panel you're going to view/manage this info. Probably on the View Order page, so then you'll need to update that page to display the info out of the database.
Once all that's prepared, then and only then can you update the Checkout to receive this info from the user and store it. That is definitely a customization to the ConLib\OnePageCheckout.ascx user control. You need to customize one of the appropriate event handlers to read your DropDownList and update the database.
I also highly recommend that you program this in a way such that future updates from AbleCommerce don't overwrite it, and so that you can tell if something's changed. I manage all of my customizations by creating customized copies of the ConLib controls, and using my customized controls, instead of the default ones, from the Scriptlets.