html-order-download-permission.php
6 years ago
html-order-fee.php
5 months ago
html-order-item-meta.php
1 month ago
html-order-item.php
1 month ago
html-order-items.php
2 weeks ago
html-order-notes.php
2 months ago
html-order-refund.php
5 months ago
html-order-shipping.php
2 weeks ago
html-product-attribute-inner.php
1 month ago
html-product-attribute.php
1 month ago
html-product-data-advanced.php
1 month ago
html-product-data-attributes.php
1 week ago
html-product-data-general.php
4 months ago
html-product-data-inventory.php
6 months ago
html-product-data-linked-products.php
4 months ago
html-product-data-panel.php
2 years ago
html-product-data-shipping.php
3 years ago
html-product-data-variations.php
1 week ago
html-product-download.php
6 months ago
html-product-variation-download.php
6 months ago
html-variation-admin.php
2 months ago
html-order-item-meta.php
61 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 = \Automattic\WooCommerce\Internal\Utilities\OrderItemMetaUtil::get_hidden_keys(); |
| 14 | ?><div class="view"> |
| 15 | <?php |
| 16 | $meta_data = $item->get_all_formatted_meta_data( '' ); |
| 17 | if ( $meta_data ) : |
| 18 | ?> |
| 19 | <table cellspacing="0" class="display_meta"> |
| 20 | <?php |
| 21 | foreach ( $meta_data as $meta_id => $meta ) : |
| 22 | if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) { |
| 23 | continue; |
| 24 | } |
| 25 | ?> |
| 26 | <tr> |
| 27 | <th><?php echo wp_kses_post( $meta->display_key ); ?>:</th> |
| 28 | <td><?php echo wp_kses_post( force_balance_tags( $meta->display_value ) ); ?></td> |
| 29 | </tr> |
| 30 | <?php endforeach; ?> |
| 31 | </table> |
| 32 | <?php endif; ?> |
| 33 | </div> |
| 34 | <div class="edit" style="display: none;"> |
| 35 | <table class="meta" cellspacing="0"> |
| 36 | <tbody class="meta_items"> |
| 37 | <?php if ( $meta_data ) : ?> |
| 38 | <?php |
| 39 | foreach ( $meta_data as $meta_id => $meta ) : |
| 40 | if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) { |
| 41 | continue; |
| 42 | } |
| 43 | ?> |
| 44 | <tr data-meta_id="<?php echo esc_attr( $meta_id ); ?>"> |
| 45 | <td> |
| 46 | <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 ); ?>" /> |
| 47 | <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> |
| 48 | </td> |
| 49 | <td width="1%"><button class="remove_order_item_meta button">×</button></td> |
| 50 | </tr> |
| 51 | <?php endforeach; ?> |
| 52 | <?php endif; ?> |
| 53 | </tbody> |
| 54 | <tfoot> |
| 55 | <tr> |
| 56 | <td colspan="4"><button class="add_order_item_meta button"><?php esc_html_e( 'Add meta', 'woocommerce' ); ?></button></td> |
| 57 | </tr> |
| 58 | </tfoot> |
| 59 | </table> |
| 60 | </div> |
| 61 |