2013-08-16 15:43:26 +00:00
|
|
|
<?php
|
2015-01-14 11:46:03 +00:00
|
|
|
/**
|
|
|
|
* Shows a shipping line
|
|
|
|
*
|
2020-08-05 16:36:24 +00:00
|
|
|
* @package WooCommerce\Admin
|
2020-06-30 19:06:53 +00:00
|
|
|
*
|
2015-01-14 11:46:03 +00:00
|
|
|
* @var object $item The item being displayed
|
|
|
|
* @var int $item_id The id of the item being displayed
|
2020-07-06 20:19:54 +00:00
|
|
|
*
|
2020-08-05 16:36:24 +00:00
|
|
|
* @package WooCommerce\Admin\Views
|
2015-01-14 11:46:03 +00:00
|
|
|
*/
|
2020-06-30 19:06:53 +00:00
|
|
|
|
2014-07-14 19:22:01 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2016-08-19 14:08:00 +00:00
|
|
|
exit;
|
2014-07-14 19:22:01 +00:00
|
|
|
}
|
2013-08-16 15:43:26 +00:00
|
|
|
?>
|
2017-11-21 17:50:30 +00:00
|
|
|
<tr class="shipping <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
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">
|
2016-08-19 14:08:00 +00:00
|
|
|
<?php echo esc_html( $item->get_name() ? $item->get_name() : __( 'Shipping', 'woocommerce' ) ); ?>
|
2014-07-14 19:22:01 +00:00
|
|
|
</div>
|
2014-07-20 03:21:33 +00:00
|
|
|
<div class="edit" style="display: none;">
|
2016-01-08 11:42:32 +00:00
|
|
|
<input type="hidden" name="shipping_method_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
2016-10-12 10:16:30 +00:00
|
|
|
<input type="text" class="shipping_method_name" placeholder="<?php esc_attr_e( 'Shipping name', 'woocommerce' ); ?>" name="shipping_method_title[<?php echo esc_attr( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_name() ); ?>" />
|
2016-02-10 13:21:16 +00:00
|
|
|
<select class="shipping_method" name="shipping_method[<?php echo esc_attr( $item_id ); ?>]">
|
2016-10-12 10:16:30 +00:00
|
|
|
<optgroup label="<?php esc_attr_e( 'Shipping method', 'woocommerce' ); ?>">
|
2017-11-21 17:50:30 +00:00
|
|
|
<option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option>
|
2014-07-14 19:22:01 +00:00
|
|
|
<?php
|
2018-03-05 18:59:17 +00:00
|
|
|
$found_method = false;
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2018-03-05 18:59:17 +00:00
|
|
|
foreach ( $shipping_methods as $method ) {
|
|
|
|
$current_method = ( 0 === strpos( $item->get_method_id(), $method->id ) ) ? $item->get_method_id() : $method->id;
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2018-03-05 18:59:17 +00:00
|
|
|
echo '<option value="' . esc_attr( $current_method ) . '" ' . selected( $item->get_method_id() === $current_method, true, false ) . '>' . esc_html( $method->get_method_title() ) . '</option>';
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2018-03-05 18:59:17 +00:00
|
|
|
if ( $item->get_method_id() === $current_method ) {
|
|
|
|
$found_method = true;
|
2014-07-14 19:22:01 +00:00
|
|
|
}
|
2018-03-05 18:59:17 +00:00
|
|
|
}
|
2014-07-14 19:22:01 +00:00
|
|
|
|
2018-03-05 18:59:17 +00:00
|
|
|
if ( ! $found_method && $item->get_method_id() ) {
|
|
|
|
echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>';
|
|
|
|
} else {
|
|
|
|
echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>';
|
|
|
|
}
|
2014-07-14 19:22:01 +00:00
|
|
|
?>
|
|
|
|
</optgroup>
|
|
|
|
</select>
|
|
|
|
</div>
|
2016-01-08 11:42:32 +00:00
|
|
|
|
2017-11-21 17:50:30 +00:00
|
|
|
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ); ?>
|
2020-08-26 21:46:44 +00:00
|
|
|
<?php require __DIR__ . '/html-order-item-meta.php'; ?>
|
2017-11-21 17:50:30 +00:00
|
|
|
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ); ?>
|
2014-07-14 19:22:01 +00:00
|
|
|
</td>
|
|
|
|
|
2014-07-24 09:21:47 +00:00
|
|
|
<?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?>
|
|
|
|
|
2014-11-11 13:40:44 +00:00
|
|
|
<td class="item_cost" width="1%"> </td>
|
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
|
2020-06-30 19:06:53 +00:00
|
|
|
echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) );
|
2018-03-05 18:59:17 +00:00
|
|
|
$refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' );
|
|
|
|
if ( $refunded ) {
|
2020-06-30 19:06:53 +00:00
|
|
|
echo wp_kses_post( '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' );
|
2018-03-05 18:59:17 +00:00
|
|
|
}
|
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;">
|
2017-11-21 17:50:30 +00:00
|
|
|
<input type="text" name="shipping_cost[<?php echo esc_attr( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" 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;">
|
2017-11-21 17:50:30 +00:00
|
|
|
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" />
|
2014-07-24 09:21:47 +00:00
|
|
|
</div>
|
2014-07-14 19:22:01 +00:00
|
|
|
</td>
|
|
|
|
|
2014-07-20 03:32:52 +00:00
|
|
|
<?php
|
2020-06-30 19:06:53 +00:00
|
|
|
$tax_data = $item->get_taxes();
|
|
|
|
if ( $tax_data && wc_tax_enabled() ) {
|
2018-03-05 18:59:17 +00:00
|
|
|
foreach ( $order_taxes as $tax_item ) {
|
|
|
|
$tax_item_id = $tax_item->get_rate_id();
|
|
|
|
$tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : '';
|
|
|
|
?>
|
|
|
|
<td class="line_tax" width="1%">
|
|
|
|
<div class="view">
|
|
|
|
<?php
|
2020-06-23 14:25:19 +00:00
|
|
|
echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '–' );
|
2018-03-05 18:59:17 +00:00
|
|
|
$refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' );
|
|
|
|
if ( $refunded ) {
|
2020-06-30 19:06:53 +00:00
|
|
|
echo wp_kses_post( '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' );
|
2018-03-05 18:59:17 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="edit" style="display: none;">
|
|
|
|
<input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( 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>
|
|
|
|
<div class="refund" style="display: none;">
|
|
|
|
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<?php
|
2016-08-19 14:08:00 +00:00
|
|
|
}
|
2018-03-05 18:59:17 +00:00
|
|
|
}
|
2014-07-20 03:32:52 +00:00
|
|
|
?>
|
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>
|