absint( $refund->parent ), 'page' => 'edd-payment-history', 'view' => 'view-order-details', ) ); ?>
$refund->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 ), '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 ), ); } $adjustments = edd_get_order_adjustments( array( 'object_id' => $refund->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 ), ); } $has_tax = 'none'; $tax_rate = $refund->id ? $refund->get_tax_rate() : false; $location = array( 'rate' => $tax_rate, 'country' => '', 'region' => '', ); if ( $tax_rate ) { $has_tax = $location; $has_tax['rate'] = $tax_rate; if ( $refund->tax_rate_id ) { $tax_rate_object = $refund->get_tax_rate_object(); if ( $tax_rate_object ) { $has_tax['country'] = $tax_rate_object->name; $has_tax['region'] = $tax_rate_object->description; } } } wp_localize_script( 'edd-admin-orders', 'eddAdminOrderOverview', array( 'items' => $_items, 'adjustments' => $_adjustments, 'refunds' => array(), 'isAdding' => false, 'isRefund' => true, 'hasQuantity' => true, 'hasTax' => $has_tax, 'order' => array( 'currency' => $refund->currency, 'currencySymbol' => html_entity_decode( edd_currency_symbol( $refund->currency ) ), 'subtotal' => $refund->subtotal, 'discount' => $refund->discount, 'tax' => $refund->tax, 'total' => $refund->total, ), ) ); $templates = array( 'no-items', 'subtotal', 'tax', 'total', 'item', 'adjustment', 'adjustment-discount', ); foreach ( $templates as $tmpl ) { echo ''; } ?>