| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template used to display the donation amount inputs. |
| 4 |
* |
| 5 |
* Override this template by copying it to yourtheme/charitable/donation-form/donation-amount.php |
| 6 |
* |
| 7 |
* @author Studio 164a |
| 8 |
* @package Charitable/Templates/Donation Form |
| 9 |
* @since 1.0.0 |
| 10 |
* @version 1.5.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { exit; } |
| 14 |
|
| 15 |
if ( ! isset( $view_args['form'] ) ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
/* @var Charitable_Donation_Form */ |
| 20 |
$form = $view_args['form']; |
| 21 |
$form_id = $form->get_form_identifier(); |
| 22 |
$campaign = $form->get_campaign(); |
| 23 |
|
| 24 |
if ( is_null( $campaign ) ) { |
| 25 |
return; |
| 26 |
} |
| 27 |
|
| 28 |
$suggested = $campaign->get_suggested_donations(); |
| 29 |
$currency_helper = charitable_get_currency_helper(); |
| 30 |
|
| 31 |
if ( empty( $suggested ) && ! $campaign->get( 'allow_custom_donations' ) ) { |
| 32 |
return; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Do something before the donation options fields. |
| 37 |
* |
| 38 |
* @since 1.0.0 |
| 39 |
* |
| 40 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 41 |
*/ |
| 42 |
do_action( 'charitable_donation_form_before_donation_amount', $form ); |
| 43 |
|
| 44 |
?> |
| 45 |
<div class="charitable-donation-options"> |
| 46 |
<?php |
| 47 |
/** |
| 48 |
* @hook charitable_donation_form_before_donation_amounts |
| 49 |
*/ |
| 50 |
do_action( 'charitable_donation_form_before_donation_amounts', $form ); |
| 51 |
|
| 52 |
charitable_template_from_session( 'donation-form/donation-amount-list.php', |
| 53 |
array( |
| 54 |
'campaign' => $campaign, |
| 55 |
'form_id' => $form_id, |
| 56 |
), |
| 57 |
'donation_form_amount_field', |
| 58 |
array( |
| 59 |
'campaign_id' => $campaign->ID, |
| 60 |
'form_id' => $form_id, |
| 61 |
) |
| 62 |
); |
| 63 |
|
| 64 |
/** |
| 65 |
* @hook charitable_donation_form_after_donation_amounts |
| 66 |
*/ |
| 67 |
do_action( 'charitable_donation_form_after_donation_amounts', $form ); |
| 68 |
|
| 69 |
?> |
| 70 |
</div><!-- .charitable-donation-options --> |
| 71 |
<?php |
| 72 |
|
| 73 |
/** |
| 74 |
* Do something after the donation options fields. |
| 75 |
* |
| 76 |
* @since 1.0.0 |
| 77 |
* |
| 78 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 79 |
*/ |
| 80 |
do_action( 'charitable_donation_form_after_donation_amount', $form ); |
| 81 |
|