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) »
  • Default Price Not Selected in Registration Form
Pages: [1]

Author Topic: Default Price Not Selected in Registration Form  (Read 1500 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Default Price Not Selected in Registration Form
May 04, 2010, 07:15:14 am
I have an event that has a single price option. I set it up using the simple pricing, not a price set, and I set the price to be the default. When a user goes to register, the single price option is not selected. This is confusing some of the registrants who expect to be able to just register and not select the price option because it is the only option.

Is there a way for me to make this option selected by default?

It looks like this would work fine using a price set, but I already have many registrants for this event and can't change the price settings.

Thanks for your help,
Quint
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Default Price Not Selected in Registration Form
May 04, 2010, 07:19:06 am
I once achieved such a thing with a few lines of jQuery. Aside from JS, I do not think there is any other (simple) way.

EDIT: I definitely had this issue once, but it was on an older version of CiviCRM. Apparently (see below) this works now.
« Last Edit: May 05, 2010, 02:26:03 am by hershel »
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Default Price Not Selected in Registration Form
May 04, 2010, 07:36:10 am
Quote
I have an event that has a single price option. I set it up using the simple pricing, not a price set, and I set the price to be the default. When a user goes to register, the single price option is not selected.

IMO It should be selected.

can u try to replicate on http://drupal.demo.civicrm.org/

kiran
You Are Designed To Choose... Defined By Choice.

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Default Price Not Selected in Registration Form
May 04, 2010, 07:47:49 am
Quote from: Kiran Jagtap on May 04, 2010, 07:36:10 am
Quote
I have an event that has a single price option. I set it up using the simple pricing, not a price set, and I set the price to be the default. When a user goes to register, the single price option is not selected.

IMO It should be selected.

can u try to replicate on http://drupal.demo.civicrm.org/

kiran

Hi Kiran,

You are correct. It does work on the demo site, but not on my live site.

The only real difference I can see is that my event is based on a template, but that should not matter(?).

Are there any other settings that might effect this?

I am using CiviCRM 3.1.4 on this site.

Thanks for your help,
Q
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Default Price Not Selected in Registration Form
May 04, 2010, 11:37:26 pm
1. can u check Event Fee section from Manage Event, and make sure your fee option is mark as default  = true.
2. also to debug, go to  CRM/Event/Form/Registration/Register.php in buildAmount() function, line around 496
and here do check for $form->_defaults['amount'], it should contain id of your price option.

Also do u have any discount set enable for given event ? if yes -
go to line around 201 in the same file in function setDefaultValues(); and check for  $this->_defaults['amount'].

Basically we has to have price option id set in $this->_defaults['amount'] before returning from setDefaultValues(); function line around 258

hope this help

kiran
You Are Designed To Choose... Defined By Choice.

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Default Price Not Selected in Registration Form
May 05, 2010, 02:06:37 pm
Hi kiran

Thanks for the pointers. It turns out that there wasn't a problem with the code. When I looked at the db, the default_fee_id field was NULL. I tracked down the correct fee id and manually changed the value in the db and it worked as expected.

This is strange because the radio button on the fee indicated that it was set as the default, but I don't know how if the value in the db was NULL.

Anyways, it is working correctly now.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Default Price Not Selected in Registration Form
May 05, 2010, 02:14:26 pm
> This is strange because the radio button on the fee indicated that it was set as the default, but I don't know how if the value in the db was NULL.

Well, that would actually tend to indicate a potential problem in the code. The DB values only got there because the code set them. :)

Can you attempt to recreate this situation?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Default Price Not Selected in Registration Form
May 06, 2010, 12:27:36 am
hey hershel,

I filed issue for suspected root cause : http://issues.civicrm.org/jira/browse/CRM-6202

kiran
You Are Designed To Choose... Defined By Choice.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Default Price Not Selected in Registration Form
May 06, 2010, 02:39:55 am
Great. Thanks, Kiran
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Default Price Not Selected in Registration Form

This forum was archived on 2017-11-26.