woocommerce/includes/admin/meta-boxes/views/html-order-shipping.php

92 lines
3.9 KiB
PHP
Raw Normal View History

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<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>
<td class="name">
<div class="view">
<?php echo ! empty( $item['name'] ) ? esc_html( $item['name'] ) : __( 'Shipping', 'woocommerce' ); ?>
</div>
<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; ?>]">
<optgroup label="<?php _e( 'Shipping Method', 'woocommerce' ); ?>">
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
<?php
$found_method = false;
foreach ( $shipping_methods as $method ) {
$method_id = isset( $item['method_id'] ) ? $item['method_id'] : '';
$current_method = ( 0 === strpos( $method_id, $method->id ) ) ? $method_id : $method->id;
echo '<option value="' . esc_attr( $current_method ) . '" ' . selected( $method_id == $current_method, true, false ) . '>' . esc_html( $method->get_title() ) . '</option>';
if ( $method_id == $current_method ) {
$found_method = true;
}
}
if ( ! $found_method && ! empty( $method_id ) ) {
echo '<option value="' . esc_attr( $method_id ) . '" selected="selected">' . __( 'Other', 'woocommerce' ) . '</option>';
} else {
echo '<option value="other">' . __( 'Other', 'woocommerce' ) . '</option>';
}
?>
</optgroup>
</select>
2014-07-20 04:28:16 +00:00
<input type="hidden" name="shipping_method_id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item_id ); ?>" />
</div>
</td>
<td class="quantity" width="1%">1</td>
<td class="line_cost" width="1%">
<div class="view">
<?php echo ( isset( $item['cost'] ) ) ? wc_price( wc_round_tax_total( $item['cost'] ) ) : ''; ?>
</div>
<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" />
</div>
</td>
<?php
if ( 'yes' == get_option( 'woocommerce_calc_taxes' ) ) :
$shipping_taxes = isset( $item['taxes'] ) ? $item['taxes'] : '';
$tax_data = maybe_unserialize( $shipping_taxes );
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 ] : '';
?>
<td class="line_tax" width="1%">
<div class="view">
2014-07-22 13:42:04 +00:00
<?php echo ( '' != $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ) ) : '&ndash;'; ?>
</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" />
</div>
</td>
<?php
endforeach;
endif;
?>
2014-07-21 02:26:40 +00:00
<td class="wc-order-item-refund-quantity" width="1%" style="display: none;">
<input type="number" step="1" min="0" max="1" autocomplete="off" name="order_item_refund_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" size="4" class="refund-quantity" />
</td>
2014-07-16 20:12:33 +00:00
<td class="wc-order-edit-line-item">
<div class="wc-order-edit-line-item-actions">
<a class="edit-order-item" href="#"></a><a class="delete-order-item" href="#"></a>
</div>
</td>
</tr>