Hi
I thought that this comment might do what I'm after, but it doesn't quite get there.
I am building an event registration site (yes, another one, but a different use case). I want for people to be able to enter the details of as many attendees as they want, and at the same time select attributes for the T-shirt and lunch they will get.
My product page has a quantity field, the value from this quantity field will add the same amount of fields to my node add page. (I've not figured out yet how to carry the quantity value across to the node add page, if someone can help on this, much appreciated).
What I want to have is an attribute selector appear on my node add page for each attendee. There will be a checkbox also, if the checkbox is selected then I can easily update the cart to add the correct amount of t-shirts and lunches. I need to select the attributes though.....
Any ideas?
Thanks
Glenn
Comments
Comment #1
rszrama commentedHey Glenn, the way to do this w/ UCNC would be to have the user complete the form a separate time for each attendee instead of letting them select the Qty. up front. I've seen people add a custom button to the node form ("Save and add another") or use the continue shopping link to redirect back to the node/add/form ("Register another attendee") on site that only sell that event registration. This module probably won't become what you're looking for, though.
Comment #2
glennnz commentedHi Ryan
Thanks for the prompt reply.
Your method was my original plan, but my client wants it all on one page.
My plan is:
1. Use the quantity entered on the initial product page to add the correct number of registrant detail fields (currently struggling to get the quantity to carry through to the node creation page)
2. I'm using hook_form_alter to add the correct number of fields for names etc, and am querying the database to ad selectors for the attributes, and a checkbox for "Yes, I'll have a t-shirt thanks!"
3. Add the registrant data to a new table using hook_nodeapi.
4. Using hook_nodeapi and the uc_add_to_cart function, add the t-shirts etc to the order.
Does this sound feasible? I'm getting there, now need to figure out how to prepare the data array for the attributes to be able to use uc_add_to_cart.
Cheers
Glenn
Comment #3
rszrama commentedHey Glenn, at this point I'd say it's not necessarily worth it to go w/ UCNC. Or if you want to have nodes for registered users, you might just consider a custom form instead of the node form. I'm just not sure what you gain by trying to jimmy a solution through the node form with your use case.
Comment #4
glennnz commentedRyan
Cheers.
I've decided to abandon the original plan, and client has agreed to go with an 'Add another' button.
I'm using the Submit Again module to add the button to the node add page.
There is a funky thing between the two modules with permissions though.
I want my site to function so that, when a user clicks the 'Submit' button on the node add page, they are taken to the cart. If I set that up, the Submit Again button takes me to the cart as well, if I set up uc_node_access so that the submit again button takes me to another node add page, then the 'Submit' button goes to the node view rather than the cart.
I've tried all day to work a way round this, amended both your and the submit again code, tried adding custom redirects, can't get anything to work.
Any suggestions? I've posted an issue at the Submit Again module too.
Thanks
Glenn
Comment #5
rszrama commentedI wonder if you can unset the uc_node_checkout_add_to_cart_submit() submit handler that I add to the form's submit button and duplicate it in your own custom submit handler, changing the redirect code. Beyond that, I don't know enough about how the submit again module is working... I'm guessing the fact that I'm adding my handler to the submit button instead of the node form might come into play here.