Skip to main content

GROWING AND SUSTAINING RELATIONSHIPS

GROWING AND SUSTAINING RELATIONSHIPS
Close
Michael Daryabeygi

Implementor

Ginkgo Street Labs

http://ginkgostreet.com

CiviCRM enables me to empower my clients with a database that suits their unique needs.

GROWING AND SUSTAINING RELATIONSHIPS
Close
David Greenberg

Core Team Member

CiviCRM

http://civicrm.org

I find the engagement with our community of users to be intellectually stimulating
and rewarding. Seeing folks with expertise in a particular area step up and contribute their time and ideas to help improve the product is quite exciting. Every time I hear about a new interesting organization starting to use CiviCRM, I get a renewed sense of excitement about our work. The range of civic sector organizations currently using the software is quite amazing to me - from large international advocacy organizations to local performing arts troupes. I also really enjoy interacting with our international community - building friendships and getting to share culture (food, music, humor ....) with colleagues on every continent.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Michal Mach

Core Team Member, Developer, Implementor

CiviCRM, Caltha

http://civicrm.org

I've always been passionate about what non-profits and advocacy groups can achieve using technology. For me, CiviCRM shows an essential example of how non-profit and technology worlds can come together to provide real change - working as community, creating value for yourself, but also for others in non-profit sector.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Katy Jockelson

Implementor, administrator

Third Sector Design

http://thirdsectordesign.org

We work with non-profits to help them use and understand Civi. It's such an important tool for these organisations and it's great to see people using it in different and interesting ways. Using and working with Civi is made so much more fun and useful by the enthusiastic and talented community surrounding it.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Peter McAndrew

Implementor, Developer

Third Sector Design

http://www.thirdsectordesign.org

Being part of the CiviCRM community is really something to shout about! Not only is CiviCRM an amazing software package, its designed for organisations that make a difference in the world. We help non-profits across the UK gain control of their data through the power of CiviCRM.

It is without a doubt the best piece of software I've ever worked with, and I'm constantly discovering cool new features. More recently I've been working on CiviMobile as part of a project for my course at University. I'm really looking forward to seeing this being used by organisations across the globe.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Allen Gunn

Ally, FanBoy

Aspiration

http://aspirationtech.org/

By giving the nonprofit sector a values-driven, free/open source solution for CRM needs!

GROWING AND SUSTAINING RELATIONSHIPS
Close
Stacy Liou

Implementor, Developer, Trainer

elMobile Inc.

http://www.elmobile.com

As developers for various OpenSource CRM applications, we learned a lot from CiviCRM on its scalability and ease of customization.
CiviCRM community is truly organic cultivating growth for users and developers.
We wish to continue learning with CiviCRM and to tackle future challenges with CiviCRM.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Jake Martin White

Implementor, Developer

PeaceWorks Technology Solutions

http://www.peaceworks.ca

PeaceWorks provides technology solutions for not-for-profit organizations. CiviCRM fills an important niche among our clients who need a flexible, comprehensive, user-friendly, web-integrated CRM solution.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Eileen McNaughton

Developer and End-user

Fuzion

http://fuzion.co.nz

CiviCRM has one of the most active and friendliest communities I have come across. From initial tentative forum posts I was encouraged into engaging more actively through IRC and directly with other groups & individuals and am now happy to count many community members as friends. I recently found an article on the web that said if you post a question about CiviCRM anywhere on the web Lobo will post an answer within a few hours. It often feels like that is true.

One of the most valuable way in which the community supports me is by allowing me to bounce my ideas around and often someone is able to suggest an approach which is better than mine.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Abril Rocabert

Administrator and End-user

http://www.alternativasycapacidades.org

CiviCRM is a powerful tool that could be really useful for many non-profits in Mexico.
Unfortunately the community is very small in my country. I hope that in the next years the community expands around Latin America.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Andrew Hunt

Implementor, Developer

AGH Strategies

http://aghstrategies.com

CiviCRM allows our clients to have a robust tool for tracking and engaging their supporters that can grow with them. I began as an end user, and now I work with CiviCRM full-time.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Xavier Dutoit

Developer and Implementor

Tech to the People

http://techtothepeople.com

Over the past 15 years I've been involved in several open source communities.
CiviCRM is without any doubt the one that has the strongest focus in welcoming "newbies" and letting everyone feel at home here. Another impressive feature is the focus on shipping. No matter what you think of CiviCRM today, you are almost sure that there will be a newer and better version in a few months.

LOGIN | REGISTER
  • Create new account
  • Request new password

Search form

  • BLOG
  • DEMO
  • Find An Expert
  • NEED HELP
  • SUPPORT US
  • DEVELOPER RESOURCES
CiviCRM Community Site logo CiviCRM Community Site
  • WHAT IS CIVICRM
    • Community
    • Case Studies
    • Experts
    • Contributors
    • Core Team
    • Licensing
    • Contact Us
  • WILL CIVICRM MEET YOUR NEEDS?
    • Contacts
    • Contributions
    • Communications
    • Peer-To-Peer Fundraisers
    • Advocacy Campaigns
    • Events
    • Members
    • Reports
    • Case Management
  • GET STARTED
    • Evaluate Your CRM Needs
    • Evaluate CiviCRM Features
    • Read Books
    • Demo CiviCRM
    • Download CiviCRM
    • Find An Expert
  • PARTICIPATE
    • Join the CiviCRM Community
    • Read Our Blog
    • Community Forum
    • Attend a Training or Meetup
    • Make It Happen
    • Contribute
    • Become A CiviCRM Developer
    • Issue Tracker
    • Help with Documentation
    • Translate

You are here

Home » Blogs » Stoob's blog

Blog

  • Architecture Series
  • CiviCampaign
  • CiviCase
  • CiviCon
  • CiviContribute
  • CiviCRM
  • CiviCRM API
  • CiviCRM Code Sprint
  • CiviCRM Meetups
  • CiviCRM Release
  • CiviCRM Solutions (case studies and user stories)
  • CiviCRM Team
  • CiviCRM Training
  • CiviCRM v1.6
  • CiviCRM v1.7
  • CiviCRM v1.8
  • CiviCRM v1.9
  • CiviCRM v2.0
  • CiviCRM v2.1
  • CiviCRM v2.2
  • CiviCRM v2.3
  • CiviCRM v3.0
  • CiviCRM v3.1
  • CiviCRM v3.2
  • CiviCRM v3.3
  • CiviCRM v3.4 and v4.0
  • CiviCRM v4.1
  • CiviCRM v4.2
  • CiviEvent
  • CiviMail
  • CiviMember
  • CiviMobile
  • CiviPledge
  • CiviReport
  • Documentation
  • Drupal
  • Extensions
  • Finance and Accounting
  • Interface Design and Layout Standards
  • Internationalization and Localization
  • Joomla
  • Older Versions
  • Schools
  • WordPress

Using only jQuery and CiviCRM to create Members Only Pricing

Submitted by Stoob on February 13, 2012 - 19:44

There have been several hook() or Drupal module based solutions for "members only" pricing for events or for other 'discounts' related to memberships.

 

I take a different approach by using only jQuery and blocks in Drupal 6.  For those who use Drupal 7 you can adapt this code with Drupal 7's new javascript namespace and Joomla folks could even make use of this in custom TPL files.

 

The whole concept of this code is that any 'member only' fee label must contain a specific word or phrase, in my example this word is "Member".  Staff must be trained to do this - it is relatively simple to do so.

 

How it works:

1. Place this code in a block, selecting "full HTML" or "unfiltered" input type, and assign the block to an inconspicuous region in your theme

2. Show the block only on certain pages, such as: civicrm/event/register

3. Show the block only to anonymous users in the block visibility settings

 

That's it!  Fee levels containing the word "Member" will be hidden.

<script>
cj(document).ready(function() {
    cj("input[name=amount]").each(function() {
      var thisPrice = cj(this).attr('id');
      cj("label[for='"+thisPrice+"']:contains('Member')").hide();
      cj("label[for='"+thisPrice+"']:contains('Member')").prev("#"+thisPrice).hide();
    });
});
</script>

Ways you can customize and enhance this

1. Change the word "Member" to a phrase of your choosing

2. Hide only the radio button, not the label, to 'entice' people to join. Delete the first line with hide() at the end

3. Activate this code only on certain pages by placing the unique id of the page in the if() statement near the top. That would look like this:

<script>
cj(document).ready(function() {
// add the id numbers of the pages you want below
if ( 
  document.location.href.indexOf('id=1') > 0 ||
  document.location.href.indexOf('id=2') > 0 ) {	
    cj("input[name=amount]").each(function() {
      var thisPrice = cj(this).attr('id');
      cj("label[for='"+thisPrice+"']:contains('Member')").hide();
      cj("label[for='"+thisPrice+"']:contains('Member')").prev("#"+thisPrice).hide();
    });
  }
});
</script>

4. Show the member pricing not simply to authenticated users, but to only users who are memembers

  • Activate the CiviMember > Roles Sync script
  • Change the visibility settings of the first block to be seen by all, thus hiding member pricing for everyone
  • Make a second block with visibility settings only for your exclusive Member > Roles
  • Copy and paste the same code, but change hide() to show(), thus re-showing member prices only to members
  • Place this second block just below the first block
  • Stoob's blog
  • Log in or register to post comments

Comments

Good display trick, no security

Permalink Submitted by xavier on February 13, 2012 - 23:31

Hi,
 
That's a nice trick, but keep in mind that it wouldn't stop any anonymous visitor to "hack" and choose the members only anyway (eg. if you disable javascript).
 
If security is needed (probably not a big deal in your case), then you'd need to add hook on the server to double check that no non member has chosen a member price.
 
Thanks for sharing
X+

  • Log in or register to post comments

That's correct. 

Permalink Submitted by Stoob on February 14, 2012 - 09:47

That's correct.  Absolute security of 'members only' pricing isn't a concern in my application.  Non-members are aware that members get a discount, we just don't want non-members to be presented with an option for a discount and have them select it by mistake.  We will spot check any event participants for valid memberships.

  • Log in or register to post comments

Why?

Permalink Submitted by dharmatech on February 15, 2012 - 10:10

Where do the other solutions fall short that you needed to implement this in jQuery?

  • Log in or register to post comments

Links?

Permalink Submitted by Stoob on February 15, 2012 - 12:26

Would you mind posting links to the other solutions to which you are referring?

  • Log in or register to post comments

You probably have a more

Permalink Submitted by dharmatech on February 15, 2012 - 13:48

You probably have a more exhaustive list since you wrote:

There have been several hook() or Drupal module based solutions for "members only" pricing for events or for other 'discounts' related to memberships.

I'm only aware of the civievent discount module which provides discounts for events, price sets and membership. I was curious what the other solutions are, why they didn't work for you and what use case you were fulfilling in your approach.

  • Log in or register to post comments

Nope

Permalink Submitted by Stoob on February 15, 2012 - 23:23

That module plus one other random post I found via Google (link now lost to time-space) was all I have.  Sorry if you feel I didn't give your module a try, but when I saw Civi3.3 was the highly recommended version, I moved on.  Upgrading to 4.1 will be just around the corner, and I wanted a lightweight solution that could be used with 4.1, adapted to D7, and used with Wordpress in conjunction with Widget Logic plugin.   Security and the fuller features of your module aren't necessary in my cases.  Your module does sound cool though.  Thanks.

  • Log in or register to post comments

D7

Permalink Submitted by cognoscento on March 15, 2012 - 09:20

For me, it's easy D7 support... I have yet to find something I can use as a non-coder. All the options I've seen are for D6.
I'd use the code above, but I don't have the chops to convert the above code D7 compatible... maybe someone would perform that small act of kindness for me and others?
 
 
 

  • Log in or register to post comments

MIH for this

Permalink Submitted by lobo on March 15, 2012 - 10:53

There is an MIH to make modules CMS agnostic (so will include D7 and wordpress). Its quite close to being fulfilled:
http://civicrm.org/participate/mih#cmsagnostic
Help make it happen
lobo

Url: 

http://civicrm.org/
  • Log in or register to post comments

MIH module

Permalink Submitted by KarlaChrist on April 3, 2012 - 02:16

Very true while using wordpress platform MIH module will be better option even its good for Joomla.
Bayside lounge

  • Log in or register to post comments

CIVICRM


GROWING AND SUSTAINING RELATIONSHIPS

WHAT IS CIVICRM
  • Community
  • Case Studies
  • Experts
  • Contributors
  • Core Team
  • Licensing
  • Contact Us
WILL CIVICRM MEET YOUR NEEDS?
  • Contacts
  • Contributions
  • Communications
  • Peer-To-Peer Fundraisers
  • Advocacy Campaigns
  • Events
  • Members
  • Reports
  • Case Management
GET STARTED
  • Evaluate Your CRM Needs
  • Evaluate CiviCRM Features
  • Read Books
  • Documentation
  • Demo CiviCRM
  • Download CiviCRM
  • Find An Expert
PARTICIPATE
  • Join the CiviCRM Community
  • Read Our Blog
  • Community Forum
  • Attend a Training or Meetup
  • Make It Happen
  • Contribute
  • Become A CiviCRM Developer
  • Issue Tracker
  • Help with Documentation
  • Translate