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) »
  • Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
Pages: [1]

Author Topic: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)  (Read 1017 times)

smashingx

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.22
  • MySQL version: n/a
  • PHP version: n/a
Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
September 11, 2012, 12:28:20 pm
Hi,

I've been trying to fix this bug, that for what I know it also exists on 4.2. The problem is that there's no point for the user to see payment information if what the user has to pay for an event is 0, so what I was trying to do is to see how the function of paying later works, and do something similar to that. I don't know if that's a long time spending on this bug but I have spent about 15 hours trying to get a solution for this although I don't think someone from the staff would take that long. Anyways, I noticed that the value that the user has to pay is calculated on the file /CRM/Price/Form/Calculate.tpl where I see that at the beginning it shows the label for the user to see how much he'll have to pay. The amount is stored on the variable called totalfee.
So far so good, since I've tested this variables and I know those are the right variables. Then after that I will have to modify the file CRM/Event/Form/Registration/Register.tpl since is there where I can call the function that hides the payment information. The problem is that how can I pass the value from the file calculate to register. I was thinking in creating a global variable but I'm not sure if that would work. in the Calculate file I did this:
if (totalfee === 0 ) {
hide( 'payment_information' );      
   } else {
             show( 'payment_information' );
}
but obviously it doesn't recognize what payment information is, since it's not declared in that file.

Please any help on this would be greatly appreciated.

Thanks

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 03, 2013, 03:54:06 pm
Hi - did you make any headway on this. I think we are hitting the same problem - that Price Sets with a $0 still require a Payment Method to be chosen - which seems to be a bug to me.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 03, 2013, 03:57:04 pm
Scenario in our case is
- not attending workshops = $0
- attending morning workshop = $0
- attending afternoong workshop (choice of two) = $50

I can't see how to construct this currently such that payment is only required if total > $0

Am I missing something simple?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

DicE

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 0
  • CiviCRM version: 4.5.1
  • CMS version: Drupal 7.latest
  • MySQL version: 5.5.25a
  • PHP version: 5.3.15
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 04, 2013, 03:27:53 am
petednz,

this problem is on the list of fixes to be included in the 4.4 update.
http://issues.civicrm.org/jira/browse/CRM-10988
http://issues.civicrm.org/jira/browse/CRM-8850

Wouldn't mind that this gets mentioned again though. I also would really appreciate a fix on this.
Not being a programmer myself I have to place my faith in these great developers though. The non-profit organisation I volunteer for is not able to invest money :(

DicE

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 04, 2013, 10:22:14 am
Yes I understand about budget constraints.

Actually the problem may be different but am waiting on confirmation before I put something in Jira.

The two you reference are both about multi participants

In our case it is only single participant. But yes, same concept, seems that we can't complete a registration on an Event that allows for payment if the cost is $0
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 05, 2013, 09:42:03 am
I'm doing QA on a sandbox upgrade to Civi 4.2.7 on Joomla 2.58. In addition to the $0 value payment required problem, I'm noticing that if don't select a Payment Processor under Manage Event>Configure>Fees, you are still able to select the Payments button in the event and you see the Choose Paypal or enter a Credit card area. Thing is, the only payment processor set up is Paypal. If the paying registrant enters a credit card, is it processed through Paypal or does the system think there is another payment processor available?

The payments section being required for $0 value registrations (99% of the people attending this event) will be a major show stopper for our client. We need this upgrade to fix the older Scheduled Jobs issue from 4.1.

The related issue is that when I select a payment processor type under Configure Event>Fees, the following errors are given, which almost looks like the system thinks I'm trying to set up two payment processors?

I created a brand new event and get the same error when I try to select a payment processor.

On another site, in production and using 4.2.7, when I select a payment processor for a new event, I am not getting an error message like I do for the sandbox site. The only difference is that the production site has only one payment processor setup, while the sandbox site has two.

Any insight would be appreciated.

Code: [Select]
backTrace

#0 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php(968): PEAR_Error->PEAR_Error("DB Error: already exists", -5, 16, (Array:2), "UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...")
#4 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-5, 16, (Array:2), "UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...")
#5 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1903): PEAR->raiseError(NULL, -5, NULL, NULL, "UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...", "DB_Error", TRUE)
#6 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-5, NULL, NULL, NULL, "1062 ** Duplicate entry '5' for key 'payment_processor'")
#7 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...")
#9 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...")
#10 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(1324): DB_DataObject->_query("UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payme...")
#11 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(284): DB_DataObject->update()
#12 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/BAO/Event.php(104): CRM_Core_DAO->save()
#13 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/ManageEvent/Fee.php(766): CRM_Event_BAO_Event::add((Array:26))
#14 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(246): CRM_Event_Form_ManageEvent_Fee->postProcess()
#15 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(151): CRM_Core_Form->mainProcess()
#16 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(128): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#17 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#18 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#19 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(289): HTML_QuickForm_Page->handle("upload")
#20 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Wrapper.php(115): CRM_Core_Controller->run()
#21 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(194): CRM_Utils_Wrapper->run("CRM_Event_Form_ManageEvent_Fee", "Event Fees", NULL)
#22 /home/devfam/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(51): CRM_Core_Invoke::_invoke((Array:4))
#23 /home/devfam/public_html/administrator/components/com_civicrm/admin.civicrm.php(87): CRM_Core_Invoke::invoke((Array:4))
#24 /home/devfam/public_html/administrator/components/com_civicrm/admin.civicrm.php(40): civicrm_invoke()
#25 /home/devfam/public_html/libraries/joomla/application/component/helper.php(383): require_once("/home/devfam/public_html/administrator/components/com_civicrm/admin.civicrm.php")
#26 /home/devfam/public_html/libraries/joomla/application/component/helper.php(351): JComponentHelper::executeComponent("/home/devfam/public_html/administrator/components/com_civicrm/admin.civicrm.php")
#27 /home/devfam/public_html/administrator/includes/application.php(153): JComponentHelper::renderComponent("com_civicrm")
#28 /home/devfam/public_html/administrator/index.php(46): JAdministrator->dispatch()
#29 {main}

Database Error Code: Duplicate entry '5' for key 'payment_processor', 1062
Additional Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payment_processor = '5' , fee_label = 'Registration Type' , is_pay_later = 1 , pay_later_text = 'Check this box if you are a professional/provider attendee and will be paying by check or purchase order.' , pay_later_receipt = 'Professional/Provider attendees should mail checks and purchase orders directly to The Family Café office. There is no charge for individuals with disabilities or their families.' , is_template = 0 , currency = 'USD'   WHERE (  civicrm_event.id = 5 )   [nativecode=1062 ** Duplicate entry '5' for key 'payment_processor']
    [type] => DB_Error
    [user_info] => UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payment_processor = '5' , fee_label = 'Registration Type' , is_pay_later = 1 , pay_later_text = 'Check this box if you are a professional/provider attendee and will be paying by check or purchase order.' , pay_later_receipt = 'Professional/Provider attendees should mail checks and purchase orders directly to The Family Café office. There is no charge for individuals with disabilities or their families.' , is_template = 0 , currency = 'USD'   WHERE (  civicrm_event.id = 5 )   [nativecode=1062 ** Duplicate entry '5' for key 'payment_processor']
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_event  SET is_monetary = 1 , contribution_type_id = 4 , payment_processor = '5' , fee_label = 'Registration Type' , is_pay_later = 1 , pay_later_text = 'Check this box if you are a professional/provider attendee and will be paying by check or purchase order.' , pay_later_receipt = 'Professional/Provider attendees should mail checks and purchase orders directly to The Family Café office. There is no charge for individuals with disabilities or their families.' , is_template = 0 , currency = 'USD'   WHERE (  civicrm_event.id = 5 )   [nativecode=1062 ** Duplicate entry '5' for key 'payment_processor']"]
)

« Last Edit: February 05, 2013, 11:15:57 am by penguintrax »

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: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 05, 2013, 01:42:45 pm

can you see if you can reproduce this issue on our joomla demo server

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

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 06, 2013, 06:57:58 am
I will - just ran out of hours yesterday.

Thanks for the reply!

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Hiding the payment information info if amount to pay is 0 problem (fixing a bug)
February 06, 2013, 10:41:01 am
Quote from: Donald Lobo on February 05, 2013, 01:42:45 pm

can you see if you can reproduce this issue on our joomla demo server

lobo

I can't reproduce it on the demo server, so that confirms that the problem must be inherent to the upgrade that was done on this account. We are looking into it now.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Hiding the payment information info if amount to pay is 0 problem (fixing a bug)

This forum was archived on 2017-11-26.