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 CiviEvent (Moderator: Yashodha Chaku) »
  • Getting rid of "none" option in price sets
Pages: [1]

Author Topic: Getting rid of "none" option in price sets  (Read 2055 times)

Wonder95

  • Guest
Getting rid of "none" option in price sets
June 26, 2008, 08:38:07 pm
I'm creating a custom price set for an event, where there are different fees for members, non-members, and exhibitors using radio buttons.  I set two different prices (early and late registration), but when the page is actually displayed, there is a third "none" option.  Why is that there, and how do I get rid of it?  I would like to have that options disappear if possible.

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Getting rid of "none" option in price sets
June 27, 2008, 12:41:51 pm

in the price settings section, make this radio field required. This will eliminate the 'none' option

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Wonder95

  • Guest
Re: Getting rid of "none" option in price sets
June 29, 2008, 05:43:25 pm
OK, I've changed the way I'm doing this, but I still have some questions.

1)  Here are the registration fees I need to set up:
Attendees
Members $400
Non-Members - $450

For attendees, these are early bird prices, but I figured I'd just put up a note saying that as of a certain date the cost will go up, and then change the prices on that date.

Exhibitors
Members - $1000
Non-members - $1200

It seems logical to use a Price Set, where I have one price field for Attendees and one for Exhibitors.  So if I understand correctly, I have to leave the "none" field there since a person can only be one or the other?  Is there a better way to do what I need to do?

2) For exhibitors, the registration fee is only for the booth and one person.  For any additional people that work the booth, there is a $50 charge.  How can I set it up to charge that additional fee?  Do I have to create a separate fee for each combination of additional people (i.e. $1050 for exhibitor plus one person, $1050 for exhibitor plus 2 people, etc.)?  Or is there a more flexible way to do it?

Thanks.
« Last Edit: June 30, 2008, 01:43:19 pm by Wonder95 »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Getting rid of "none" option in price sets
June 30, 2008, 02:56:34 pm
How about making one price set field for "Registration Fee" with 4 options (radio buttons):
Attendee - Member: $400
Attendee - Non-Member: 450
Exhibitor - Membesr: 1,000
....

Then you can create a second price set field, type = Text (amount). This field is for "Exhibitors - Additional People in Booth" - and it's "price" is $50. For this type of field, they enter the number of additional people and the final total will be calculated (i.e. if they enter "2" , then 2 x 50 is calculated).
Protect your investment in CiviCRM by  becoming a Member!

Wonder95

  • Guest
Re: Getting rid of "none" option in price sets
July 02, 2008, 02:17:18 pm
Cool, that works well for the attendees.  That brings up another question from my client.  Since I have Attendee and Exhibitor in the same price field, there is only one heading.  She would like to have an "Attendee" title above the two Attendee options and an "Exhibitor" title above the Exhibitor options.  At the same time, she doesn't want the "none" option, but the only way to get rid of that is to make the field required, and if I have them in two separate price sets to provide the titles,  I can't make them required since they are mutually exclusive.  Is there a way I can do what I need?  The only way I can see to do this is to have separate price sets and then use hook_form_alter() in a module to hide the "none" option.

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Getting rid of "none" option in price sets
July 02, 2008, 02:50:21 pm
I don't know of a way to do what you want w/o hacking the PHP code (which is why I suggested a single price set for both Attendee and Exhibitor fees). hook_form_alter is a drupal function and doesn't work on CiviCRM forms AFAIK.
Protect your investment in CiviCRM by  becoming a Member!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Getting rid of "none" option in price sets
July 02, 2008, 07:02:56 pm
Each of the fee options has a unique id assigned to it. You could get creative with your CSS and create a gap between the fees, and maybe insert a graphic as your header text (background image).

I wouldn't recommend using two fee sets without the "none" option -- the point of the none option is that if the field is not required, someone could inadvertently select an option and then get stuck. They need the option of unselecting.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Getting rid of "none" option in price sets
July 07, 2008, 04:33:38 pm
Hi,

I had more or less the same "advanced rules" on some form. I solved it with some jquery and changing the text or display=none of the --none-- option (very easy to select one specific item).

Tip: select the field by name instead of by id (the id changes often based on my experience). ie.
Use $("input[name=XXX]")....

Otherwise, you can create 4 different fields (check box):

Attendee       member          100
(empty label) non-member     200

...
 

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Getting rid of "none" option in price sets

This forum was archived on 2017-11-26.