Function Reference: geodir_payment_invoice_detail_page_content

Summary

This function has not been documented yet.

Actions

‘geodir_payment_invoice_before_order_details’ [Line: 1842]

‘geodir_payment_invoice_after_order_details’ [Line: 1850]

‘geodir_payment_invoice_before_cart_details’ [Line: 1852]

‘geodir_checkout_item_extra_terms’ [Line: 1874]

‘geodir_payment_invoice_after_cart_details’ [Line: 1905]

‘geodir_payment_invoice_before_custom_details’ [Line: 1906]

‘geodir_payment_invoice_before_listing_details’ [Line: 1914]

‘geodir_payment_invoice_after_listing_details’ [Line: 1939]

‘geodir_payment_invoice_after_custom_details’ [Line: 1945]

Source Code

function geodir_payment_invoice_detail_page_content( $invoice_id = NULL ) {
$user_id = get_current_user_id();

if ( !$user_id ) {
$login_url = geodir_login_url( array( ‘redirect_to’ => urlencode( geodir_curPageURL() ) ) );
if ( !headers_sent() ) {
wp_redirect( $login_url );
exit;
} else {
echo ‘‘;
}
return false;
}

$invoice_info = geodir_get_invoice( $invoice_id );
$is_owner = geodir_payment_check_invoice_owner( $invoice_info, $user_id );

if ( !$is_owner || empty( $invoice_info ) ) {
if ( !headers_sent() ) {
wp_redirect( geodir_payment_invoices_page_link() );
exit();
} else {
echo ‘‘;
}
return false;
}

$invoice_info = geodir_get_invoice( $invoice_id );
$is_owner = geodir_payment_check_invoice_owner( $invoice_info, $user_id );

if ( !$is_owner || empty( $invoice_info ) ) {
if(!headers_sent()) {
wp_redirect( geodir_payment_invoices_page_link() );
exit;
}
return;
}

geodir_payment_add_invoice_scripts();

$item_name = $invoice_info->post_title;
$coupon_code = trim( $invoice_info->coupon_code );

$payment_method = $invoice_info->paymentmethod;

$invoice_type = $invoice_info->invoice_type;
$post_id = $invoice_info->post_id;
$amount = $invoice_info->amount;
$tax_amount = $invoice_info->tax_amount;
$discount = $invoice_info->discount;
$paied_amount = $invoice_info->paied_amount;
$date = $invoice_info->date;
$date_updated = $invoice_info->date_updated;

$amount_display = geodir_payment_price($amount);
$tax_amount_display = geodir_payment_price($tax_amount);
$discount_display = geodir_payment_price($discount);
$paied_amount_display = geodir_payment_price($paied_amount);

$coupon_allowed = get_option( ‘geodir_allow_coupon_code’ );

$pay_for_invoice = geodir_payment_allow_pay_for_invoice( $invoice_info );

$invoice_details = geodir_payment_invoice_view_details( $invoice_info );
$invoice_nonce = wp_create_nonce( ‘gd_invoice_nonce_’ . $invoice_id );

$date = $date_updated != ‘0000-00-00 00:00:00’ ? $date_updated : $date;
$date = $date != ‘0000-00-00 00:00:00’ ? $date : ”;
$date_display = $date != ” ? date_i18n( geodir_default_date_format(), strtotime( $date ) ) : ”;

$dat_format = geodir_default_date_format() . ‘ ‘ . get_option( ‘time_format’ );
$date_updated_display = $date != ” ? date_i18n( $dat_format, strtotime( $date ) ) : ”;

$payment_method_display = geodir_payment_method_title( $payment_method );

$inv_status = $invoice_info->status;
if ( in_array( geodir_strtolower( $inv_status ), array( ‘paid’, ‘active’, ‘subscription-payment’, ‘free’ ) ) ) {
$inv_status = ‘confirmed’;
} else if ( in_array( geodir_strtolower( $inv_status ), array( ‘unpaid’ ) ) ) {
$inv_status = ‘pending’;
}

$status_display = geodir_payment_status_name( $inv_status );
$invoice_type_name = geodir_payment_invoice_type_name( $invoice_type );

$incomplete = $inv_status == ‘pending’ && empty($invoice_info->paymentmethod) ? true : false;
if ($incomplete && $inv_status == ‘pending’) {
$status_display = __(‘Incomplete’, ‘geodir_payments’);
}

$recurring_pkg = geodir_payment_invoice_is_recurring_pkg( $invoice_info );

$listing_display = ”;
$package_display = ”;
if ( ( $invoice_type == ‘add_listing’ || $invoice_type == ” || $invoice_type == ‘upgrade_listing’ || $invoice_type == ‘renew_listing’ || $invoice_type == ‘claim_listing’ ) && $post_id > 0 ) {
$post_status = get_post_status( $post_id );
$listing_display = get_the_title( $post_id );

if ( $post_status == ‘publish’ || $post_status == ‘private’ ) {
$listing_display = ‘‘ . $listing_display . ‘‘;
}

$package_id = $invoice_info->package_id;
$package_display = $invoice_info->package_title;
}

$recurring_coupon_info = ”;
$recurring_desc = ”;
$free_trial_desc = ”;
if ($recurring_pkg) {
if ( $coupon_allowed && $coupon_code && geodir_payment_coupon_is_recurring($coupon_code) ) {
$recurring_coupon_info = ‘ ‘ . __(‘for the first installment only’ , ‘geodir_payments’);
}

$package_info = (array)geodir_get_post_package_info( $invoice_info->package_id, $invoice_info->post_id );

if (!empty($package_info)) {
$desc_suffix = (int)$package_info[‘sub_num_trial_days’] > 0 ? __( ‘Then charged’ , ‘geodir_payments’ ) : __( ‘Charged’ , ‘geodir_payments’ );
$recurring_desc = geodir_payment_recurring_pay_desc( $package_info[‘sub_units’], $package_info[‘sub_units_num’], $package_info[‘sub_units_num_times’], $desc_suffix );

if ( (int)$package_info[‘sub_num_trial_days’] > 0 ) {
$free_trial_desc = geodir_payment_checkout_free_trial_desc( $package_info[‘sub_num_trial_days’], $package_info[‘sub_num_trial_units’] );
}
}
}

$transaction_details = trim($invoice_info->HTML) != ” ? trim($invoice_info->HTML) : NULL;

if ( !$invoice_info->paied_amount > 0 ) {
$payment_method_display = __( ‘Instant Publish’, ‘geodir_payments’ );
}
ob_start();
?>

  • #
  • 0 || $discount > 0 ) { ?>


    0 ) { ?>


    0 ) { ?>