ID ); if ( ! ( $request instanceof SOFTOBA_Exchange_Request && $request->exists() ) ) { return; } $finished_request = apply_filters( 'softoba_finished_request', ( 'softoba-approved' == $request->status || 'softoba-rejected' == $request->status || 'trash' == $request->status ), $request ); $order = wc_get_order( $request->order_id ); $order_id = $order->get_id(); $order_number = $order->get_order_number(); $order_total = $order->get_total() - $order->get_total_refunded(); $product = $request->product_id ? wc_get_product( $request->product_id ) : ''; $tax_enabled = wc_tax_enabled(); $exchange_details = get_post_meta( $order_id, 'sobaoba_exchange_products', true ); ?>
'; $order_link .= $order_id == $order_number ? '#' . $order_id . '' : $order_number . ''; $status_title = softoba_get_request_status_by_key( $request->status ); // $src = SOFTOBA_ASSETS_URL . 'images/' . $request->status . '.png'; ?> status ) : ?>

ID, $order_link ); ?>

version, '3.0.0', '<' ) ? $request->get_customer_link_legacy() : $request->get_customer_link(); $get_variation = new WC_Product_Variation( $request->variation_id ); $get_variation_attributes = $get_variation->get_variation_attributes(); $get_ordered_variation = wc_get_formatted_variation( $get_variation_attributes, true ); if ( $request->whole_order ) { $info = sprintf( esc_html__( '%s made a request for the whole order', 'astra' ), $customer ); } else { $span_product = $product ? '' . $product->get_title() . '': ''; $span_qty = '' . $request->qty . ''; $info = sprintf( esc_html__( '%s made a request for exchange', 'astra' ), $customer ); } ?>
get_items( array( 'line_item', 'shipping', 'fee' ) ); foreach ( $items as $item_id => $item ) { foreach( $exchange_details['products'] as $key => $ex_product ){ if( $ex_product['item_id'] == $item_id ) { $item_type = version_compare( WC()->version, '3.0.0', '<' ) ? $item['type'] : $item->get_type(); if ( 'line_item' == $item_type ) : $product = empty( $item['variation_id'] ) ? wc_get_product( $item['product_id'] ) : wc_get_product( $item['variation_id'] ); if ( ! $product || ! $product->exists() ) { ?> item_id ) { $qty_requested = $request->qty; $return_class = 'return_product_item_add'; } if( $item['qty'] !== 0 ){ $item_value = $item['line_total'] / $item['qty']; } $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnail', $product->get_image( 'thumbnail', array( 'title' => '' ), false ), $item_id, $item ) : ''; $product_link = $product ? admin_url( 'post.php?post=' . $item->get_product_id() . '&action=edit' ) : ''; ?> version, '3.0.0', '<' ) ? $item['name'] : $item->get_name(); ?> version, '3.0.0', '<' ) ? (float) $item['cost'] : (float) $item->get_total(); ?> version, '3.0.0', '<' ) ) { foreach ( maybe_unserialize( $item['taxes'] ) as $tax ) { $shipping_tax += (float) $tax; } } else { $shipping_tax = (float) $item->get_total_tax(); } } ?> version, '3.0.0', '<' ) ? (float) $item['line_total'] : (float) $item->get_total(); ?> version, '3.0.0', '<' ) ? (float) $item['line_tax'] : (float) $item->get_total_tax(); ?>
' . wp_kses_post( $thumbnail ) . ''; ?> ' . wp_kses_post( $item->get_name() ) . '' : '
' . wp_kses_post( $item->get_name() ) . '
'; ?>
get_variation_attributes(); echo wc_get_formatted_variation( $get_variation_attributes, true ); ?> $order->get_currency() ) ); $get_variation = new WC_Product_Variation( $ex_product['ex_variation_id'] ); $get_variation_attributes = $get_variation->get_variation_attributes(); echo wc_get_formatted_variation( $get_variation_attributes, true ); }else{ echo '-'; } ?> $order->get_currency() ) ); ?> $order->get_currency() ) ); ?>
$order->get_currency() ) ); ?> get_items( 'tax' ); foreach ( $taxes as $tax_item ) { ?> $value ) { ?> $order->get_currency() ) ); ?>
get_total_tax(); $order_total = $order->get_total() - $order->get_total_refunded(); ?>
Order Total: $order->get_currency() ) ); } else { echo $order->get_formatted_order_total(); } ?>

get_total(), array( 'currency' => $order->get_currency() ) ); ?>
get_payment_method_title() ) { /* translators: 1: payment date. 2: payment method */ echo esc_html( sprintf( __( '%1$s via %2$s', 'astra' ), $order->get_date_paid()->date_i18n( get_option( 'date_format' ) ), $order->get_payment_method_title() ) ); } else { echo esc_html( $order->get_date_paid()->date_i18n( get_option( 'date_format' ) ) ); } // $refund_amount = wc_price( 1, array( 'currency' => $order->get_currency() ) ); ?>
get_total_refunded() ) : ?> get_id() ); ?>
: -get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
: get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

status !== 'softoba-approved' ) : ?> exchange_fee === 'processing' || $request->exchange_fee === 'completed') : if( $request->status !== 'softoba-approved' ) : ?> is_closed ) : ?>

is_closed ) : ?>