html-admin-dashboard-setup.php
1 month 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
2 months ago
html-admin-page-status-tools.php
1 month ago
html-admin-page-status.php
8 years ago
html-admin-settings.php
2 weeks ago
html-bulk-edit-product.php
1 year ago
html-email-template-preview.php
1 year ago
html-notice-custom.php
8 years ago
html-notice-update.php
6 months ago
html-notice-updated.php
7 years ago
html-notice-updating.php
6 years ago
html-quick-edit-product.php
2 weeks ago
html-report-by-date.php
5 years ago
html-quick-edit-product.php
260 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 | <?php |
| 50 | /** |
| 51 | * Hook to customize the regular expression that validates dates entered in the WooCommerce admin editors. |
| 52 | * |
| 53 | * @since 3.0.0 |
| 54 | * |
| 55 | * @param string $pattern Default pattern to use. |
| 56 | */ |
| 57 | $date_input_html_pattern = apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ); |
| 58 | ?> |
| 59 | <label> |
| 60 | <span class="title"><?php esc_html_e( 'Sale start', 'woocommerce' ); ?></span> |
| 61 | <span class="input-text-wrap"> |
| 62 | <input type="text" name="_sale_price_dates_from" class="text sale_price_dates_from" placeholder="<?php echo esc_attr_x( 'From…', 'placeholder', 'woocommerce' ); ?> YYYY-MM-DD" value="" maxlength="10" pattern="<?php echo esc_attr( $date_input_html_pattern ); ?>"> |
| 63 | </span> |
| 64 | </label> |
| 65 | <br class="clear" /> |
| 66 | <label> |
| 67 | <span class="title"><?php esc_html_e( 'Sale end', 'woocommerce' ); ?></span> |
| 68 | <span class="input-text-wrap"> |
| 69 | <input type="text" name="_sale_price_dates_to" class="text sale_price_dates_to" placeholder="<?php echo esc_attr_x( 'To…', 'placeholder', 'woocommerce' ); ?> YYYY-MM-DD" value="" maxlength="10" pattern="<?php echo esc_attr( $date_input_html_pattern ); ?>"> |
| 70 | </span> |
| 71 | </label> |
| 72 | <br class="clear" /> |
| 73 | </div> |
| 74 | |
| 75 | <?php if ( wc_get_container()->get( CostOfGoodsSoldController::class )->feature_is_enabled() ) : ?> |
| 76 | <div class="cost_fields"> |
| 77 | <label> |
| 78 | <span class="title"><?php esc_html_e( 'Cost', 'woocommerce' ); ?></span> |
| 79 | <span class="input-text-wrap"> |
| 80 | <input type="text" name="_cogs_value" class="text wc_input_price cogs_value" placeholder="<?php esc_attr_e( 'Cost value', 'woocommerce' ); ?>" value=""> |
| 81 | </span> |
| 82 | </label> |
| 83 | <br class="clear" /> |
| 84 | </div> |
| 85 | <?php endif; ?> |
| 86 | |
| 87 | <?php if ( wc_tax_enabled() ) : ?> |
| 88 | <label class="alignleft"> |
| 89 | <span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span> |
| 90 | <span class="input-text-wrap"> |
| 91 | <select class="tax_status" name="_tax_status"> |
| 92 | <?php |
| 93 | $options = array( |
| 94 | ProductTaxStatus::TAXABLE => __( 'Taxable', 'woocommerce' ), |
| 95 | ProductTaxStatus::SHIPPING => __( 'Shipping only', 'woocommerce' ), |
| 96 | ProductTaxStatus::NONE => _x( 'None', 'Tax status', 'woocommerce' ), |
| 97 | ); |
| 98 | foreach ( $options as $key => $value ) { |
| 99 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 100 | } |
| 101 | ?> |
| 102 | </select> |
| 103 | </span> |
| 104 | </label> |
| 105 | <br class="clear" /> |
| 106 | <label class="alignleft"> |
| 107 | <span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span> |
| 108 | <span class="input-text-wrap"> |
| 109 | <select class="tax_class" name="_tax_class"> |
| 110 | <?php |
| 111 | $options = array( |
| 112 | '' => __( 'Standard', 'woocommerce' ), |
| 113 | ); |
| 114 | |
| 115 | $tax_classes = WC_Tax::get_tax_classes(); |
| 116 | |
| 117 | if ( ! empty( $tax_classes ) ) { |
| 118 | foreach ( $tax_classes as $class ) { |
| 119 | $options[ sanitize_title( $class ) ] = esc_html( $class ); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | foreach ( $options as $key => $value ) { |
| 124 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 125 | } |
| 126 | ?> |
| 127 | </select> |
| 128 | </span> |
| 129 | </label> |
| 130 | <br class="clear" /> |
| 131 | <?php endif; ?> |
| 132 | |
| 133 | <?php if ( wc_product_weight_enabled() || wc_product_dimensions_enabled() ) : ?> |
| 134 | <div class="dimension_fields"> |
| 135 | |
| 136 | <?php if ( wc_product_weight_enabled() ) : ?> |
| 137 | <label> |
| 138 | <span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span> |
| 139 | <span class="input-text-wrap"> |
| 140 | <input type="text" name="_weight" class="text weight" placeholder="<?php echo esc_attr( wc_format_localized_decimal( 0 ) ); ?>" value=""> |
| 141 | </span> |
| 142 | </label> |
| 143 | <br class="clear" /> |
| 144 | <?php endif; ?> |
| 145 | |
| 146 | <?php if ( wc_product_dimensions_enabled() ) : ?> |
| 147 | <div class="inline-edit-group dimensions"> |
| 148 | <div> |
| 149 | <span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span> |
| 150 | <span class="input-text-wrap"> |
| 151 | <input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value=""> |
| 152 | <input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value=""> |
| 153 | <input type="text" name="_height" class="text wc_input_decimal height" placeholder="<?php esc_attr_e( 'Height', 'woocommerce' ); ?>" value=""> |
| 154 | </span> |
| 155 | </div> |
| 156 | </div> |
| 157 | <?php endif; ?> |
| 158 | |
| 159 | </div> |
| 160 | <?php endif; ?> |
| 161 | |
| 162 | <div class="inline-edit-group"> |
| 163 | <span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span> |
| 164 | <span class="input-text-wrap"> |
| 165 | <select class="shipping_class" name="_shipping_class"> |
| 166 | <option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option> |
| 167 | <?php |
| 168 | foreach ( $shipping_class as $key => $value ) { |
| 169 | echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>'; |
| 170 | } |
| 171 | ?> |
| 172 | </select> |
| 173 | </span> |
| 174 | </div> |
| 175 | |
| 176 | <div class="inline-edit-group"> |
| 177 | <label class="alignleft"> |
| 178 | <span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span> |
| 179 | <span class="input-text-wrap"> |
| 180 | <select class="visibility" name="_visibility"> |
| 181 | <?php |
| 182 | $options = apply_filters( |
| 183 | 'woocommerce_product_visibility_options', |
| 184 | array( |
| 185 | CatalogVisibility::VISIBLE => __( 'Catalog & search', 'woocommerce' ), |
| 186 | CatalogVisibility::CATALOG => __( 'Catalog', 'woocommerce' ), |
| 187 | CatalogVisibility::SEARCH => __( 'Search', 'woocommerce' ), |
| 188 | CatalogVisibility::HIDDEN => __( 'Hidden', 'woocommerce' ), |
| 189 | ) |
| 190 | ); |
| 191 | foreach ( $options as $key => $value ) { |
| 192 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 193 | } |
| 194 | ?> |
| 195 | </select> |
| 196 | </span> |
| 197 | </label> |
| 198 | <label class="alignleft featured"> |
| 199 | <input type="checkbox" name="_featured" value="1"> |
| 200 | <span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span> |
| 201 | </label> |
| 202 | </div> |
| 203 | |
| 204 | <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?> |
| 205 | <div class="inline-edit-group manage_stock_field"> |
| 206 | <label class="manage_stock"> |
| 207 | <input type="checkbox" name="_manage_stock" value="1"> |
| 208 | <span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span> |
| 209 | </label> |
| 210 | </div> |
| 211 | <?php endif; ?> |
| 212 | |
| 213 | <label class="stock_status_field"> |
| 214 | <span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span> |
| 215 | <span class="input-text-wrap"> |
| 216 | <select class="stock_status" name="_stock_status"> |
| 217 | <?php |
| 218 | echo '<option value="" id="stock_status_no_change">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>'; |
| 219 | foreach ( wc_get_product_stock_status_options() as $key => $value ) { |
| 220 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 221 | } |
| 222 | ?> |
| 223 | </select> |
| 224 | <div class="wc-quick-edit-warning" style="display:none"> |
| 225 | <?php echo esc_html__( 'This will change the stock status of all variations.', 'woocommerce' ); ?></p> |
| 226 | </div> |
| 227 | </span> |
| 228 | </label> |
| 229 | |
| 230 | <div class="stock_fields"> |
| 231 | <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?> |
| 232 | <label class="stock_qty_field"> |
| 233 | <span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span> |
| 234 | <span class="input-text-wrap"> |
| 235 | <input type="number" name="_stock" class="text stock" step="any" value=""> |
| 236 | </span> |
| 237 | </label> |
| 238 | <?php endif; ?> |
| 239 | </div> |
| 240 | |
| 241 | <label class="alignleft backorder_field"> |
| 242 | <span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span> |
| 243 | <span class="input-text-wrap"> |
| 244 | <select class="backorders" name="_backorders"> |
| 245 | <?php |
| 246 | foreach ( wc_get_product_backorder_options() as $key => $value ) { |
| 247 | echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>'; |
| 248 | } |
| 249 | ?> |
| 250 | </select> |
| 251 | </span> |
| 252 | </label> |
| 253 | |
| 254 | <?php do_action( 'woocommerce_product_quick_edit_end' ); ?> |
| 255 | |
| 256 | <input type="hidden" name="woocommerce_quick_edit" value="1" /> |
| 257 | <input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo esc_attr( wp_create_nonce( 'woocommerce_quick_edit_nonce' ) ); ?>" /> |
| 258 | </div> |
| 259 | </fieldset> |
| 260 |