Fix for variations when an attribute has been removed

This commit is contained in:
Mike Jolley 2011-10-09 14:32:33 +01:00
parent 508f321324
commit 8c3aa633ff
2 changed files with 9 additions and 0 deletions

View File

@ -617,6 +617,14 @@ function process_product_meta_variable( $post_id ) {
update_post_meta( $variation_id, 'stock', $variable_stock[$i] );
update_post_meta( $variation_id, '_thumbnail_id', $upload_image_id[$i] );
// Remove old taxnomies attributes so data is kept up to date
$variation_custom_fields = get_post_custom( $variation_id );
foreach ($variation_custom_fields as $name => $value) :
if (!strstr($name, 'attribute_')) continue;
delete_post_meta( $variation_id, $name );
endforeach;
// Update taxonomies
foreach ($attributes as $attribute) :

View File

@ -68,6 +68,7 @@ For further documentation on using WooCommerce, please sign up for free at http:
* Product dimension fields
* Fixed archives being displayed by woocommerce_show_product_images
* Added 'configure terms' button to attributes page to make it clearer
* Fix for variations when an attribute has been removed
= 1.0.3 - 06/10/2011 =
* Several minor fixes/tweaks