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 CiviContribute (Moderator: Donald Lobo) »
  • Control access to membership type by group or tag?
Pages: [1]

Author Topic: Control access to membership type by group or tag?  (Read 1286 times)

davo

  • Guest
Control access to membership type by group or tag?
January 13, 2008, 02:12:20 am
I've got a sporting club where we offer different types of memberships to student, non-students, life members, etc. I've worked out most of this in CiviCRM. I can create different membership types. I can create groups, tags or even custom fields to let a member specify their data, eg. student vs non-student.

My problem is the different membership types cost different amounts. So I don't want to offer a member the choice of all membership types to choose from. For a start it's a bit clunky. But more importantly, I don't want them to simply choose the cheapest option when it's not available to them. Furthermore, the membership type rules can be a bit complicated, so I don't want them to be able to accidentally choose the wrong membership type either.

Can I have a single registration process that only offers the correct membership type based on the user's profile? For example, if they're a student, they're only offered the student membership type (at the student rate). I'm thinking that the membership type they're offered is based on (calculated) according to groups or tags (or whatever's easiest really). Can such a thing be done? What's the best (or preferred) way to achieve this?


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Control access to membership type by group or tag?
January 14, 2008, 01:00:20 pm
Simple answer is "no" - there's no way to do this without writing / hacking some code.

Depending on the workflow - this might need different approaches. If you're collecting the basic contact info first (including student vs. non-student custom data) - then you could modify the code which presents the Membership Types on the signup form to retrieve the custom data value and filter accordingly.

However, if the signup process includes specifying student / non-student etc. and/or you offer the signup form to non-authenticated (anonymous) users - then you would probably need some DHTML scripting which filters the membership type options based on answers to other fields.

If you're up for doing some coding to make this happen, you could check out CRM/Member/BAO/Membership buildMembershipBlock() as a start. Ping us on IRC if you need more guidance.
Protect your investment in CiviCRM by  becoming a Member!

davo

  • Guest
Re: Control access to membership type by group or tag?
January 15, 2008, 01:57:14 am
I'll have a think about coding. Not sure I want to get into hacking the code just yet :)

What's a fallback option that doesn't do everything I want? Do other sites simply offer all memberships types and let the member choose? Or is there a standard way to limit the memberships offered (at least in part)?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Control access to membership type by group or tag?
January 15, 2008, 11:31:10 am
Hopefully others will pipe in here... but one approach would be to create a different online contribution / membership signup page for each of the types. Then "directing" folks to the appropriate page by exposing the appropriate link in a block - potentially based on drupal role, or using some simple PHP code in the block which exposes the appropriate navigation link based on retrieving the value of the "criteria" field for the logged in user's contact record.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Control access to membership type by group or tag?

This forum was archived on 2017-11-26.