2

In a Drupal 7 site we are using webform_civicrm for paid event registrations. The webform creates the contribution with the participant fee (civicrm_participant line item) as well as other additional (civicrm_contribution) line items. All is well until one goes to the edit form of the contribution and saves, this recalculates the total amount and tax amount and only includes the first line item (participant fee). Occasionally other line items have been manually added to the contribution with the line item edit extension and those are also civicrm_participant line items, but also ignored.

I did some digging in the civi core code. In the contribution edit submit function it looks as if only civicrm_participant line items are fetched if the contribution is recognised as a participant contribution. And while all the participant line items are added to the $params array, if the price set is quick config it seems deliberate that only the first one is used for the total amount and tax amount. All of our webform_civicrm generated line items fall under the reserved quick config price set 1.

I ended up using some code to check and correct total_amount, tax_amount and net_amount in a hook_civicrm_pre implementation, but I would love it if someone could shed some light on where the fault lies here.

5
  • Can you clarify ? How do you define the contribution line items in webform ? How is your event price set up ?
    – samuelsov
    Commented Sep 25, 2023 at 18:11
  • I'm not sure what you're asking, webform_civicrm provides the line item and participant fee fields after enabling them, the values (prices) are assigned through conditionals in this case. The webform_civicrm code uses the default quick config price set for the line items. I'd imagine any participant contribution which is_quick_config and has multiple line items would have this issue regardless of any other factors.
    – Aiden
    Commented Sep 26, 2023 at 16:42
  • Quick config depend on how you define the prices on your event. If you haven't done a priceset, it will be quickconfig but you can change that and webform should use whatever you have on your event.
    – samuelsov
    Commented Sep 26, 2023 at 17:17
  • 1
    Looking at the code I don't think that's true, it uses 'default_contribution_amount' unless there's a membership id in which case it uses 'default_membership_type_amount'. I checked it out and found we do have the event set up with a price set which is not quick config.
    – Aiden
    Commented Sep 28, 2023 at 8:03
  • Oh, I see, my mistake : "Note that any event prices you have configured in CiviCRM are not imported into the Webform - you will need to reconfigure them here."
    – samuelsov
    Commented Sep 28, 2023 at 13:00

1 Answer 1

0

The short answer to my question (after discussion with CiviCRM and webform_civicrm devs) is that quick config price sets were designed for single line item contributions, webform_civicrm uses quick config for all contributions as there's no better alternative. So currently there is an unresolved compatibility issue with tentative plans to change Civi core to be more flexible. The triaged issue on the core repo is here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.