Handle _no_shipping_class
This commit is contained in:
parent
6f02cda453
commit
aaecd9e97c
|
@ -940,9 +940,10 @@ class WC_Admin_Post_Types {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
|
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
|
||||||
$shipping_class = '_no_shipping_class' == $_REQUEST['_shipping_class'] ? '' : wc_clean( $_REQUEST['_shipping_class'] );
|
if ( '_no_shipping_class' === $_REQUEST['_shipping_class'] ) {
|
||||||
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( $shipping_class );
|
$product->set_shipping_class_id( 0 );
|
||||||
if ( $shipping_class_id ) {
|
} else {
|
||||||
|
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $_REQUEST['_shipping_class'] ) );
|
||||||
$product->set_shipping_class_id( $shipping_class_id );
|
$product->set_shipping_class_id( $shipping_class_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1079,9 +1080,10 @@ class WC_Admin_Post_Types {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
|
if ( ! empty( $_REQUEST['_shipping_class'] ) ) {
|
||||||
$shipping_class = '_no_shipping_class' == $_REQUEST['_shipping_class'] ? '' : wc_clean( $_REQUEST['_shipping_class'] );
|
if ( '_no_shipping_class' === $_REQUEST['_shipping_class'] ) {
|
||||||
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( $shipping_class );
|
$product->set_shipping_class_id( 0 );
|
||||||
if ( $shipping_class_id ) {
|
} else {
|
||||||
|
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $_REQUEST['_shipping_class'] ) );
|
||||||
$product->set_shipping_class_id( $shipping_class_id );
|
$product->set_shipping_class_id( $shipping_class_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue