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-product-data-attributes.php
109 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Displays the attributes tab in the product data meta box. |
| 4 | * |
| 5 | * @package WooCommerce\Admin |
| 6 | */ |
| 7 | |
| 8 | use Automattic\WooCommerce\Admin\Features\Features; |
| 9 | use Automattic\WooCommerce\Admin\Features\ProductVariationsClassicRedesign; |
| 10 | use Automattic\WooCommerce\Internal\ProductAttributes\VisualAttributeTermAdmin; |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | if ( Features::exists( ProductVariationsClassicRedesign::FEATURE_ID ) ) { |
| 17 | ?> |
| 18 | <div id="product_attributes" class="panel wc-metaboxes-wrapper hidden"> |
| 19 | <div id="<?php echo esc_attr( ProductVariationsClassicRedesign::ATTRIBUTES_ROOT_ID ); ?>"></div> |
| 20 | </div> |
| 21 | <?php |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | global $wc_product_attributes; |
| 26 | // Array of defined attribute taxonomies. |
| 27 | $attribute_taxonomies = wc_get_attribute_taxonomies(); |
| 28 | // Product attributes - taxonomies and custom, ordered, with visibility and variation attributes set. |
| 29 | $product_attributes = $product_object->get_attributes( 'edit' ); |
| 30 | ?> |
| 31 | <div id="product_attributes" class="panel wc-metaboxes-wrapper hidden"> |
| 32 | <div class="toolbar toolbar-top"> |
| 33 | <div id="message" class="inline notice woocommerce-message is-dismissible"> |
| 34 | <p class="help"> |
| 35 | <?php |
| 36 | esc_html_e( |
| 37 | 'Add descriptive pieces of information that customers can use to search for this product on your store, such as “Material” or “Size”.', |
| 38 | 'woocommerce' |
| 39 | ); |
| 40 | ?> |
| 41 | <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'woocommerce' ); ?></span></button> |
| 42 | </p> |
| 43 | </div> |
| 44 | <span class="expand-close"> |
| 45 | <a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a> |
| 46 | </span> |
| 47 | <div class="actions"> |
| 48 | <button type="button" class="button add_custom_attribute"><?php esc_html_e( 'Add new', 'woocommerce' ); ?></button> |
| 49 | <select class="wc-attribute-search" data-placeholder="<?php esc_attr_e( 'Add existing', 'woocommerce' ); ?>" data-minimum-input-length="0"> |
| 50 | </select> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="product_attributes wc-metaboxes"> |
| 54 | <?php |
| 55 | $i = -1; |
| 56 | |
| 57 | foreach ( $product_attributes as $attribute ) { |
| 58 | ++$i; |
| 59 | $metabox_class = array(); |
| 60 | |
| 61 | if ( $attribute->is_taxonomy() ) { |
| 62 | $metabox_class[] = 'taxonomy'; |
| 63 | $metabox_class[] = $attribute->get_name(); |
| 64 | } |
| 65 | |
| 66 | include __DIR__ . '/html-product-attribute.php'; |
| 67 | } |
| 68 | ?> |
| 69 | </div> |
| 70 | <div class="toolbar toolbar-buttons"> |
| 71 | <span class="expand-close"> |
| 72 | <a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a> |
| 73 | </span> |
| 74 | <button type="button" aria-disabled="true" class="button save_attributes button-primary disabled"><?php esc_html_e( 'Save attributes', 'woocommerce' ); ?></button> |
| 75 | </div> |
| 76 | <?php do_action( 'woocommerce_product_options_attributes' ); ?> |
| 77 | </div> |
| 78 | |
| 79 | <script type="text/template" id="tmpl-wc-modal-add-attribute-term"> |
| 80 | <div class="wc-backbone-modal wc-backbone-modal-add-attribute-term"> |
| 81 | <div class="wc-backbone-modal-content"> |
| 82 | <section class="wc-backbone-modal-main" role="main"> |
| 83 | <header class="wc-backbone-modal-header"> |
| 84 | <h1><?php esc_html_e( 'Create value', 'woocommerce' ); ?></h1> |
| 85 | <button class="modal-close modal-close-link dashicons dashicons-no-alt"> |
| 86 | <span class="screen-reader-text"><?php esc_html_e( 'Close modal panel', 'woocommerce' ); ?></span> |
| 87 | </button> |
| 88 | </header> |
| 89 | <article> |
| 90 | <form class="wc-add-attribute-term-fields" action="" method="post"> |
| 91 | <label for="wc-modal-add-attribute-term-input"><?php esc_html_e( 'Name', 'woocommerce' ); ?></label> |
| 92 | <input id="wc-modal-add-attribute-term-input" type="text" name="term" value="" /> |
| 93 | <# if ( data.isVisualAttribute ) { #> |
| 94 | <?php VisualAttributeTermAdmin::render_add_attribute_term_modal_fields(); ?> |
| 95 | <# } #> |
| 96 | </form> |
| 97 | </article> |
| 98 | <footer> |
| 99 | <div class="wc-backbone-modal-buttons"> |
| 100 | <button class="modal-close button button-large"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></button> |
| 101 | <button id="btn-ok" disabled class="button button-primary button-large"><?php esc_html_e( 'OK', 'woocommerce' ); ?></button> |
| 102 | </div> |
| 103 | </footer> |
| 104 | </section> |
| 105 | </div> |
| 106 | </div> |
| 107 | <div class="wc-backbone-modal-backdrop modal-close"></div> |
| 108 | </script> |
| 109 |