Cannot remove shipping class at quick edit

This commit is contained in:
DangH 2015-04-13 18:01:37 +07:00
parent 80b6c6ca3f
commit 3c9bc90bcc
2 changed files with 4 additions and 2 deletions

View File

@ -977,7 +977,9 @@ class WC_Admin_Post_Types {
}
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
wp_set_object_terms( $post_id, wc_clean( $_REQUEST['_shipping_class'] ), 'product_shipping_class' );
$shipping_class = '_no_shipping_class' == $_REQUEST['_shipping_class'] ? '' : wc_clean( $_REQUEST['_shipping_class'] );
wp_set_object_terms( $post_id, $shipping_class, 'product_shipping_class' );
}
if ( isset( $_REQUEST['_visibility'] ) ) {

View File

@ -121,7 +121,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="shipping_class" name="_shipping_class">
<option value=""><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
<option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
<?php
foreach ( $shipping_class as $key => $value ) {
echo '<option value="' . esc_attr( $value->slug ) . '">'. $value->name .'</option>';