I'm working on a site where I need to add some custom fields to the checkout and order panes and then have the data from those fields added to the customer and admin notice templates, and I have a couple questions:
- I did some searching on adding tokens, and I found a couple posts with differing suggestions. This one mentions adding uc_order_token_list() and uc_order_token_values() functions to my module from uc_order.module. If I do that, do i have to keep all the definitions that are there and add my own, or can I just put my own in the function, and it will add them to the ones that already exist?
Then, this post says I can just access the $order object directly in the template itself. Is it six of one and 1/2 dozen of the other? The only time I will be using these extra fields is in the checkout and order forms as well as the email templates.
- I've been reading through the Lead Tracker module for a few hours now, and I just want to make sure I have this hook calling order for saving the data correctly understood (I had a whole question written on how the lead_source field gets converted to arg1->lead['source'], but I figured it our right before I submitted this post).
- hook_checkout_pane() displays form as defined in the callback parameter. This form has an ID value that is used to define the callback function name.
- The callback form uc_checkout_pane_paneID() where$op = 'view' is called to display the pane and add the new fields to the checkout page.
- On form submission, uc_checkout_pane_paneID() is called where $op = 'process'. At this point, form data is in $arg2, and you have to move it manually to $arg1, which is the order object.
- hook_order() is called where $op = 'save', and this is where you write your code to write the data to the database.
Do I have that correct?
By the way, thanks for the Lead Tracker module. I would still be thrashing around in the dark without that as an example.
Thanks.




Joined: 02/20/2008