This drupal 6.x module allows the creation of a ticket. In line 862 of uc_node_checkout.module, you see the code setting the Order ID value when the checkout process is completed. It takes the Order ID value from the completed ubercart order and writes to the ticket information table in the field [field_print_orderid_value], in the row that corresponds to the newly created ticket(s). Likewise, line 871 shows the section that takes the User ID value of the completed ubercart order and copies it over to the ticket information table in the field [field_printable_uid_value]. Again in the same way at the same time, line 880 shows the function of copying the order's status value to the "content_type_ticket_printable" table in the corresponding ticket's row. The row = field_printable_paidstatus_value.
**Note: The destination fields for these three functions, are not set in uc_node_checkout.module. Instead, they are decided by uc_node_checkout.admin.inc. There is a administrative form created where an administrator can assign these destination fields dynamically. The selectors are found on lines 122, 130, and 146 respectively.
These functions work great, but more functions are needed:
1. Line 893-900 of the module file is an improvisation by me. What I was trying to accomplish is pulling a value from a third table that relates to the order, and pasting it into the ticket information table. This isn't working, because the original value isn't in the order table... instead the value we need is in a separate table with a corresponding order identifier (order_id field). Although the original value is coming from a different place in the database, it needs to be written to the same "content_type_ticket_printable" table, into the "field_printable_aid1_uid" field.
uc_orders table (order_id field) -> uc_affiliate2_orders Table (order_id field) -> uc_affiliate2_orders Table (aid field)
That AID field is the value that needs to be copied over to field_printable_aid1_uid.
2. Three values of each created ticket need to be filled upon order creation, all with the same value. The value needs to be a combination of [field_printable_uid_value] + 33 + [ticket's NID value]. Note: All of the source fields and destination fields are in the same "content_type_ticket_printable" table.
Consequentially, after a ticket is purchased, all of the following fields should be filled by this section of the drupal module:
a. "field_print_orderid_value" (Done already)
b. "field_printable_uid_value" (Done already)
c. "field_printable_paidstatus_value" (Done already)