29 replies [Last post]
Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Was this information Helpful?

I'm working on creating a site for an art school, and I want to use Ubercart for class registration. From everything I've read, it looks like uc_node_checkout module is the way to go, but I'm having a hard time wrapping my head around how it works exactly. I understand that you create a Product node for the class, and then another node type for the registration, so that when the user creates a node of the Registration type, the Product type (i.e. the class) is added to the shopping cart.

My question is, how exactly do I create the class and registration nodes? Since there are something like 200 possible classes, do I need to create 200 Product nodes? Or do I create a different product class for each course type (i.e. painting, sculpture, etc.)? Then, do I just need one Registration node type with something like a node reference field that lists all the classes? How exactly would the user be able to select the appropriate class?

Thanks for the help.

klavsk's picture
Offline
Joined: 02/17/2009
Juice: 131
Re: Using Node Checkout for class registration

I'm not that experienced with that, but one way I see to do it, is using product classes.
http://www.ubercart.org/docs/user/3341/understanding_product_classes

that'll create a new content-type (a derivative of product) which you could call "class".
And then you'll have to create 200 nodes of type class (or how many classes you have) - but you could predefine attributes etc. by using the product classes feature.

Hope it helps.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Using Node Checkout for class registration

How you define the products will be up to you, though I really recommend making each class a unique product as much as possible. If not that, they should at least have custom SKUs.

Once you create your products, create a single registration node type that collects the information you'll need from the participant in the class. To associate this node type with your class products, you'll need to use a View on D6. This hasn't been documented yet, but it's really high on my to-do list...

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
How to connect?

OK, here's what I don't get, and what I haven't seen described in detail anywhere. On the settings page for Node Checkout, you have to define a connection between a product and the associated node type by entering the nid of the product node. If that's the case, does that mean I would have to do a separate registration content type for each class? How exactly does that work?

Thanks.

By the way, congrats on the new job, Ryan.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Thanks. Are you using the

Thanks. Smiling

Are you using the latest version of UCNC? If so, do you have the Views module on the site by any chance? You can actually associate a node type with a View so that any node returned by the View's default settings could be associated with a single node type.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
One node type with multiple nodes?

Oh, yes, I'm very familiar with Views (it's one of the first things I install for a new site).

So I would create a View that lists all of my Class types, and I could associate one Registration type with all of those? Groovy!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: One node type with multiple nodes?

You bet. Sorry for the sluggishness in getting that documented! It can just use the default display for the View.

allanx's picture
Offline
Joined: 03/04/2009
Juice: 25
Registration/Payment system

Hi Ryan,

Thanks on behalf of ubercat users for all your great work on this module as well as helpful posts on these forums.

Is there a how-to guide on using the module?

I have a client who needs a Registration/Payment system, and I can see that Ubercart and the node checkout module will do the job - but hey, I'm stuck.

I have posted here: http://www.ubercart.org/forum/support/9449/advice_how_set_event_registra...

I'm thinking you are the man to ask for help!

thanks
allanx

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Registration/Payment system

I'll be presenting the module tomorrow in a session at Drupalcon DC. The videos have been getting posted up quickly, so you should be able to watch it over the weekend. Eye-wink

allanx's picture
Offline
Joined: 03/04/2009
Juice: 25
Cheers

Thanks Ryan,

I've been trawling the drupalcon site as well as the drupal video page. Is there a link to the video - be very cool to watch it and see if this solves my issues...

thanks
allanx

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

It's up... just fine the link on my Advanced Ubercart Usage session node. It went really well!

allanx's picture
Offline
Joined: 03/04/2009
Juice: 25
Re: Re: Cheers

Thanks

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Avoiding multiple Registration nodes

I did view the session video, and that explains a lot, but I still have a couple of questions. I have two content types, Class and Registration, and the Registration type is tied to a view that lists all the classes. In my use case, the user could be registering for multiple classes at one time, so they would have to fill out one Registration node for each class. To avoid them filling out the same data multiple times, there are two posiible solutions:

  1. Make it so that only one Registration node is required for all items
  2. Autofill the fields on the Registration node on subsequent classes with data from the first one so they don't have to re-enter it.

Are either of these possible? Or is there a better way to do this?

Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Avoiding multiple Registration nodes

I like the idea of an auto-fill and was just discussing this problem w/ someone else yesterday. Obviously the module wasn't written with one node -> multiple products in mind, but I wouldn't be opposed to making it so. I imagine a contrib module could do this right now by altering the node add form based on any nodes of the same type in your shopping cart to let you auto-populate values. Otherwise we can eventually work it into UC Node Checkout itself.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Minimizing barriers to signup

I've been having some more conversations with the client, and what they want to do is to be able to have one person sign up multiple people at one time. For instance, this is an art school, and he would like a parent to be able to sign in and sign up herself and her kids for classes, as an example. Then, he would like for the parent to be able to sign in and see what classes she has signed up for, for both her and her kids. I'd have to do something to the Registration node to allow her to be able to sign up as many people as she wants (such as being able to add name fields for as many as she needs), and a little creativity with Views to be able to display. The goal for the client is to make as few barriers as possible for the computer impaired in signing up for classes. Forcing each user to have a Drupal account in order to sign up is seen as a barrier in this case.

Can you see any better way I could do what needs to be done?

Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Minimizing barriers to signup

UC Node Checkout already allows for one person signing up multiple people, one of the key requirements for the DIWD setup as well. We just changed the checkout form a little to make it more apparent that they could "Register another" once they submitted their first registration. I don't think it's feasible to do this as a multiple entry name field on a single node, though... that would prevent you from doing something like creating a View where someone could see all the people they've registered at a glance by listing out the nodes one by one in a table or something. If that doesn't matter to you, you can always make it a multiple field and you should still be able to display all the contents in a View... I think it's just not as pretty.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Perfect!

I did not realize that you could do multiple registrations for one product as it is. That's perfect! I was only thinking of doing multiple on one form as an alternative. I'll go back and play with it some more.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Found some issues

I've been playing with this a little more, and I've run into a couple issues:

  1. The user is forced to log in or create an account when adding the Registration node (in my case), but when that happens in the course of adding a node to the cart, the user is not redirected back to the form when login has been completed. Instead, it just leaves the user at their user account screen. For the sake of fluidity, it seems that the user should be returned to where they were in the process after they've logged in.
  2. For the anonymous or authenticated user, all of the fields on my Registration node are not visible, even if I have view selected for them under content_access in Permissions. However, if I give edit permissions on each field, they are then visible. I'm not sure if this is specific to this node that is being used by uc_node_access or not.

I'll look at the code for #1 and see if I can modify that, but any knowledge on why this is the case (if it is a feature, and not a bug) would be helpful.

Thanks.

Steve

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
$_SESSION variable is deleted

The problem with #1 is the use of the $_SESSION['node_checkout_redirect'] variable. By the time the user gets to the user_login page, that session variable is gone, so it doesn't redirect back to where the user was in the process. I'm working on a patch to use another method for indicating to the browser where it needs to redirect.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Now it won't redirect to the user page

OK, since I'm not getting any bites on this, can someone explain what I would have done to make it not even redirect to the user page for an anonymous user? I have the "Use UC Node Checkout to prevent anonymous node add access for node types it governs" box checked, but when I try to add the product to the cart, it takes me to the checkout node instead of to the user login screen. Until I get that to work as it's supposed to, I can't fix the issue with the redirection after the login.

Pardon the frustration, but I was so close to having this work, and now I've spent most of the past two days banging my head against the wall on this. Sad

Thanks.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Finally figured it out

And the saga of my fight with uc_node_checkout continues...

OK, I finally got everything figured out. I modified the module by adding the $query parameter to drupal_goto() using drupal_get_destination, since $_SESSION['node_checkout_redirect'] gets wiped out as part of drupal_goto(). This adds a ?destination parameter to the URL, which is used by the FAPI to redirect the user to that page when the user is done logging in.

I also figured out that there is some confusing terminology used in the config settings and some confusing logic. Here's my long-winded description. While trying to figure the redirect issue out, I was working with gregoryh on allowing anonymous users to purchase node_checkout nodes (see this post), so I had changed all my settings. When I changed them back, I missed one, and so I was getting redirected to user_login_block instead of user_login for some reason, so I kept getting sent back to the Registration node with "Access Denied" each time. Then, I went back to the Node Checkout setting page and realized that I had to enable "create registration content" for the anonymous user. Once I did that, I was redirected to user_login, and I could then change the call to drupal_goto() mentioned above.

Now here's what doesn't make sense. As I understand it, the "Use UC Node Checkout to prevent anonymous node add access for node types it governs" setting says that I don't want anonymous users to be able to create node_checkout associated content (Registration content type in my case). However, in order to do this, I have to enable the "create registration content" permission for the anonymous user (as specified by the "Enable anonymous creation of node checkout node types and anonymous users will be instructed to create an account." instruction on Node Checkout settings). In other words, I have to allow anonymous users to create Registration content in order to keep them from creating Registration content by redirecting them to log in or create an account, hence becoming authenticated users first. Am I the only one that finds that contradictory?

Now, after writing all this, I had a conversation with mikey_p on IRC, and he explained that the create registration content for anonymouse users has to be enabled in order for node_checkout to override it. Otherwise, node_checkout would never have control over whether an anonymous user could purchase the node_checkout enabled node. However, unless you understand that, it's very easy to be confused by the seeming contradiction.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Patch submitted

I've submitted a patch in the uc_node_checkout issue queue for the redirect issue.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Re: Patch submitted

Bumping this to the top of the list in the hopes that Ryan will see it, since it involves a patch for uc_node_checkout.

TheGateKeeper's picture
Offline
Joined: 12/13/2011
Juice: 3
Re: Re: Patch submitted

Thanks, was looking for this.

TheGateKeeper
Muay Thai
Thanks

Dominion79's picture
Offline
Joined: 08/08/2010
Juice: 16
Direct link to Ryan's video on Advanced Ubercart Usage

To save future people having to go look for the Ryan's video on 'Advanced Ubercart Usage'

http://dc2009.drupalcon.org/session/advanced-ubercart-usage

Loads of helpful video from Drupalcon DC 2009

http://dc2009.drupalcon.org/

My thanks to Rayan for all the help and effort he's put into the community ... I'd still be going round in circle if it wasn't for the info !

jrmorris's picture
Offline
Joined: 02/10/2010
Juice: 0
view registration

Ryan, when changing the node_checkout_settings to use a view, form requirement no longer works for that node_type.

can you help please.

GearedDesign's picture
Offline
Joined: 10/18/2009
Juice: 33
How to use views

Any documentation on how to use views with UCNC?

activelyOUT's picture
Offline
Joined: 04/20/2009
Juice: 70
Re: Using Node Checkout for class registration

subscribing

seanMcgin's picture
Offline
Joined: 02/02/2010
Juice: 2
Hmmm...

I see Ryan has not been here since March of 2009?

...also it seems mildly hilarious that a discussion of "Product classes" ended up being centered around a use scenario with 'classes' as its content category. I'm still confused Eye-wink

HaloDigitalDesign's picture
Offline
Joined: 10/25/2011
Juice: 12
Registering existing children "nodes" for sporting event

I have a different angle that I've been beating my head against.

I have a database full of parents (content profiles) and children (nodes associated with their parents via Views)

I need the parents to register their already existing children (nodes) for one of a variety of sporting events.

I have Ubercart Event registration set up, which allows me to add a custom field to the "Event" form, which I am using to display the children associated with the logged in user. I went into Node checkout settings and associated the Child Page Node type with any Paid Event Node type via a View.

The parent selects the event they want to register their child for, select the child they want to register and process the order.

After checkout, the event is in no way associated with the child they selected.

I have been working on this event registration function for 2 weeks and I have tried 3 different ways of going about it and not one of them works the way I need it to.

I know this is is possible, but I can't find the right combination of things to make the magic happen.

Any help would be greatly appreciated!