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-fee.php
90 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Shows an order item fee |
| 4 | * |
| 5 | * @var object $item The item being displayed |
| 6 | * @var int $item_id The id of the item being displayed |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | ?> |
| 13 | <tr class="fee <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
| 14 | <td class="thumb"><div></div></td> |
| 15 | |
| 16 | <td class="name"> |
| 17 | <div class="view"> |
| 18 | <?php echo esc_html( $item->get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?> |
| 19 | </div> |
| 20 | <div class="edit" style="display: none;"> |
| 21 | <input type="text" placeholder="<?php esc_attr_e( 'Fee name', 'woocommerce' ); ?>" name="order_item_name[<?php echo absint( $item_id ); ?>]" value="<?php echo ( $item->get_name() ) ? esc_attr( $item->get_name() ) : ''; ?>" /> |
| 22 | <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
| 23 | <input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" /> |
| 24 | </div> |
| 25 | <?php do_action( 'woocommerce_after_order_fee_item_name', $item_id, $item, null ); ?> |
| 26 | </td> |
| 27 | |
| 28 | <?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?> |
| 29 | |
| 30 | <?php if ( $cogs_is_enabled ) : ?> |
| 31 | <td class="item_cost_of_goods"></td> |
| 32 | <?php endif; ?> |
| 33 | |
| 34 | <td class="item_cost" width="1%"> </td> |
| 35 | <td class="quantity" width="1%"> </td> |
| 36 | |
| 37 | <td class="line_cost" width="1%"> |
| 38 | <div class="view"> |
| 39 | <?php |
| 40 | echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); |
| 41 | |
| 42 | if ( $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'fee' ) ) { |
| 43 | echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
| 44 | } |
| 45 | ?> |
| 46 | </div> |
| 47 | <div class="edit" style="display: none;"> |
| 48 | <input type="text" name="line_total[<?php echo absint( $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" /> |
| 49 | </div> |
| 50 | <div class="refund" style="display: none;"> |
| 51 | <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" /> |
| 52 | </div> |
| 53 | </td> |
| 54 | |
| 55 | <?php |
| 56 | if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() ) { |
| 57 | foreach ( $order_taxes as $tax_item ) { |
| 58 | $tax_item_id = $tax_item->get_rate_id(); |
| 59 | $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
| 60 | ?> |
| 61 | <td class="line_tax" width="1%"> |
| 62 | <div class="view"> |
| 63 | <?php |
| 64 | echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '–'; |
| 65 | |
| 66 | if ( $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'fee' ) ) { |
| 67 | echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
| 68 | } |
| 69 | ?> |
| 70 | </div> |
| 71 | <div class="edit" style="display: none;"> |
| 72 | <input type="text" name="line_tax[<?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" /> |
| 73 | </div> |
| 74 | <div class="refund" style="display: none;"> |
| 75 | <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 ); ?>" /> |
| 76 | </div> |
| 77 | </td> |
| 78 | <?php |
| 79 | } |
| 80 | } |
| 81 | ?> |
| 82 | <td class="wc-order-edit-line-item"> |
| 83 | <?php if ( $order->is_editable() ) : ?> |
| 84 | <div class="wc-order-edit-line-item-actions"> |
| 85 | <a class="edit-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Edit fee', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Edit fee', 'woocommerce' ); ?>"></a><a class="delete-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Delete fee', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Delete fee', 'woocommerce' ); ?>"></a> |
| 86 | </div> |
| 87 | <?php endif; ?> |
| 88 | </td> |
| 89 | </tr> |
| 90 |