autofocus />
use_js = true; $sections->current_section = 'customer'; $sections->item = $item; $sections->base_url = ''; // Get all registered tabs & views $o_sections = edd_get_order_details_sections( $item ); // Set the customer sections $sections->set_sections( $o_sections ); // Display the sections $sections->display(); } /** * Return the order details sections. * * @since 3.0 * * @param object $order * @return array Sections. */ function edd_get_order_details_sections( $order ) { $sections = array( array( 'id' => 'customer', 'label' => __( 'Customer', 'easy-digital-downloads' ), 'icon' => 'businessman', 'callback' => 'edd_order_details_customer', ), array( 'id' => 'email', 'label' => __( 'Email', 'easy-digital-downloads' ), 'icon' => 'email', 'callback' => 'edd_order_details_email', ), array( 'id' => 'address', 'label' => __( 'Address', 'easy-digital-downloads' ), 'icon' => 'admin-home', 'callback' => 'edd_order_details_addresses', ), array( 'id' => 'notes', 'label' => __( 'Notes', 'easy-digital-downloads' ), 'icon' => 'admin-comments', 'callback' => 'edd_order_details_notes', ), array( 'id' => 'logs', 'label' => __( 'Logs', 'easy-digital-downloads' ), 'icon' => 'admin-tools', 'callback' => 'edd_order_details_logs', ), ); // Override sections if adding a new order. if ( edd_is_add_order_page() ) { $sections = array( array( 'id' => 'customer', 'label' => __( 'Customer', 'easy-digital-downloads' ), 'icon' => 'businessman', 'callback' => 'edd_order_details_customer', ), array( 'id' => 'address', 'label' => __( 'Address', 'easy-digital-downloads' ), 'icon' => 'admin-home', 'callback' => 'edd_order_details_addresses', ), ); } /** * Filter the sections. * * @since 3.0 * * @param array $sections Sections. * @param object $order Order object. */ return (array) apply_filters( 'edd_get_order_details_sections', $sections, $order ); } /** * Output the order details customer section * * @since 3.0 * * @param object $order */ function edd_order_details_customer( $order ) { $customer = edd_get_customer( $order->customer_id ); $payment = edd_get_payment( $order->id ); $user_info = $payment ? $payment->user_info : array(); $change_text = edd_is_add_order_page() ? esc_html__( 'Assign', 'easy-digital-downloads' ) : esc_html__( 'Switch Customer', 'easy-digital-downloads' ); $customer_id = ! empty( $customer ) ? $customer->id : 0; ?>
html->customer_dropdown( array( 'class' => 'edd-payment-change-customer-input edd-form-group__input', 'selected' => $customer_id, 'id' => 'customer-id', 'name' => 'customer-id', 'none_selected' => esc_html__( 'Search for a customer', 'easy-digital-downloads' ), 'placeholder' => esc_html__( 'Search for a customer', 'easy-digital-downloads' ), ) ); // WPCS: XSS ok. ?>

or

get_meta(), $user_info ); } do_action( 'edd_payment_view_details', $order->id ); } /** * Output the order details email section * * @since 3.0 * * @param object $order */ function edd_order_details_email( $order ) { $customer = edd_get_customer( $order->customer_id ); $all_emails = array( 'primary' => $customer->email ); foreach ( $customer->emails as $key => $email ) { if ( $customer->email === $email ) { continue; } $all_emails[ $key ] = $email; } $help = __( 'Send a new copy of the purchase receipt to the email address used for this order. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' ); ?>
emails ) && count( (array) $customer->emails ) > 1 ) : ?>
$email ) : ?>
/>

id ); ?>
0, 'order_id' => 0, 'first_name' => '', 'last_name' => '', 'address' => '', 'address2' => '', 'city' => '', 'region' => '', 'postal_code' => '', 'country' => '', ) : $order->get_address(); ?>
id ); ?>

html->country_select( array( 'name' => 'edd_order_address[country]', 'id' => 'edd-order-address-country', 'class' => 'edd-order-address-country edd-form-group__input', 'show_option_all' => false, 'data' => array( 'nonce' => wp_create_nonce( 'edd-country-field-nonce' ), 'search-type' => 'no_ajax', 'search-placeholder' => esc_html__( 'Search Countries', 'easy-digital-downloads' ), ), ), $address->country ); // WPCS: XSS ok. ?>
country ); if ( ! empty( $states ) ) { echo EDD()->html->region_select( array( 'name' => 'edd_order_address[region]', 'id' => 'edd_order_address_region', 'class' => 'edd-order-address-region edd-form-group__input', 'data' => array( 'search-type' => 'no_ajax', 'search-placeholder' => esc_html__( 'Search Regions', 'easy-digital-downloads' ), ), ), $address->country, $address->region ); // WPCS: XSS ok. } else { ?>
id ); } /** * Output the order details notes section * * @since 3.0 * * @param object $order */ function edd_order_details_notes( $order ) { $notes = edd_get_payment_notes( $order->id ); ?>
id, 'order' ); // WPCS: XSS ok. ?>
id ); $download_log_url = edd_get_admin_url( array( 'page' => 'edd-tools', 'tab' => 'logs', 'payment' => absint( $order->id ), ) ); $customer_log_url = edd_get_admin_url( array( 'page' => 'edd-tools', 'tab' => 'logs', 'customer' => absint( $order->customer_id ), ) ); $customer_orders_url = edd_get_admin_url( array( 'page' => 'edd-payment-history', 'customer' => absint( $order->customer_id ), ) ); ?>

id ); ?>
$order->id, 'number' => 999, ) ); foreach ( $items as $item ) { $item_adjustments = array(); $adjustments = edd_get_order_adjustments( array( 'object_id' => $item->id, 'number' => 999, 'object_type' => 'order_item', 'type' => array( 'discount', 'credit', 'fee', ), ) ); foreach ( $adjustments as $adjustment ) { // @todo edd_get_order_adjustment_to_json()? $adjustment_args = array( 'id' => esc_html( $adjustment->id ), 'objectId' => esc_html( $adjustment->object_id ), 'objectType' => esc_html( $adjustment->object_type ), 'typeId' => esc_html( $adjustment->type_id ), 'type' => esc_html( $adjustment->type ), 'description' => esc_html( $adjustment->description ), 'subtotal' => esc_html( $adjustment->subtotal ), 'tax' => esc_html( $adjustment->tax ), 'total' => esc_html( $adjustment->total ), 'dateCreated' => esc_html( $adjustment->date_created ), 'dateModified' => esc_html( $adjustment->date_modified ), 'uuid' => esc_html( $adjustment->uuid ), ); $item_adjustments[] = $adjustment_args; $_adjustments[] = $adjustment_args; } // @todo edd_get_order_item_to_json()? $_items[] = array( 'id' => esc_html( $item->id ), 'orderId' => esc_html( $item->order_id ), 'productId' => esc_html( $item->product_id ), 'productName' => esc_html( $item->get_order_item_name() ), 'priceId' => esc_html( $item->price_id ), 'cartIndex' => esc_html( $item->cart_index ), 'type' => esc_html( $item->type ), 'status' => esc_html( $item->status ), 'statusLabel' => esc_html( edd_get_status_label( $item->status ) ), 'quantity' => esc_html( $item->quantity ), 'amount' => esc_html( $item->amount ), 'subtotal' => esc_html( $item->subtotal ), 'discount' => esc_html( $item->discount ), 'tax' => esc_html( $item->tax ), 'total' => esc_html( $item->total ), 'dateCreated' => esc_html( $item->date_created ), 'dateModified' => esc_html( $item->date_modified ), 'uuid' => esc_html( $item->uuid ), 'deliverable' => $item->is_deliverable(), 'adjustments' => $item_adjustments, ); } $adjustments = edd_get_order_adjustments( array( 'object_id' => $order->id, 'number' => 999, 'object_type' => 'order', 'type' => array( 'discount', 'credit', 'fee', ), ) ); foreach ( $adjustments as $adjustment ) { // @todo edd_get_order_adjustment_to_json()? $_adjustments[] = array( 'id' => esc_html( $adjustment->id ), 'objectId' => esc_html( $adjustment->object_id ), 'objectType' => esc_html( $adjustment->object_type ), 'typeId' => esc_html( $adjustment->type_id ), 'type' => esc_html( $adjustment->type ), 'description' => esc_html( $adjustment->description ), 'subtotal' => esc_html( $adjustment->subtotal ), 'tax' => esc_html( $adjustment->tax ), 'total' => esc_html( $adjustment->total ), 'dateCreated' => esc_html( $adjustment->date_created ), 'dateModified' => esc_html( $adjustment->date_modified ), 'uuid' => esc_html( $adjustment->uuid ), ); } $refunds = edd_get_order_refunds( $order->id ); foreach ( $refunds as $refund ) { $_refunds[] = array( 'id' => esc_html( $refund->id ), 'number' => esc_html( $refund->order_number ), 'total' => esc_html( $refund->total ), 'dateCreated' => esc_html( $refund->date_created ), 'dateCreatedi18n' => esc_html( edd_date_i18n( $refund->date_created ) ), 'uuid' => esc_html( $refund->uuid ), ); } } $has_tax = 'none'; $tax_rate = $order->id ? $order->get_tax_rate() : false; $location = array( 'rate' => $tax_rate, 'country' => '', 'region' => '', 'inclusive' => edd_prices_include_tax(), ); if ( edd_is_add_order_page() && edd_use_taxes() ) { $default_rate = edd_get_tax_rate_by_location( array( 'country' => '', 'region' => '', ) ); if ( $default_rate ) { $location['rate'] = floatval( $default_rate->amount ); } $has_tax = $location; } elseif ( $tax_rate ) { $has_tax = $location; $has_tax['rate'] = $tax_rate; if ( $order->tax_rate_id ) { $tax_rate_object = $order->get_tax_rate_object(); if ( $tax_rate_object ) { $has_tax['country'] = $tax_rate_object->name; $has_tax['region'] = $tax_rate_object->description; } } } $has_quantity = true; if ( edd_is_add_order_page() && ! edd_item_quantities_enabled() ) { $has_quantity = false; } wp_localize_script( 'edd-admin-orders', 'eddAdminOrderOverview', array( 'items' => $_items, 'adjustments' => $_adjustments, 'refunds' => $_refunds, 'isAdding' => true === edd_is_add_order_page(), 'hasQuantity' => $has_quantity, 'hasTax' => $has_tax, 'hasDiscounts' => true === edd_has_active_discounts(), 'order' => array( 'status' => $order->status, 'currency' => $order->currency, 'currencySymbol' => html_entity_decode( edd_currency_symbol( $order->currency ) ), 'subtotal' => $order->subtotal, 'discount' => $order->discount, 'tax' => $order->tax, 'total' => $order->total, ), 'nonces' => array( 'edd_admin_order_get_item_amounts' => wp_create_nonce( 'edd_admin_order_get_item_amounts' ), ), 'i18n' => array( 'closeText' => esc_html__( 'Close', 'easy-digital-downloads' ), ), ) ); $templates = array( 'actions', 'subtotal', 'tax', 'total', 'item', 'adjustment', 'adjustment-discount', 'refund', 'no-items', 'copy-download-link', 'form-add-order-item', 'form-add-order-discount', 'form-add-order-adjustment', ); foreach ( $templates as $tmpl ) { echo ''; } ?>
id ); } /** * Output the order details sections box * * @since 3.0 * * @param object $order */ function edd_order_details_sections( $order ) { ?>

id ) ? $order->get_transaction_id() : ''; $unlimited = ! empty( $order->id ) ? $order->has_unlimited_downloads() : false; $readonly = ! empty( $order->id ) ? 'readonly' : ''; // Setup gateway list. if ( empty( $order->id ) ) { $known_gateways = edd_get_payment_gateways(); $gateways = array(); foreach ( $known_gateways as $id => $data ) { $gateways[ $id ] = esc_html( $data['admin_label'] ); } } // Filter the transaction ID (here specifically for back-compat) if ( ! empty( $transaction_id ) ) { $transaction_id = apply_filters( 'edd_payment_details_transaction_id-' . $order->gateway, $transaction_id, $order->id ); } ?>

id ); ?>
gateway ); ?>
html->select( array( 'name' => 'gateway', 'class' => 'edd-form-group__input', 'id' => 'edd_gateway_select', 'options' => $gateways, 'selected' => 'manual', 'show_option_none' => false, 'show_option_all' => false, ) ); // WPCS: XSS ok. ?>
value="payment_key ); ?>" />
id ); // WPCS: XSS ok. ?>
/>
id ); ?>
id )->get_recovery_url(); $order_date = edd_get_edd_timezone_equivalent_date_from_utc( EDD()->utils->date( $order->date_created, 'utc', true ) ); ?>

'edd-payment-history', 'order_type' => 'sale', 'edd-action' => 'trash_order', 'purchase_id' => absint( $order->id ), ) ), 'edd_payment_nonce' ); ?>
id ) && ! empty( $recovery_url ) ) : ?>
:
id ); ?>
'; break; case 'failed' : $icon = ''; break; case 'complete' : $icon = ''; break; default: $icon = ''; } /** * Filters the markup for the order status badge icon. * * @since 3.0 * * @param string $icon Icon HTML markup. */ $icon = apply_filters( 'edd_get_order_status_badge_icon', $icon, $order_status ); ob_start(); ?> array( 'class' => true, ), 'svg' => array( 'class' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'aria-hidden' => true, 'role' => true, 'focusable' => true, ), 'path' => array( 'fill' => true, 'fill-rule' => true, 'd' => true, 'transform' => true, ), 'polygon' => array( 'fill' => true, 'fill-rule' => true, 'points' => true, 'transform' => true, 'focusable' => true, ), ) ); ?>