CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Integrating CiviEvent Price Options in Webform & passing Event ID from a view
Pages: [1]

Author Topic: Integrating CiviEvent Price Options in Webform & passing Event ID from a view  (Read 1495 times)

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 05:40:17 am
The Usecase 
  • The Organisation is using CiviCRM (4.4.x Drupal 7.x) to manage quite a number of paid events and participants.
  • There are a number of different event types, each with custom fields.
  • All events use price sets with early bird discounts.
The approach is to create a Drupal view showing all relevant events in a list. Users should be able to click on one event and find more information on it (another View). If they want to participate, they should click a button register and be presented with a Webform in which they enter their personal data and select the appropriate price option.
After playing around with webforms, views and some additional functions for quite a while, I encountered two problems/have to questions:
  • Is it possible to pass the event ID from the event's view to the webform so that users will be registered for the right event without having to select it again from a list? One approach may be to use the method described in this Post: (https://civicrm.org/blogs/jackrabbithanna/drupalcivicrm-integration-civicrm-entity-and-webform-civicrm). It is however kind of complex and so far I could not get it to work – maybe anybody knows an easier way?
  • Is there any option to include the CiviEvent price options in the webform? Using Contribution pages does not seem to be a viable option as there is no way to offer an early bird discount and also one would need one contribution page per event (or at least per combination of price-options).

I would be grateful for any hints, suggestions or ideas, particularly concerning the second question. Also, please feel free to ask if anything is unclear about the usecase.

Best Regards
Fabian

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 05:53:18 am
1) This seems like a more generic problem - "how do I pre-fill a field from a webform from a value passed in the url". This being Drupal, there's probably a module for that.

2) Sorry this is going to be the really painful point. No, webform does not currently support price-sets or discounts. If all you are doing in this step is signing up 1 participant for 1 event, then you don't really need a webform here. Just have the view link to the standard event registration page instead would be my recommendation.
Try asking your question on the new CiviCRM help site.

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 06:08:15 am
Hi Coleman,

thanks for the quick answer. I was kind of suspecting that there is no integration yet. Could you maybe elaborate a bit why? Was it particularly difficult to include for some (technical) reasons or was it merely beyond the scope of the webform-integration? If it is not too complex, we may be able to put some work into it...

As the event registration will be a fairly complex form (many fields requiring multiple steps/pages on the form, different languages, lots of conditional fields etc.) I really do not like to use  standard event registration. It may in theory be possible to do so (with tons of java-magic, template hacking etc.) but experience thought us that finding a good looking, functional and maintanable solution is very, very difficult.

I will further investigate the question of pre-filling the webform and post information here in case I find anything interesting.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 06:22:45 am
Quote
Was it particularly difficult to include for some (technical) reasons or was it merely beyond the scope of the webform-integration? If it is not too complex, we may be able to put some work into it...
Yea, if you think about it, webforms and price-sets are sort of fundamentally incompatible. Price sets are forms build in Civi, and webforms are forms built in Drupal. Seems to me you could have one or the other, but not both.
But, this being software, I suppose anything is possible. If you were to get really ambitious we could extend this module to do something like this:
  • Write a function to translate civi price-set field types into drupal FAPI field types
  • Create a special type of webform field called "price set" which is actually more like a field collection, and automatically pulls and displays the entire price set (not sure if this is possible with FAPI).
  • Write some special ajax behavior that can refresh that price-set field collection on-the-fly based on selected event
  • Of course, event can be multi-valued so it will have to be able to handle more than one price-set at once!
Try asking your question on the new CiviCRM help site.

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 07:27:28 am
When you put it that way, it does not sound very tempting ;)

But seriously, do you think extending the module in the way you described would be utterly wrong (in terms of approach/complexity/ressources required) or "only" a lot of work?

Otherwise, if I get this correctly, there is currently no viable approach to use Webforms to register participants for paid events - right? Because even if I set up a contribution page and integrate it in the Webform (and make somehow sure that only the right amounts are selectable/will be submitted) the contribution and the registration in CiviCRM will not be linked.

This would for example imply that I cannot set the contribution to "completed" and update the registration at the same time (or the the other way around) - which is a cool feature of the participant management workflow in CiviEvent. Also, I could not find all contribution generated from particular events if I need to edit them or If I want to use them for reporting purposes...

Don't get me wrong, I think the webform-integration is great and highly appreciate it - just trying to explore my options here...

Has anybody other Ideas or suggestions on how to handle that?


Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 07:45:16 am
Quote
But seriously, do you think extending the module in the way you described would be utterly wrong (in terms of approach/complexity/ressources required) or "only" a lot of work?
Only a lot of work. It would be kind of like the webform-civicrm project itself; trying to create a bridge between two fundamentally different systems and make them more-or-less work in harmony. I think it definitely could be done. The basics of translating price set fields into fapi is pretty simple actually, but the devil is in the details...

Quote
Otherwise, if I get this correctly, there is currently no viable approach to use Webforms to register participants for paid events - right?
No not entirely right.
Quote
Because even if I set up a contribution page and integrate it in the Webform (and make somehow sure that only the right amounts are selectable/will be submitted) the contribution and the registration in CiviCRM will not be linked.
No, they will be linked. The purpose of the contribution page is to facilitate the credit card collection, but this module extends that functionality to add line-items for whatever events and memberships are being purchased as well.

So while this module doesn't yet support price sets or discounts, it does support paid events. In lieu of a priceset you enable the "event fee" field in the webform. This can be rendered in lots of ways, including the webform "grid" element which is kind of like a simple price set. If multiple events or participants share the same "event fee" field then the chosen price will be multiplied accordingly.
Try asking your question on the new CiviCRM help site.

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Re: Integrating CiviEvent Price Options in Webform & passing Event ID from a view
August 01, 2014, 08:43:17 am
Thanks for clarifying. I think I will play around a little bit more with the options and see, where I get...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Integrating CiviEvent Price Options in Webform & passing Event ID from a view

This forum was archived on 2017-11-26.