Here's what I need to accomplish: I've got a event registration site that uses UC Node Checkout linked to a custom content type to collect registrant data (as per this tutorial). What I need is a list of these participants that includes this collected data but that ALSO includes fields for the price attribute of the "purchased" node as well as some customer information collected by ubercart such as "billing address".

Let me know if you have any ideas. Its much appreciated.

Sincerely

GB

Comments

jon nunan’s picture

Have you seen this module: http://drupal.org/project/uc_views ?

Haven't tried it myself, but it does purport to include an 'orders' view.

If that doesn't work you may want to look into the table wizard module:
http://drupal.org/project/tw

Not sure on your level of knowledge with databases and the like, but if you know a bit you should be able to set up the relations you need and expose the ubercart tables to a view.

gtothab’s picture

Hey,

Thx for the reply. So i installed tw and its pretty cool. Unfortunately I dont have much background in mysql and dont have a firm grasp on table joins. I was wondering if you could help me out a bit.

Since I need to display the data the user fills into the custom content type (registrant profile) and also ubercart's internal "order status" data I assume that I need to join the registrant_profile table with a table called: uc_order_statuses. I've done this but I have no idea which rows to select as keys. Im not even sure if i should be using the registrant profile table or the node's table and choosing the node's ID as the key.

Here are some screenshots:

1. The registrant profile table analized: http://www.event.graph-byte.com/registrant.png

2. The order statuses table analized: http://www.event.graph-byte.com/statuses.png

Thanks so much.

GB

jon nunan’s picture

OK, might be a bit hard to do just through a forum, but I'll try. (make sure you back up everything)

I'm making some assumptions. One 'registrant profile' can have multiple 'orders' right'?

If so, you want a primary key on 'registrant profile', it should be a column that has a unique number for every row. You want to make sure that's an 'Available key' in the table wizard. In the 'order status' table there should be a column that contains the same key. You may want to make a dummy order and check the profile number against the columns in the 'order status' table. The column that matches in the 'order status' table is known as a foreign key, so in the 'table wizard' you want to identify it as an 'available key' but not a 'primary key'.

Once you've identified it, you should be able to go into 'Table Wizard > Relationships', you want to select your 'registrant profile' table as the base table and 'Order status' as the related table. Then choose the related keys between the two.

I get the feeling your screenshots don't show all the fields you have available so I'm hesitant to tell you which 2 fields they are. In fact, I think you may need a 3rd table with user ID as I think that maybe the common relationship between them all.

gtothab’s picture

Hi

Sorry for the delay in writting back i've been out of town.

"In the 'order status' table there should be a column that contains the same key"

Right now there are no columns that exist in both tables. This probably means that I'll need a third table to act as the bridge between them does that sound right? Are you familiar with uc_node_checkout? This is the module which creates relationship between the registrant profile content type and ubercart. I'm thinking the uc nodecheckout table might be the one needed to build the connection.

Struggling,

Gtothab