2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {crmRegion name="billing-block"}
27 {* Add 'required' marker to billing fields in this template for front-end / online contribution and event registration forms only. *}
28 {if $context EQ 'front-end'}
29 {assign var=reqMark value=' <span class="crm-marker" title="This field is required.">*</span>'}
31 {assign var=reqMark value=''}
34 {if $form.credit_card_number or $form.bank_account_number}
35 <div id="payment_information">
36 <fieldset class="billing_mode-group {if $paymentProcessor.payment_type & 2}direct_debit_info-group{else}credit_card_info-group{/if}">
38 {if $paymentProcessor.payment_type & 2}
39 {ts}Direct Debit Information{/ts}
41 {ts}Credit Card Information{/ts}
44 {if $paymentProcessor.billing_mode & 2 and !$hidePayPalExpress }
45 <div class="crm-section no-label paypal_button_info-section">
46 <div class="content description">
47 {ts}If you have a PayPal account, you can click the PayPal button to continue. Otherwise, fill in the credit card and billing information on this form and click
48 <strong>Continue</strong>
49 at the bottom of the page.{/ts}
52 <div class="crm-section no-label {$form.$expressButtonName.name}-section">
53 <div class="content description">
54 {$form.$expressButtonName.html}
55 <div class="description">Save time. Checkout securely. Pay without sharing your financial information.</div>
60 {if $paymentProcessor.billing_mode & 1}
61 <div class="crm-section billing_mode-section {if $paymentProcessor.payment_type & 2}direct_debit_info-section{else}credit_card_info-section{/if}">
62 {if $paymentProcessor.payment_type & 2}
63 <div class="crm-section {$form.account_holder.name}-section">
64 <div class="label">{$form.account_holder.label}</div>
65 <div class="content">{$form.account_holder.html}</div>
66 <div class="clear"></div>
68 <div class="crm-section {$form.bank_account_number.name}-section">
69 <div class="label">{$form.bank_account_number.label}</div>
70 <div class="content">{$form.bank_account_number.html}</div>
71 <div class="clear"></div>
73 <div class="crm-section {$form.bank_identification_number.name}-section">
74 <div class="label">{$form.bank_identification_number.label}</div>
75 <div class="content">{$form.bank_identification_number.html}</div>
76 <div class="clear"></div>
78 <div class="crm-section {$form.bank_name.name}-section">
79 <div class="label">{$form.bank_name.label}</div>
80 <div class="content">{$form.bank_name.html}</div>
81 <div class="clear"></div>
84 <div class="crm-section {$form.credit_card_type.name}-section">
85 <div class="label">{$form.credit_card_type.label} {$reqMark}</div>
87 {$form.credit_card_type.html}
88 <div class="crm-credit_card_type-icons"></div>
90 <div class="clear"></div>
92 <div class="crm-section {$form.credit_card_number.name}-section">
93 <div class="label">{$form.credit_card_number.label} {$reqMark}</div>
94 <div class="content">{$form.credit_card_number.html|crmAddClass:creditcard}</div>
95 <div class="clear"></div>
97 <div class="crm-section {$form.cvv2.name}-section">
98 <div class="label">{$form.cvv2.label} {$reqMark}</div>
101 <span class="cvv2-icon"
102 title="{ts}Usually the last 3-4 digits in the signature area on the back of the card.{/ts}"> </span>
104 <div class="clear"></div>
106 <div class="crm-section {$form.credit_card_exp_date.name}-section">
107 <div class="label">{$form.credit_card_exp_date.label} {$reqMark}</div>
108 <div class="content">{$form.credit_card_exp_date.html}</div>
109 <div class="clear"></div>
118 {if $profileAddressFields}
119 <input type="checkbox" id="billingcheckbox" value="0">
120 <label for="billingcheckbox">{ts}My billing address is the same as above{/ts}</label>
122 <fieldset class="billing_name_address-group">
123 <legend>{ts}Billing Name and Address{/ts}</legend>
124 <div class="crm-section billing_name_address-section">
125 <div class="crm-section {$form.billing_first_name.name}-section">
126 <div class="label">{$form.billing_first_name.label} {$reqMark}</div>
127 <div class="content">{$form.billing_first_name.html}</div>
128 <div class="clear"></div>
130 <div class="crm-section {$form.billing_middle_name.name}-section">
131 <div class="label">{$form.billing_middle_name.label}</div>
132 <div class="content">{$form.billing_middle_name.html}</div>
133 <div class="clear"></div>
135 <div class="crm-section {$form.billing_last_name.name}-section">
136 <div class="label">{$form.billing_last_name.label} {$reqMark}</div>
137 <div class="content">{$form.billing_last_name.html}</div>
138 <div class="clear"></div>
140 {assign var=n value=billing_street_address-$bltID}
141 <div class="crm-section {$form.$n.name}-section">
142 <div class="label">{$form.$n.label} {$reqMark}</div>
143 <div class="content">{$form.$n.html}</div>
144 <div class="clear"></div>
146 {assign var=n value=billing_city-$bltID}
147 <div class="crm-section {$form.$n.name}-section">
148 <div class="label">{$form.$n.label} {$reqMark}</div>
149 <div class="content">{$form.$n.html}</div>
150 <div class="clear"></div>
152 {assign var=n value=billing_country_id-$bltID}
153 <div class="crm-section {$form.$n.name}-section">
154 <div class="label">{$form.$n.label} {$reqMark}</div>
155 <div class="content">{$form.$n.html|crmAddClass:big}</div>
156 <div class="clear"></div>
158 {assign var=n value=billing_state_province_id-$bltID}
159 <div class="crm-section {$form.$n.name}-section">
160 <div class="label">{$form.$n.label} {$reqMark}</div>
161 <div class="content">{$form.$n.html|crmAddClass:big}</div>
162 <div class="clear"></div>
164 {assign var=n value=billing_postal_code-$bltID}
165 <div class="crm-section {$form.$n.name}-section">
166 <div class="label">{$form.$n.label} {$reqMark}</div>
167 <div class="content">{$form.$n.html}</div>
168 <div class="clear"></div>
174 {if $profileAddressFields}
175 <script type="text/javascript">
179 // build list of ids to track changes on
180 var address_fields = {/literal}{$profileAddressFields|@json_encode}{literal};
183 var orig_id, field, field_name;
186 $('.billing_name_address-section input').each(function (i) {
187 orig_id = $(this).attr('id');
188 field = orig_id.split('-');
189 field_name = field[0].replace('billing_', '');
191 if (address_fields[field_name]) {
192 input_ids['#' + field_name + '-' + address_fields[field_name]] = '#' + orig_id;
196 if ($('#first_name').length)
197 input_ids['#first_name'] = '#billing_first_name';
198 if ($('#middle_name').length)
199 input_ids['#middle_name'] = '#billing_middle_name';
200 if ($('#last_name').length)
201 input_ids['#last_name'] = '#billing_last_name';
204 $('.billing_name_address-section select').each(function (i) {
205 orig_id = $(this).attr('id');
206 field = orig_id.split('-');
207 field_name = field[0].replace('billing_', '').replace('_id', '');
209 if (address_fields[field_name]) {
210 select_ids['#' + field_name + '-' + address_fields[field_name]] = '#' + orig_id;
215 // detect if billing checkbox should default to checked
217 for (var id in input_ids) {
218 orig_id = input_ids[id];
219 if ($(id).val() != $(orig_id).val()) {
224 for (var id in select_ids) {
225 orig_id = select_ids[id];
226 if ($(id).val() != $(orig_id).val()) {
232 $('#billingcheckbox').prop('checked', true);
233 if (CRM.billing.billingProfileIsHideable) {
234 $('.billing_name_address-group').hide();
238 // onchange handlers for non-billing fields
239 for (var id in input_ids) {
240 orig_id = input_ids[id];
241 $(id).change(function () {
242 var id = '#' + $(this).attr('id');
243 var orig_id = input_ids[id];
245 // if billing checkbox is active, copy other field into billing field
246 if ($('#billingcheckbox').prop('checked')) {
247 $(orig_id).val($(id).val());
251 for (var id in select_ids) {
252 orig_id = select_ids[id];
253 $(id).change(function () {
254 var id = '#' + $(this).attr('id');
255 var orig_id = select_ids[id];
257 // if billing checkbox is active, copy other field into billing field
258 if ($('#billingcheckbox').prop('checked')) {
259 $(orig_id + ' option').prop('selected', false);
260 $(orig_id + ' option[value="' + $(id).val() + '"]').prop('selected', true);
263 if (orig_id == '#billing_country_id-5') {
271 $('#billingcheckbox').click(function () {
273 if (CRM.billing.billingProfileIsHideable) {
274 $('.billing_name_address-group').hide(200);
278 for (var id in input_ids) {
279 orig_id = input_ids[id];
280 $(orig_id).val($(id).val());
282 for (var id in select_ids) {
283 orig_id = select_ids[id];
284 $(orig_id + ' option').prop('selected', false);
285 $(orig_id + ' option[value="' + $(id).val() + '"]').prop('selected', true);
288 $('.billing_name_address-group').show(200);
292 // remove spaces, dashes from credit card number
293 $('#credit_card_number').change(function () {
294 var cc = $('#credit_card_number').val()
297 $('#credit_card_number').val(cc);