| 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 WP Charitable LLC |
| 8 |
* @package Charitable/Templates/Donation Form |
| 9 |
* @since 1.0.0 |
| 10 |
* @version 1.5.0 |
| 11 |
* @version 1.8.8.6 |
| 12 |
*/ |
| 13 |
|
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
if ( ! isset( $view_args['form'] ) ) { |
| 19 |
return; |
| 20 |
} |
| 21 |
|
| 22 |
/* @var Charitable_Donation_Form */ |
| 23 |
$charitable_form = $view_args['form']; |
| 24 |
$charitable_form_id = $charitable_form->get_form_identifier(); |
| 25 |
$charitable_campaign = $charitable_form->get_campaign(); |
| 26 |
|
| 27 |
if ( is_null( $charitable_campaign ) ) { |
| 28 |
return; |
| 29 |
} |
| 30 |
|
| 31 |
$charitable_suggested = $charitable_campaign->get_suggested_donations(); |
| 32 |
$charitable_currency_helper = charitable_get_currency_helper(); |
| 33 |
|
| 34 |
if ( empty( $charitable_suggested ) && ! $charitable_campaign->get( 'allow_custom_donations' ) ) { |
| 35 |
return; |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Do something before the donation options fields. |
| 40 |
* |
| 41 |
* @since 1.0.0 |
| 42 |
* |
| 43 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 44 |
*/ |
| 45 |
do_action( 'charitable_donation_form_before_donation_amount', $charitable_form ); |
| 46 |
|
| 47 |
?> |
| 48 |
<div class="charitable-donation-options"> |
| 49 |
<?php |
| 50 |
/** |
| 51 |
* Do something before the donation amounts are listed. |
| 52 |
* |
| 53 |
* @since 1.0.0 |
| 54 |
* |
| 55 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 56 |
*/ |
| 57 |
do_action( 'charitable_donation_form_before_donation_amounts', $charitable_form ); |
| 58 |
|
| 59 |
charitable_template_from_session( |
| 60 |
'donation-form/donation-amount-list.php', |
| 61 |
array( |
| 62 |
'campaign' => $charitable_campaign, |
| 63 |
'form_id' => $charitable_form_id, |
| 64 |
), |
| 65 |
'donation_form_amount_field', |
| 66 |
array( |
| 67 |
'campaign_id' => $charitable_campaign->ID, |
| 68 |
'form_id' => $charitable_form_id, |
| 69 |
) |
| 70 |
); |
| 71 |
|
| 72 |
/** |
| 73 |
* Do something after the donation amounts are listed. |
| 74 |
* |
| 75 |
* @since 1.0.0 |
| 76 |
* |
| 77 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 78 |
*/ |
| 79 |
do_action( 'charitable_donation_form_after_donation_amounts', $charitable_form ); |
| 80 |
?> |
| 81 |
</div><!-- .charitable-donation-options --> |
| 82 |
<?php |
| 83 |
|
| 84 |
/** |
| 85 |
* Do something after the donation options fields. |
| 86 |
* |
| 87 |
* @since 1.0.0 |
| 88 |
* |
| 89 |
* @param Charitable_Donation_Form $form An instance of `Charitable_Donation_Form`. |
| 90 |
*/ |
| 91 |
do_action( 'charitable_donation_form_after_donation_amount', $charitable_form ); |
| 92 |
|