Using Price Set Fields in Drupal with CiviCRM Entity

Published
2017-05-02 07:15
Written by

Comments

Great Work - thank you! 

Is there any chance this would work in combination with the CiviCRM<->Drupal Webform Integration? I mean to set up a Webform integrated with CiviCRM and pull the price options via your module?

That would be amazing as one of the shortcomings there is that the Webform Integration cannnot pull price sets from CiviCRM  (afaik).

Cheers
Fabian

Well there's nothing in there that will integrate directly with the Webform CiviCRM project.

There are some helper functions that get the price set for an event, and load the price set, and price set fields for the set, as their Drupal entity equivalents, organized in an indexed array. That may be useful, but it won't generate the Webform components.

Not using Webform CiviCRM was design choice.  We wanted to mimic what CiviCRM would output on its native registration page, with the same business rules, but done completely in Drupal API and FAPI, processing done by the CiviCRM API.  If you want different fields or to change the order of them for the profile, then just edit the CiviCRM profile(s) in the normal fashion. Same for price sets/ price fields.

A Rule event does get triggered after a successful registration, and you can add Rules actions to do some post processing. The rule has the participant and contact entities available.

There is also a rule event that triggers for a successful CC transaction, that has the Contribution entity available to it...

 

Can I set up a reaction rule based on a civi entity price set choice? 

i.e. if someone buys t-shirt price set item, add to X group?