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) »
  • payment option not appearing
Pages: [1]

Author Topic: payment option not appearing  (Read 1108 times)

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
payment option not appearing
December 29, 2013, 07:39:21 pm
It seems that the payment option selection radio box is not appearing.

But it appears in the source code.

        <fieldset class="crm-group payment_options-group" style="display:none;">
        <legend>Payment Options</legend>
        <div class="crm-section payment_processor-section">
          <div class="label"><label>Payment Method</label></div>
          <div class="content"><input value="3" type="radio" id="CIVICRM_QFID_3_payment_processor" name="payment_processor" checked="checked" class="form-radio" /><label for="CIVICRM_QFID_3_payment_processor">Credit/Debit Card</label>&nbsp;<input value="0" type="radio" id="CIVICRM_QFID_0_payment_processor" name="payment_processor" class="form-radio" /><label for="CIVICRM_QFID_0_payment_processor">Cheque/ATM/Internet Banking</label></div>
          <div class="clear"></div>
        </div>
      </fieldset>

After I click on "continue", it will come up with an error message, telling me to select the payment option.

The option then appears.

What could be the problem?

Detlev

  • I post occasionally
  • **
  • Posts: 68
  • Karma: 2
    • Software für Engagierte e.V.
  • CiviCRM version: 4.5
  • CMS version: Drupal
Re: payment option not appearing
December 30, 2013, 12:47:39 pm
Do you have any extensions enabled?

This may soun like a silly question, but in some cases, extensions may cause such problems...


Cheers,
Detlev

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
Re: payment option not appearing
December 30, 2013, 07:08:28 pm
No extensions actually.

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
Re: payment option not appearing
December 30, 2013, 07:50:24 pm
Found the solution.  :)

There was something wrong with the price sets.

A default option must be selected.

GinkgoDOB

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
  • Dir. of Product Development, Ginkgo Street Labs
    • Ginkgo Street Labs
  • CiviCRM version: v4.5-4.7
  • CMS version: Drupal
Re: payment option not appearing
January 11, 2014, 09:02:14 am
I'm having the same problem and I was getting ready to post here. I'm not sure what you mean that a default option has to be selected in the price set.

It seems to be something to do with the skipPaymentMethod() function firing on the code to hide the payment processor selection, but I can't figure out why. I'm using a bunch of jQuery show/hide based on selections, but most of it doesn't come into play until the Additional Participants (which is a different template), and I've tested it with my Register.extra.tpl code and I get the same result.

I can get the payment processor selection, which offers a choice between a Paypal Standard Standbox account and "Pay Later," to display -- IF
- I change the number of participants to >1, and
- I enter a quantity in a textbox field (my other fields are 1 select box, and check-boxes and radio buttons)

The problem seems to be the condition
Code: [Select]
(cj('#priceset input:checked').attr('data-amount') == 0) || (cj('#pricevalue').text() == symbol + " 0.00" )which appears to evaluate to 'false' when the form is loaded, in spite of a select box defaulting to a $79 membership purchase and a radio buttons for a $63 conference registration and a $-10 early registration discount being selected.

Any thoughts are welcome...

The registration form, which is a work-in-progress at the moment is here

http://crm.vahomeschoolers.org/?page=CiviCRM&q=civicrm/event/register&reset=1&id=2


Code: [Select]
function skipPaymentMethod() {
      var symbol = '$';
      var isMultiple = '1';

      var flag = 1;
      if (isMultiple && cj("#additional_participants").val()) {
        flag = 0;
      }

      if (((cj('#priceset input:checked').attr('data-amount') == 0) ||
        (cj('#pricevalue').text() == symbol + " 0.00" )) && flag) {
        cj(".payment_options-group").hide();
        cj("div.payment_processor-section").hide();
        cj("div#payment_information").hide();
        // also unset selected payment methods
        cj('input[name="payment_processor"]').removeProp('checked');
      }
      else {
        cj(".payment_options-group").show();
        cj("div.payment_processor-section").show();
        cj("div#payment_information").show();
      }
    }

GinkgoDOB

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
  • Dir. of Product Development, Ginkgo Street Labs
    • Ginkgo Street Labs
  • CiviCRM version: v4.5-4.7
  • CMS version: Drupal
Re: payment option not appearing
January 11, 2014, 12:07:35 pm
OK. I've just spent more time than I'd like to admit mucking about the code and - if I understand what's happening in this snippet - I might have it licked

Code: [Select]
if (((cj('#priceset input:checked').attr('data-amount') == 0) ||
        (cj('#pricevalue').text() == symbol + " 0.00" )) && flag) {

IF (the price of all of the selected options on the form is zero *OR* the total price displayed at the bottom of the form is zero ) *AND* the event allows and has multiple participants
THEN hide and clear the payment processor options

I doubt this is the most elegant jQuery, but this seems to have done the trick. Basically I loop through and calculate the price of the checked options and calculate a total. I'm assuming the code I replaced would return "true" if all of the checked options had prices of zero.

Code: [Select]
var priceOfChecked = 0;
cj('#priceset input:checked').each( function () {
        priceOfChecked += parseInt( cj(this).attr('data-amount') );
});
      if (((priceOfChecked == 0) ||
        (cj('#pricevalue').text() == symbol + " 0.00" )) && flag) {

I'm hard-pressed to call it a bug, 'cuz I'm not really sure of what was going on there. (I suppose could have brute-forced it because the event I'm setting up can never have a non-zero price when I'm done.)
« Last Edit: January 11, 2014, 02:08:41 pm by axon-obriend »

GinkgoDOB

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 1
  • Dir. of Product Development, Ginkgo Street Labs
    • Ginkgo Street Labs
  • CiviCRM version: v4.5-4.7
  • CMS version: Drupal
Re: payment option not appearing
January 11, 2014, 02:08:15 pm
It still wasn't working on another event. Is there a reason the condition shouldn't just be

Code: [Select]
     if ( (cj('#pricevalue').text() == symbol + " 0.00" ) && flag) {

to check that the total is non-zero or that additional participants are being registered?

mudnik

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: drupal
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.23
Re: payment option not appearing
January 13, 2014, 05:13:01 pm
I mean when I set up the price sets, one of the options must be set to be the default option.

galgeek

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
  • CiviCRM version: 4.6.0
  • CMS version: drupal 7.36
  • MySQL version: 5.5
  • PHP version: 5.3
Re: payment option not appearing
April 30, 2014, 09:40:15 pm
I'm having similar trouble, with Payment Options disappearing when I use a radio button to note that I want to pay another amount, with that radio option set to 0 and the payment amount set in a text box below. Payment options = PayPal standard and pay later.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • payment option not appearing

This forum was archived on 2017-11-26.