html-order-download-permission.php
6 years ago
html-order-fee.php
3 months ago
html-order-item-meta.php
4 years ago
html-order-item.php
9 months ago
html-order-items.php
1 month ago
html-order-notes.php
1 month ago
html-order-refund.php
3 months ago
html-order-shipping.php
3 months ago
html-product-attribute-inner.php
1 month ago
html-product-attribute.php
3 years ago
html-product-data-advanced.php
5 months ago
html-product-data-attributes.php
1 month ago
html-product-data-general.php
2 months ago
html-product-data-inventory.php
4 months ago
html-product-data-linked-products.php
3 months ago
html-product-data-panel.php
1 year ago
html-product-data-shipping.php
3 years ago
html-product-data-variations.php
1 month ago
html-product-download.php
4 months ago
html-product-variation-download.php
4 months ago
html-variation-admin.php
1 month ago
html-order-shipping.php
120 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Shows a shipping line |
| 4 | * |
| 5 | * @package WooCommerce\Admin |
| 6 | * |
| 7 | * @var object $item The item being displayed |
| 8 | * @var int $item_id The id of the item being displayed |
| 9 | * |
| 10 | * @package WooCommerce\Admin\Views |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | ?> |
| 17 | <tr class="shipping <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
| 18 | <td class="thumb"><div></div></td> |
| 19 | |
| 20 | <td class="name"> |
| 21 | <div class="view"> |
| 22 | <?php echo esc_html( $item->get_name() ? $item->get_name() : __( 'Shipping', 'woocommerce' ) ); ?> |
| 23 | </div> |
| 24 | <div class="edit" style="display: none;"> |
| 25 | <input type="hidden" name="shipping_method_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
| 26 | <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() ); ?>" /> |
| 27 | <select class="shipping_method" name="shipping_method[<?php echo esc_attr( $item_id ); ?>]"> |
| 28 | <optgroup label="<?php esc_attr_e( 'Shipping method', 'woocommerce' ); ?>"> |
| 29 | <option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option> |
| 30 | <?php |
| 31 | $found_method = false; |
| 32 | |
| 33 | foreach ( $shipping_methods as $method ) { |
| 34 | $is_active = $item->get_method_id() === $method->id; |
| 35 | |
| 36 | echo '<option value="' . esc_attr( $method->id ) . '" ' . selected( true, $is_active, false ) . '>' . esc_html( $method->get_method_title() ) . '</option>'; |
| 37 | |
| 38 | if ( $is_active ) { |
| 39 | $found_method = true; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | if ( ! $found_method && $item->get_method_id() ) { |
| 44 | echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
| 45 | } else { |
| 46 | echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
| 47 | } |
| 48 | ?> |
| 49 | </optgroup> |
| 50 | </select> |
| 51 | </div> |
| 52 | |
| 53 | <?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ); ?> |
| 54 | <?php require __DIR__ . '/html-order-item-meta.php'; ?> |
| 55 | <?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ); ?> |
| 56 | </td> |
| 57 | |
| 58 | <?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?> |
| 59 | |
| 60 | <?php if ( $cogs_is_enabled ) : ?> |
| 61 | <td class="item_cost_of_goods"></td> |
| 62 | <?php endif; ?> |
| 63 | <td class="item_cost" width="1%"> </td> |
| 64 | <td class="quantity" width="1%"> </td> |
| 65 | |
| 66 | <td class="line_cost" width="1%"> |
| 67 | <div class="view"> |
| 68 | <?php |
| 69 | echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) ); |
| 70 | $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'shipping' ); |
| 71 | if ( $refunded ) { |
| 72 | echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
| 73 | } |
| 74 | ?> |
| 75 | </div> |
| 76 | <div class="edit" style="display: none;"> |
| 77 | <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" /> |
| 78 | </div> |
| 79 | <div class="refund" style="display: none;"> |
| 80 | <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" /> |
| 81 | </div> |
| 82 | </td> |
| 83 | |
| 84 | <?php |
| 85 | $tax_data = $item->get_taxes(); |
| 86 | if ( $tax_data && wc_tax_enabled() ) { |
| 87 | foreach ( $order_taxes as $tax_item ) { |
| 88 | $tax_item_id = $tax_item->get_rate_id(); |
| 89 | $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
| 90 | ?> |
| 91 | <td class="line_tax" width="1%"> |
| 92 | <div class="view"> |
| 93 | <?php |
| 94 | echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '–' ); |
| 95 | $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ); |
| 96 | if ( $refunded ) { |
| 97 | echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
| 98 | } |
| 99 | ?> |
| 100 | </div> |
| 101 | <div class="edit" style="display: none;"> |
| 102 | <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" /> |
| 103 | </div> |
| 104 | <div class="refund" style="display: none;"> |
| 105 | <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 ); ?>" /> |
| 106 | </div> |
| 107 | </td> |
| 108 | <?php |
| 109 | } |
| 110 | } |
| 111 | ?> |
| 112 | <td class="wc-order-edit-line-item"> |
| 113 | <?php if ( $order->is_editable() ) : ?> |
| 114 | <div class="wc-order-edit-line-item-actions"> |
| 115 | <a class="edit-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Edit shipping', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Edit shipping', 'woocommerce' ); ?>"></a><a class="delete-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Delete shipping', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Delete shipping', 'woocommerce' ); ?>"></a> |
| 116 | </div> |
| 117 | <?php endif; ?> |
| 118 | </td> |
| 119 | </tr> |
| 120 |