/** * Check for Variation Prices HTML (Multi-level donation forms) * * @since 1.6 * * @return void */ function give_check_for_form_price_variations_html() { if (!current_user_can('edit_give_payments', get_current_user_id())) { wp_die(); } $form_id = intval($_POST['form_id']); $payment_id = intval($_POST['payment_id']); $form = get_post($form_id); if ('give_forms' != $form->post_type) { wp_die(); } if (!give_has_variable_prices($form_id)) { esc_html_e('n/a', 'give'); } else { // Payment object. $payment = new Give_Payment($payment_id); // Payment meta. $payment_meta = $payment->get_meta(); // Variable price dropdown options. $variable_price_dropdown_option = array('id' => $form_id, 'name' => 'give-variable-price', 'chosen' => true, 'show_option_all' => '', 'selected' => $payment_meta['price_id']); // Render variable prices select tag html. give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); } give_die(); }
</td> <td> <?php give_get_form_dropdown(array('id' => $payment_meta['form_id'], 'selected' => $payment_meta['form_id'], 'chosen' => true), true); ?> </td> <td> <?php $var_prices = give_has_variable_prices($payment_meta['form_id']); if (empty($var_prices)) { echo esc_html__('n/a', 'give'); } else { // Variable price dropdown options. $variable_price_dropdown_option = array('id' => $payment_meta['form_id'], 'name' => 'give-variable-price', 'chosen' => true, 'show_option_all' => '', 'selected' => $payment_meta['price_id']); // Render variable prices select tag html. give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); } ?> </td> <td> <?php //Transaction Date $date_format = get_option('date_format'); echo date_i18n($date_format, $payment_date); ?> </td> <td> <?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?> </td>