Hi,

great module and soooo close to what I need. My only missing thing is the display of the information from the webform (paid event) on the checkout page or the review order page.

I have an event with some attributes (e.g. single room supplement) and some webform fields (e.g. Tshirt size).

In the checkout I see that the single room supplement has changed the price etc as is standard with Ucart.

But I can't see as a customer that I have selected a Tshirt size. All this information has "disappeared" for the customer.

Can the webform information be displayed as a checkout node?

Thanks
Rich

Comments

andyf’s picture

Status: Active » Postponed (maintainer needs more info)

Is there a problem with using attributes for T-shirt size as well?

andyf’s picture

Title: Information from Webform not displayed in checkout or review order » Allow webform components to be shown at checkout along with attributes
Category: support » feature
Status: Postponed (maintainer needs more info) » Active

I'm marking this active again as aaronbauman has offered to make a patch to add the functionality. I'm guessing that the best way to handle it is to add a checkbox inside the component configuration screen that lets you select whether or not a particular component should show up?

aaronbauman’s picture

I ended up needing some very specific behavior, so i implemented a very simple hook_product_description to inject a few fields.
A generci solution could end up getting really complicated, especially in terms of making the formatting look nice to the end user.
Here's a snippet of the code i used if it will help anyone else, but I probably won't have time to write a full fledged patch any time soon:

function mymodule_product_description($product) {
  $node = node_load($product->nid);
  if ($node->type != 'paidevent' || empty($product->data['uc_event_registration'])) {
    return;
  }
  module_load_include('inc', 'webform', 'includes/webform.submissions');
  module_load_include('inc', 'webform', 'components/select');
  $sid = $product->data['uc_event_registration']['sid'];
  $submission = webform_get_submission($node->nid, $sid);
  if (empty($submission->data)) {
    return;
  }

  $content = '';
 
 // Do your logic here to build the description however you like

  $description = array(
    'mymodule_description' => array(
      '#type' => 'item',
      '#value' => $content
    ),
  );
  return $description;
}
andyf’s picture

Status: Active » Postponed

Thanks for the code! I might return to this at some point and see if we can do something a bit more general, along the lines of the OP's request (and of course will accept patches).

damienmckenna’s picture

This is something that the similar UC_Webform_Pane does, I've already added an issue to discuss merging the two modules: #1445486: Merge with UC_Webform_Pane?

damienmckenna’s picture

Along with this it might also be useful to be able to have it automatically repeat the webform fields for each event ticket sold, e.g. if you have webform fields for the name & email address of everyone you're giving a ticket to it should repeat three times if you buy three tickets.

4kant’s picture

@AndiF:
is it possible to have the link on the order screen to webform submission ("View submitted form data") in cart view and/or checkout too?

4kant’s picture

Achieved that by taking out the "admin" argument in line 298 in uc_event_registration.module (which was there "to prevent unnecessary submissions loads on cart and checkout pages").
My aim is to make customers become able to edit their order until they finally complete the order.
I guess that should be possible now in conjunction with roles and rules.
That way webform can become a powerful product class - maybe with multistep forms to.
I´m about to check that next...

andyf’s picture