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) »
  • Billing Phone needed for online event
Pages: [1]

Author Topic: Billing Phone needed for online event  (Read 891 times)

AkronAA

  • I’m new here
  • *
  • Posts: 18
  • Karma: 1
Billing Phone needed for online event
February 11, 2010, 12:43:31 pm
We need to collect the billing phone of our credit card users along with the billing address.  To avoid confusion, we want to collect it in the same space as other billing information is collected, but I haven't found a way to modify BillingBlock.tpl that works  >:(.  I tried coding in as phone-5-1, but it does not show up unless we create and show a profile on the same page, therefore having two phone-5-1 inputs.  Any ideas on how to collect billing phone within the form?

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: Billing Phone needed for online event
February 11, 2010, 03:10:05 pm

you'll need to use the buildForm hook to add the element to the form. BillingBlock.tpl can then display that element. Information on hooks is here:

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification

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

AkronAA

  • I’m new here
  • *
  • Posts: 18
  • Karma: 1
Re: Billing Phone needed for online event
February 12, 2010, 09:51:01 am
Custom Templates and Custom PHP are defined

created custom Form.php in media/customtpl/templates/CRM/Core/Payment and added

$form->_fields["phone-{$bltID}-1"] =
            array( 'htmlType'   => 'text',
                   'name'       => "phone-{$bltID}-1",
                   'title'      => ts('Billing Phone'),
                   'cc_field'   => true,
                   'attributes' => array( 'size' => 30, 'maxlength' => 60, 'autocomplete' => 'off' ),
                   'is_required'=> true
                   );

created custom BillingBlock.tpl in media/customtpl/templates/CRM/Core and added:

{assign var=n value=phone-$bltID-1}
                        <div class="section {$form.$n.name}-section">   
                     <div class="label">{$form.$n.label}</div>
                            <div class="content">{$form.$n.html}</div>
                            <div class="clear"></div>


This shows up on our registration page at https://foundersdayregistration.akronaa.org/register-for-founders-day-2010.html.

Will this work properly?

I'm not sure I can do the hooks properly, but modifying these files seemed to work.

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: Billing Phone needed for online event
February 12, 2010, 10:43:05 am

that should work :)

however, we do recommend using hooks and customized templates rather than modifying the core code files

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Billing Phone needed for online event

This forum was archived on 2017-11-26.