diff --git a/admin/post-types/product.php b/admin/post-types/product.php index c24155d7457..884f43944b2 100644 --- a/admin/post-types/product.php +++ b/admin/post-types/product.php @@ -280,7 +280,8 @@ function woocommerce_custom_product_orderby( $vars ) { endif; if ( 'sku' == $vars['orderby'] ) : $vars = array_merge( $vars, array( - 'orderby' => 'id' + 'meta_key' => '_sku', + 'orderby' => 'meta_value' ) ); endif; endif; diff --git a/admin/post-types/writepanels/writepanel-product_data.php b/admin/post-types/writepanels/writepanel-product_data.php index 4b874c2d166..77737ffd4fb 100644 --- a/admin/post-types/writepanels/writepanel-product_data.php +++ b/admin/post-types/writepanels/writepanel-product_data.php @@ -514,7 +514,9 @@ function woocommerce_process_product_meta( $post_id, $post ) { // Unique SKU $sku = get_post_meta($post_id, '_sku', true); $new_sku = esc_html(stripslashes( $_POST['_sku'] )); - if ($new_sku!==$sku) : + if ($new_sku=='') : + update_post_meta( $post_id, '_sku', '' ); + elseif ($new_sku!==$sku) : if ($new_sku && !empty($new_sku)) : if ( $wpdb->get_var($wpdb->prepare(" diff --git a/readme.txt b/readme.txt index ada04f7225f..f6cd4df325b 100644 --- a/readme.txt +++ b/readme.txt @@ -145,6 +145,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Bulk edit products * Added basic API for payment gateways to hook into (for IPN etc) * Added Bulgarian translation +* Fixed SKU sort in admin = 1.4.4 - 18/02/2012 = * Fix for remove coupon links after ajax update of shipping