Skip to main content

Posts

Showing posts from January, 2011

Drupal: Ubercart before 3.x does not use FAPI

Well, not completely at least. This is what is the conclusion after trying for some days now to add extra fields in Ubercart's cart checkout page. As I found out in Stella's blog, I have to use hook_checkout_pane() to create a new pane in checkout page. It was a bit complicated at first glance and I didn't have enough time to work it out this way. More specifically, I wanted the user to fill-in a form, saving extra information to the system, before being able to really checkout. What I did to solve the problem I was facing, was to use the usual hook_form_alter() function to create a new [#validate] callback for the form. In this validate function, I checked whether the function was filled with the necessary fields and if not, a form_set_error('submit','message_shown_to_the_user_here') is called.