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) »
  • Additional fields on CiviMember price set won't reset value
Pages: [1]

Author Topic: Additional fields on CiviMember price set won't reset value  (Read 530 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
Additional fields on CiviMember price set won't reset value
January 26, 2014, 07:43:53 pm
I create a CiviContribute form for registering members. There is an additional item members can sign up for which we added to the price set. The price field shows up correctly on the form, and the price is recorded correctly when the radio button is clicked. The problem is that when the "No Thank You" option is selected, the value isn't reset.

I looked at the javascript called by the onClick event and at the contribution form code. Out of curiosity, I printed the value of the $priceset variable that is used in the smarty template and it is always null. There is another variable called $priceSet that is an array containing all of the priceset information, but I don't see how it fits with the javascript code.

This is on a D7 install just upgraded from Civi 4.41 to 4.43 (it didn't work under 4.41 either).

Is this a possible bug, or did I mis-configure something? If you need additional information just let me know, I'm happy to dig in and even write a little code if we can track down the source of the problem.

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

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Additional fields on CiviMember price set won't reset value
January 27, 2014, 09:08:25 am
Quote
I create a CiviContribute form for registering members. There is an additional item members can sign up for which we added to the price set. The price field shows up correctly on the form, and the price is recorded correctly when the radio button is clicked. The problem is that when the "No Thank You" option is selected, the value isn't reset.

Is "No Thank You" price set field ? If yes then I think you will need special javascript to unset the total amount. I am assuming you are using membership price sets.

Quote
I looked at the javascript called by the onClick event and at the contribution form code. Out of curiosity, I printed the value of the $priceset variable that is used in the smarty template and it is always null. There is another variable called $priceSet that is an array containing all of the priceset information, but I don't see how it fits with the javascript code.
This might be bug, can you specify which files use this variable.

Thanks
Kurund
« Last Edit: January 27, 2014, 09:51:53 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

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: Additional fields on CiviMember price set won't reset value
January 27, 2014, 12:54:05 pm
That javascript is in CRM/Contribute/Form/Contribution/Main.tpl in the clearAmountOther javascript method (Line 79). The $priceset variable is a smarty literal rendered in the js.

The "No Thank You" option is not a priceset field, it is rendered automatically in the contribution page. I added a "No Thank You" option to the priceset and I am using a buildForm hook to remove the auto-rendered version for now so I can get the project finished.
« Last Edit: January 27, 2014, 01:02:24 pm by qjensen »
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

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Additional fields on CiviMember price set won't reset value
January 27, 2014, 01:25:27 pm
Quote
That javascript is in CRM/Contribute/Form/Contribution/Main.tpl in the clearAmountOther javascript method (Line 79). The $priceset variable is a smarty literal rendered in the js.
Yes, this is definitely a bug.

Quote
The "No Thank You" option is not a priceset field, it is rendered automatically in the contribution page. I added a "No Thank You" option to the priceset and I am using a buildForm hook to remove the auto-rendered version for now so I can get the project finished.

I am bit confused about you contribution page setup. Can you please setup a sample contribution page on http://drupal.demo.civicrm.org and confirm if you are able to replicate this issue.

Kurund
« Last Edit: January 27, 2014, 02:45:30 pm by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

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: Additional fields on CiviMember price set won't reset value
January 27, 2014, 02:23:33 pm
Ok - I blew away my price set and recreated it and now it works correctly - just like the demo site.

The "No Thank You" option I was getting is defined CRM/Contribute/Form/Contribution/MembershipBlock.tpl line 232. It is only supposed to be displayed if a membership sign up is not required. I don't know what triggered that to display. I went back to my old price set and set all fields to Not Required, then set them back to required and everything displayed and worked correctly.

I'm not sure what happened as I cannot replicate it now so I will just keep my eyes open to see if it happens again.

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Additional fields on CiviMember price set won't reset value

This forum was archived on 2017-11-26.