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
6 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-item-meta.php
77 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Shows an order item meta |
| 4 | * |
| 5 | * @package WooCommerce\Admin |
| 6 | * @var object $item The item being displayed |
| 7 | * @var int $item_id The id of the item being displayed |
| 8 | */ |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | $hidden_order_itemmeta = apply_filters( |
| 14 | 'woocommerce_hidden_order_itemmeta', |
| 15 | array( |
| 16 | '_qty', |
| 17 | '_tax_class', |
| 18 | '_product_id', |
| 19 | '_variation_id', |
| 20 | '_line_subtotal', |
| 21 | '_line_subtotal_tax', |
| 22 | '_line_total', |
| 23 | '_line_tax', |
| 24 | 'method_id', |
| 25 | 'cost', |
| 26 | '_reduced_stock', |
| 27 | '_restock_refunded_items', |
| 28 | ) |
| 29 | ); |
| 30 | ?><div class="view"> |
| 31 | <?php |
| 32 | $meta_data = $item->get_all_formatted_meta_data( '' ); |
| 33 | if ( $meta_data ) : |
| 34 | ?> |
| 35 | <table cellspacing="0" class="display_meta"> |
| 36 | <?php |
| 37 | foreach ( $meta_data as $meta_id => $meta ) : |
| 38 | if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) { |
| 39 | continue; |
| 40 | } |
| 41 | ?> |
| 42 | <tr> |
| 43 | <th><?php echo wp_kses_post( $meta->display_key ); ?>:</th> |
| 44 | <td><?php echo wp_kses_post( force_balance_tags( $meta->display_value ) ); ?></td> |
| 45 | </tr> |
| 46 | <?php endforeach; ?> |
| 47 | </table> |
| 48 | <?php endif; ?> |
| 49 | </div> |
| 50 | <div class="edit" style="display: none;"> |
| 51 | <table class="meta" cellspacing="0"> |
| 52 | <tbody class="meta_items"> |
| 53 | <?php if ( $meta_data ) : ?> |
| 54 | <?php |
| 55 | foreach ( $meta_data as $meta_id => $meta ) : |
| 56 | if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) { |
| 57 | continue; |
| 58 | } |
| 59 | ?> |
| 60 | <tr data-meta_id="<?php echo esc_attr( $meta_id ); ?>"> |
| 61 | <td> |
| 62 | <input type="text" maxlength="255" placeholder="<?php esc_attr_e( 'Name (required)', 'woocommerce' ); ?>" name="meta_key[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]" value="<?php echo esc_attr( $meta->key ); ?>" /> |
| 63 | <textarea placeholder="<?php esc_attr_e( 'Value (required)', 'woocommerce' ); ?>" name="meta_value[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]"><?php echo esc_textarea( rawurldecode( $meta->value ) ); ?></textarea> |
| 64 | </td> |
| 65 | <td width="1%"><button class="remove_order_item_meta button">×</button></td> |
| 66 | </tr> |
| 67 | <?php endforeach; ?> |
| 68 | <?php endif; ?> |
| 69 | </tbody> |
| 70 | <tfoot> |
| 71 | <tr> |
| 72 | <td colspan="4"><button class="add_order_item_meta button"><?php esc_html_e( 'Add meta', 'woocommerce' ); ?></button></td> |
| 73 | </tr> |
| 74 | </tfoot> |
| 75 | </table> |
| 76 | </div> |
| 77 |