Fix tests
This commit is contained in:
parent
4130ae0e1f
commit
162aa986b6
|
@ -740,7 +740,7 @@ class WC_AJAX {
|
|||
$order_id = absint( $_POST['order_id'] );
|
||||
$order = wc_get_order( $order_id );
|
||||
|
||||
if (! $order || ! in_array( get_post_type( $item_to_add ), array( 'product', 'product_variation' ) ) ) {
|
||||
if ( ! $order || ! in_array( get_post_type( $item_to_add ), array( 'product', 'product_variation' ) ) ) {
|
||||
throw new Exception( __( 'Invalid product', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
|
@ -1296,7 +1296,7 @@ class WC_AJAX {
|
|||
|
||||
if ( isset( $menu_orders[ $previd ] ) ) {
|
||||
$menu_orders[ $sorting_id ] = $menu_orders[ $previd ] + 1;
|
||||
} elseif( isset( $menu_orders[ $nextid ] ) ) {
|
||||
} elseif ( isset( $menu_orders[ $nextid ] ) ) {
|
||||
$menu_orders[ $sorting_id ] = $menu_orders[ $nextid ] - 1;
|
||||
} else {
|
||||
$menu_orders[ $sorting_id ] = 0;
|
||||
|
|
|
@ -83,7 +83,7 @@ class WC_Product_Download implements ArrayAccess {
|
|||
if ( 'shortcode' === $this->get_type_of_file_path() ) {
|
||||
return true;
|
||||
}
|
||||
return empty( $this->get_file_extension() ) || in_array( $this->get_file_type(), $this->get_allowed_mime_types() );
|
||||
return ! $this->get_file_extension() || in_array( $this->get_file_type(), $this->get_allowed_mime_types() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -169,6 +169,7 @@ class WC_Helper_Product {
|
|||
'post_type' => 'product_variation',
|
||||
'post_parent' => $product_id,
|
||||
'post_status' => 'publish',
|
||||
'menu_order' => 1,
|
||||
) );
|
||||
|
||||
// Price related meta
|
||||
|
@ -193,6 +194,7 @@ class WC_Helper_Product {
|
|||
'post_type' => 'product_variation',
|
||||
'post_parent' => $product_id,
|
||||
'post_status' => 'publish',
|
||||
'menu_order' => 2,
|
||||
) );
|
||||
|
||||
// Price related meta
|
||||
|
|
Loading…
Reference in New Issue