3 replies [Last post]
chibiaida's picture
Offline
Joined: 08/08/2007
Juice: 57
Was this information Helpful?

How would one go about adding new checkout fields?

Also, we need to make the selection of some checkout fields mandatory (namely, "zone" and a shipping option, otherwise taxes and shipping does not get calculated into the total price during checkout - and there are people who decide to not tell us which state they're ordering from). Any ways to do that?

Thanks!!

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 74
bump

I'm trying to figure this one out for myself. I want to make phone number mandatory to fill out and add some little blurbs underneath the fields.
Any ideas?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: bump

You can change the names, availability, and requirements of address fields at /admin/store/settings/checkout/edit/fields. To add descriptive text... I'm not sure. You might be able to use hook_form_alter().

To add new checkout fields, you have to look into the checkout pane API (documented in the developer's guide). I made an example "Lead Tracker" module, though it may need to be updated for the most recent versions of UC.

bloke_zero's picture
Offline
Joined: 03/24/2009
Juice: 62
Adding a description

In case any one is searching this is how to write the module that will add a description to the address fields:

function sitehelper_form_alter($form_id, &$form) {
if($form_id == 'uc_cart_checkout_form'){
$form['panes']['delivery']['delivery_postal_code']['#description'] = 'Please type n/a here if not applicable.';
}
}

replace sitehelper with your module name.

------------------------------
http://zero-design.info