html-admin-dashboard-setup.php
5 months ago
html-admin-page-addons-category-nav.php
4 years ago
html-admin-page-product-export.php
1 year ago
html-admin-page-reports.php
2 years ago
html-admin-page-status-logs-db.php
2 years ago
html-admin-page-status-logs.php
2 years ago
html-admin-page-status-report.php
1 month ago
html-admin-page-status-tools.php
2 years ago
html-admin-page-status.php
8 years ago
html-admin-settings.php
1 month ago
html-bulk-edit-product.php
1 year ago
html-email-template-preview.php
1 year ago
html-notice-base-table-missing.php
3 years ago
html-notice-custom.php
8 years ago
html-notice-download-dir-sync-complete.php
2 years ago
html-notice-install.php
5 years ago
html-notice-legacy-shipping.php
11 months ago
html-notice-maxmind-license-key.php
6 years ago
html-notice-no-shipping-methods.php
2 years ago
html-notice-redirect-only-download.php
4 years ago
html-notice-regenerating-lookup-table.php
5 years ago
html-notice-regenerating-thumbnails.php
8 years ago
html-notice-secure-connection.php
2 years ago
html-notice-sync-on-read-disabled.php
3 months ago
html-notice-template-check.php
2 years ago
html-notice-update.php
4 months ago
html-notice-updated.php
7 years ago
html-notice-updating.php
6 years ago
html-notice-uploads-directory-is-unprotected.php
2 years ago
html-notice-wp-php-minimum-requirements.php
2 years ago
html-quick-edit-product.php
1 year ago
html-report-by-date.php
5 years ago
html-quick-edit-product.php
236 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Quick Edit Product |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Notices |
| 6 | */ |
| 7 | |
| 8 | use Automattic\WooCommerce\Internal\CostOfGoodsSold\CostOfGoodsSoldController; |
| 9 | use Automattic\WooCommerce\Enums\CatalogVisibility; |
| 10 | use Automattic\WooCommerce\Enums\ProductTaxStatus; |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | ?> |
| 14 | |
| 15 | <fieldset class="inline-edit-col-left"> |
| 16 | <div id="woocommerce-fields" class="inline-edit-col"> |
| 17 | |
| 18 | <h4><?php esc_html_e( 'Product data', 'woocommerce' ); ?></h4> |
| 19 | |
| 20 | <?php do_action( 'woocommerce_product_quick_edit_start' ); ?> |
| 21 | |
| 22 | <?php if ( wc_product_sku_enabled() ) : ?> |
| 23 | |
| 24 | <label> |
| 25 | <span class="title"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></span> |
| 26 | <span class="input-text-wrap"> |
| 27 | <input type="text" name="_sku" class="text sku" value=""> |
| 28 | </span> |
| 29 | </label> |
| 30 | <br class="clear" /> |
| 31 | |
| 32 | <?php endif; ?> |
| 33 | |
| 34 | <div class="price_fields"> |
| 35 | <label> |
| 36 | <span class="title"><?php esc_html_e( 'Price', 'woocommerce' ); ?></span> |
| 37 | <span class="input-text-wrap"> |
| 38 | <input type="text" name="_regular_price" class="text wc_input_price regular_price" placeholder="<?php esc_attr_e( 'Regular price', 'woocommerce' ); ?>" value=""> |
| 39 | </span> |
| 40 | </label> |
| 41 | <br class="clear" /> |
| 42 | <label> |
| 43 | <span class="title"><?php esc_html_e( 'Sale', 'woocommerce' ); ?></span> |
| 44 | <span class="input-text-wrap"> |
| 45 | <input type="text" name="_sale_price" class="text wc_input_price sale_price" placeholder="<?php esc_attr_e( 'Sale price', 'woocommerce' ); ?>" value=""> |
| 46 | </span> |
| 47 | </label> |
| 48 | <br class="clear" /> |
| 49 | </div> |
| 50 | |
| 51 | <?php if ( wc_get_container()->get( CostOfGoodsSoldController::class )->feature_is_enabled() ) : ?> |
| 52 | <div class="cost_fields"> |
| 53 | <label> |
| 54 | <span class="title"><?php esc_html_e( 'Cost', 'woocommerce' ); ?></span> |
| 55 | <span class="input-text-wrap"> |
| 56 | <input type="text" name="_cogs_value" class="text wc_input_price cogs_value" placeholder="<?php esc_attr_e( 'Cost value', 'woocommerce' ); ?>" value=""> |
| 57 | </span> |
| 58 | </label> |
| 59 | <br class="clear" /> |
| 60 | </div> |
| 61 | <?php endif; ?> |
| 62 | |
| 63 | <?php if ( wc_tax_enabled() ) : ?> |
| 64 | <label class="alignleft"> |
| 65 | <span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span> |
| 66 | <span class="input-text-wrap"> |
| 67 | <select class="tax_status" name="_tax_status"> |
| 68 | <?php |
| 69 | $options = array( |
| 70 | ProductTaxStatus::TAXABLE => __( 'Taxable', 'woocommerce' ), |
| 71 | ProductTaxStatus::SHIPPING => __( 'Shipping only', 'woocommerce' ), |
| 72 | ProductTaxStatus::NONE => _x( 'None', 'Tax status', 'woocommerce' ), |
| 73 | ); |
| 74 | foreach ( $options as $key => $value ) { |
| 75 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 76 | } |
| 77 | ?> |
| 78 | </select> |
| 79 | </span> |
| 80 | </label> |
| 81 | <br class="clear" /> |
| 82 | <label class="alignleft"> |
| 83 | <span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span> |
| 84 | <span class="input-text-wrap"> |
| 85 | <select class="tax_class" name="_tax_class"> |
| 86 | <?php |
| 87 | $options = array( |
| 88 | '' => __( 'Standard', 'woocommerce' ), |
| 89 | ); |
| 90 | |
| 91 | $tax_classes = WC_Tax::get_tax_classes(); |
| 92 | |
| 93 | if ( ! empty( $tax_classes ) ) { |
| 94 | foreach ( $tax_classes as $class ) { |
| 95 | $options[ sanitize_title( $class ) ] = esc_html( $class ); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | foreach ( $options as $key => $value ) { |
| 100 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 101 | } |
| 102 | ?> |
| 103 | </select> |
| 104 | </span> |
| 105 | </label> |
| 106 | <br class="clear" /> |
| 107 | <?php endif; ?> |
| 108 | |
| 109 | <?php if ( wc_product_weight_enabled() || wc_product_dimensions_enabled() ) : ?> |
| 110 | <div class="dimension_fields"> |
| 111 | |
| 112 | <?php if ( wc_product_weight_enabled() ) : ?> |
| 113 | <label> |
| 114 | <span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span> |
| 115 | <span class="input-text-wrap"> |
| 116 | <input type="text" name="_weight" class="text weight" placeholder="<?php echo esc_attr( wc_format_localized_decimal( 0 ) ); ?>" value=""> |
| 117 | </span> |
| 118 | </label> |
| 119 | <br class="clear" /> |
| 120 | <?php endif; ?> |
| 121 | |
| 122 | <?php if ( wc_product_dimensions_enabled() ) : ?> |
| 123 | <div class="inline-edit-group dimensions"> |
| 124 | <div> |
| 125 | <span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span> |
| 126 | <span class="input-text-wrap"> |
| 127 | <input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value=""> |
| 128 | <input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value=""> |
| 129 | <input type="text" name="_height" class="text wc_input_decimal height" placeholder="<?php esc_attr_e( 'Height', 'woocommerce' ); ?>" value=""> |
| 130 | </span> |
| 131 | </div> |
| 132 | </div> |
| 133 | <?php endif; ?> |
| 134 | |
| 135 | </div> |
| 136 | <?php endif; ?> |
| 137 | |
| 138 | <div class="inline-edit-group"> |
| 139 | <span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span> |
| 140 | <span class="input-text-wrap"> |
| 141 | <select class="shipping_class" name="_shipping_class"> |
| 142 | <option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option> |
| 143 | <?php |
| 144 | foreach ( $shipping_class as $key => $value ) { |
| 145 | echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>'; |
| 146 | } |
| 147 | ?> |
| 148 | </select> |
| 149 | </span> |
| 150 | </div> |
| 151 | |
| 152 | <div class="inline-edit-group"> |
| 153 | <label class="alignleft"> |
| 154 | <span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span> |
| 155 | <span class="input-text-wrap"> |
| 156 | <select class="visibility" name="_visibility"> |
| 157 | <?php |
| 158 | $options = apply_filters( |
| 159 | 'woocommerce_product_visibility_options', |
| 160 | array( |
| 161 | CatalogVisibility::VISIBLE => __( 'Catalog & search', 'woocommerce' ), |
| 162 | CatalogVisibility::CATALOG => __( 'Catalog', 'woocommerce' ), |
| 163 | CatalogVisibility::SEARCH => __( 'Search', 'woocommerce' ), |
| 164 | CatalogVisibility::HIDDEN => __( 'Hidden', 'woocommerce' ), |
| 165 | ) |
| 166 | ); |
| 167 | foreach ( $options as $key => $value ) { |
| 168 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 169 | } |
| 170 | ?> |
| 171 | </select> |
| 172 | </span> |
| 173 | </label> |
| 174 | <label class="alignleft featured"> |
| 175 | <input type="checkbox" name="_featured" value="1"> |
| 176 | <span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span> |
| 177 | </label> |
| 178 | </div> |
| 179 | |
| 180 | <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?> |
| 181 | <div class="inline-edit-group manage_stock_field"> |
| 182 | <label class="manage_stock"> |
| 183 | <input type="checkbox" name="_manage_stock" value="1"> |
| 184 | <span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span> |
| 185 | </label> |
| 186 | </div> |
| 187 | <?php endif; ?> |
| 188 | |
| 189 | <label class="stock_status_field"> |
| 190 | <span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span> |
| 191 | <span class="input-text-wrap"> |
| 192 | <select class="stock_status" name="_stock_status"> |
| 193 | <?php |
| 194 | echo '<option value="" id="stock_status_no_change">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>'; |
| 195 | foreach ( wc_get_product_stock_status_options() as $key => $value ) { |
| 196 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 197 | } |
| 198 | ?> |
| 199 | </select> |
| 200 | <div class="wc-quick-edit-warning" style="display:none"> |
| 201 | <?php echo esc_html__( 'This will change the stock status of all variations.', 'woocommerce' ); ?></p> |
| 202 | </div> |
| 203 | </span> |
| 204 | </label> |
| 205 | |
| 206 | <div class="stock_fields"> |
| 207 | <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?> |
| 208 | <label class="stock_qty_field"> |
| 209 | <span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span> |
| 210 | <span class="input-text-wrap"> |
| 211 | <input type="number" name="_stock" class="text stock" step="any" value=""> |
| 212 | </span> |
| 213 | </label> |
| 214 | <?php endif; ?> |
| 215 | </div> |
| 216 | |
| 217 | <label class="alignleft backorder_field"> |
| 218 | <span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span> |
| 219 | <span class="input-text-wrap"> |
| 220 | <select class="backorders" name="_backorders"> |
| 221 | <?php |
| 222 | foreach ( wc_get_product_backorder_options() as $key => $value ) { |
| 223 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 224 | } |
| 225 | ?> |
| 226 | </select> |
| 227 | </span> |
| 228 | </label> |
| 229 | |
| 230 | <?php do_action( 'woocommerce_product_quick_edit_end' ); ?> |
| 231 | |
| 232 | <input type="hidden" name="woocommerce_quick_edit" value="1" /> |
| 233 | <input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo esc_attr( wp_create_nonce( 'woocommerce_quick_edit_nonce' ) ); ?>" /> |
| 234 | </div> |
| 235 | </fieldset> |
| 236 |