0

I need to save some additional information related to the membership during sign-up. This will be stored in custom fields of the membership. Sign-up (Membership creation) is happening through a Contribution Page which includes a Profile with those custom fields.

The Profile does not transfer the values from the custom field into the custom field of the newly created Membership.

Previously I used (Drupal Module) custom code and the civicrm_api to update the membership. However, nowadays I don't seem to be able to get the contributionID and membershipID values from the $form->_params array anymore.

How can I add custom fields to a Membership from a Contribution Page?

0

There was a bug in this feature. As of CiviCRM version 4.7.5 the following steps will work.

The standard civi approach would be

  • create custom field group and set to be used on Membership
  • add custom field
  • create Profile to be used on that Contribution page and include the above field.

That is all assuming that the 'field' is actually specific to the Membership and not to the Contact or the Contribution or some other component.

  • I tried on Demo as well but the custom field in the membership stays empty. Do I miss something obvious in the setup? Please have a look: dmaster.demo.civicrm.org/civicrm/admin/contribute/… – sleidig Mar 16 '16 at 22:42
  • looking looking – petednz - fuzion Mar 17 '16 at 0:00
  • I concur - info is showing on both Confirmation and Thank you pages!! But not on the membership record. Want to go ahead and report in JIRA with steps to replicate or point here? Added as new answer. – petednz - fuzion Mar 17 '16 at 0:05
  • I accepted this answer now, as this (soon) should be the way to do it for anyone coming across this question in the future. – sleidig Apr 5 '16 at 7:43
2

Please check the PR: https://github.com/civicrm/civicrm-core/pull/8052

The bug mentioned in description is not replicating, but found an additional bug. After making online membership contribution, with custom field included in profile, custom data is not getting saved in fields. When, view a membership record on contact summary page.

So made additional fix for CRM-18282.

  • 1
    that PR fixed the problem for me. Thanks a lot! :-) – sleidig Apr 1 '16 at 11:10
1

Adding as separate answer. Appears to be a bug - adding Membership fields, then adding in to Profile. We see them on the form, and the data we enter (both Text and Yes/No) show on the Confirmation page and the Thank you page (see screenshot

Needs a JIRA ticket imo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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