2013-08-16 15:43:26 +00:00
|
|
|
<?php
|
2014-09-20 20:05:06 +00:00
|
|
|
|
2014-07-14 19:22:01 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit; // Exit if accessed directly
|
|
|
|
}
|
2014-07-23 22:30:55 +00:00
|
|
|
|
2013-08-16 15:43:26 +00:00
|
|
|
?>
|
2014-07-14 19:22:01 +00:00
|
|
|
<tr class="shipping <?php echo ( ! empty( $class ) ) ? $class : ''; ?>" data-order_item_id="<?php echo $item_id; ?>">
|
|
|
|
<td class="check-column"><input type="checkbox" /></td>
|
|
|
|
|
2014-07-22 13:27:47 +00:00
|
|
|
<td class="thumb"><div></div></td>
|
2014-07-14 19:22:01 +00:00
|
|
|
|
|
|
|
<td class="name">
|
|
|
|
<div class="view">
|
|
|
|
<?php echo ! empty( $item['name'] ) ? esc_html( $item['name'] ) : __( 'Shipping', 'woocommerce' ); ?>
|
|
|
|
</div>
|
2014-07-20 03:21:33 +00:00
|
|
|
<div class="edit" style="display: none;">
|
2014-07-20 04:28:16 +00:00
|
|
|
<input type="text" placeholder="<?php _e( 'Shipping Name', 'woocommerce' ); ?>" name="shipping_method_title[<?php echo $item_id; ?>]" value="<?php echo ( isset( $item['name'] ) ) ? esc_attr( $item['name'] ) : ''; ?>" />
|
|
|
|
<select name="shipping_method[<?php echo $item_id; ?>]">
|
2014-07-14 19:22:01 +00:00
|
|
|
<optgroup label="<?php _e( 'Shipping Method', 'woocommerce' ); ?>">
|
|
|
|
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
|
|
|
<?php
|
|
|
|
$found_method = false;
|
|
|
|
|
|
|
|
foreach ( $shipping_methods as $method ) {
|
2014-07-17 18:48:37 +00:00
|
|
|
$method_id = isset( $item['method_id'] ) ? $item['method_id'] : '';
|
|
|
|
$current_method = ( 0 === strpos( $method_id, $method->id ) ) ? $method_id : $method->id;
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2014-07-17 18:48:37 +00:00
|
|
|
echo '<option value="' . esc_attr( $current_method ) . '" ' . selected( $method_id == $current_method, true, false ) . '>' . esc_html( $method->get_title() ) . '</option>';
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2014-07-17 18:48:37 +00:00
|
|
|
if ( $method_id == $current_method ) {
|
2014-07-14 19:22:01 +00:00
|
|
|
$found_method = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-17 18:48:37 +00:00
|
|
|
if ( ! $found_method && ! empty( $method_id ) ) {
|
|
|
|
echo '<option value="' . esc_attr( $method_id ) . '" selected="selected">' . __( 'Other', 'woocommerce' ) . '</option>';
|
2014-07-14 19:22:01 +00:00
|
|
|
} else {
|
|
|
|
echo '<option value="other">' . __( 'Other', 'woocommerce' ) . '</option>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</optgroup>
|
|
|
|
</select>
|
2014-07-23 22:30:55 +00:00
|
|
|
<input type="hidden" name="shipping_method_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
2014-07-14 19:22:01 +00:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
|
2014-07-24 09:21:47 +00:00
|
|
|
<?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?>
|
|
|
|
|
2014-07-28 10:45:16 +00:00
|
|
|
<td class="quantity" width="1%"> </td>
|
2014-07-14 19:22:01 +00:00
|
|
|
|
|
|
|
<td class="line_cost" width="1%">
|
|
|
|
<div class="view">
|
2014-07-25 16:32:16 +00:00
|
|
|
<?php
|
2014-09-29 03:52:28 +00:00
|
|
|
echo ( isset( $item['cost'] ) ) ? wc_price( wc_round_tax_total( $item['cost'] ), array( 'currency' => $order->get_order_currency() ) ) : '';
|
2014-07-25 15:48:19 +00:00
|
|
|
|
|
|
|
if ( $refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' ) ) {
|
2014-09-29 03:52:28 +00:00
|
|
|
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_order_currency() ) ) . '</small>';
|
2014-07-25 15:48:19 +00:00
|
|
|
}
|
|
|
|
?>
|
2014-07-14 19:22:01 +00:00
|
|
|
</div>
|
2014-07-20 03:21:33 +00:00
|
|
|
<div class="edit" style="display: none;">
|
2014-07-22 15:44:02 +00:00
|
|
|
<input type="text" name="shipping_cost[<?php echo $item_id; ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo ( isset( $item['cost'] ) ) ? esc_attr( wc_format_localized_price( $item['cost'] ) ) : ''; ?>" class="line_total wc_input_price" />
|
2014-07-14 19:22:01 +00:00
|
|
|
</div>
|
2014-07-24 09:56:32 +00:00
|
|
|
<div class="refund" style="display: none;">
|
2014-07-24 09:21:47 +00:00
|
|
|
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_total wc_input_price" />
|
|
|
|
</div>
|
2014-07-14 19:22:01 +00:00
|
|
|
</td>
|
|
|
|
|
2014-07-20 03:32:52 +00:00
|
|
|
<?php
|
2014-09-19 11:52:26 +00:00
|
|
|
if ( empty( $legacy_order ) && 'yes' == get_option( 'woocommerce_calc_taxes' ) ) :
|
2014-07-20 03:32:52 +00:00
|
|
|
$shipping_taxes = isset( $item['taxes'] ) ? $item['taxes'] : '';
|
|
|
|
$tax_data = maybe_unserialize( $shipping_taxes );
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2014-07-20 03:32:52 +00:00
|
|
|
foreach ( $order_taxes as $tax_item ) :
|
|
|
|
$tax_item_id = $tax_item['rate_id'];
|
|
|
|
$tax_item_total = isset( $tax_data[ $tax_item_id ] ) ? $tax_data[ $tax_item_id ] : '';
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2014-07-20 03:32:52 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<td class="line_tax" width="1%">
|
|
|
|
<div class="view">
|
2014-07-25 16:32:16 +00:00
|
|
|
<?php
|
2014-09-29 03:52:28 +00:00
|
|
|
echo ( '' != $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_order_currency() ) ) : '–';
|
2014-07-25 15:48:19 +00:00
|
|
|
|
|
|
|
if ( $refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ) ) {
|
2014-09-29 03:52:28 +00:00
|
|
|
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_order_currency() ) ) . '</small>';
|
2014-07-25 15:48:19 +00:00
|
|
|
}
|
|
|
|
?>
|
2014-07-20 03:32:52 +00:00
|
|
|
</div>
|
|
|
|
<div class="edit" style="display: none;">
|
2014-07-21 00:12:22 +00:00
|
|
|
<input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo absint( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" />
|
2014-07-20 03:32:52 +00:00
|
|
|
</div>
|
2014-07-24 09:56:32 +00:00
|
|
|
<div class="refund" style="display: none;">
|
2014-07-24 14:34:14 +00:00
|
|
|
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo absint( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo absint( $tax_item_id ); ?>" />
|
2014-07-24 09:21:47 +00:00
|
|
|
</div>
|
2014-07-20 03:32:52 +00:00
|
|
|
</td>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
endif;
|
|
|
|
?>
|
2014-07-14 19:22:01 +00:00
|
|
|
|
|
|
|
<td class="wc-order-edit-line-item">
|
2014-09-03 09:09:04 +00:00
|
|
|
<?php if ( $order->is_editable() ) : ?>
|
2014-07-22 19:25:37 +00:00
|
|
|
<div class="wc-order-edit-line-item-actions">
|
|
|
|
<a class="edit-order-item" href="#"></a><a class="delete-order-item" href="#"></a>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2014-07-14 19:22:01 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|