Skip to content

Commit

Permalink
Merge pull request #3384 from WordImpress/issue-3380
Browse files Browse the repository at this point in the history
fix(admin-tool): ensure the level title in the exported CSV reads custom on custom donations #3380
  • Loading branch information
ravinderk committed Jun 21, 2018
2 parents 7a17b22 + ebf6732 commit 86195f0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions includes/admin/tools/export/give-export-donations-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ public function get_data() {
}

if ( ! empty( $columns['currency_symbol'] ) ) {
$currency_code = $data[ $i ]['currency_code'];
$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );
$currency_code = $data[ $i ]['currency_code'];
$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );
}

if ( ! empty( $columns['donation_status'] ) ) {
Expand Down Expand Up @@ -392,13 +392,16 @@ public function get_data() {
if ( empty( $var_prices ) ) {
$data[ $i ]['form_level_title'] = '';
} else {
$prices_atts = '';
if ( $variable_prices = give_get_variable_prices( $payment->form_id ) ) {
foreach ( $variable_prices as $variable_price ) {
$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'] );
if ( 'custom' === $payment->price_id ) {
$custom_amount_text = give_get_meta( $payment->form_id, '_give_custom_amount_text', true );

if ( empty( $custom_amount_text ) ) {
$custom_amount_text = esc_html__( 'Custom', 'give' );
}
$data[ $i ]['form_level_title'] = $custom_amount_text;
} else {
$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );
}
$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );
}
}

Expand Down

0 comments on commit 86195f0

Please sign in to comment.