Corrected ordering

This commit is contained in:
Mike Jolley 2011-11-22 16:13:32 +00:00
parent c3a0b5a33c
commit fcfb8e20b2
1 changed files with 12 additions and 14 deletions

View File

@ -864,21 +864,8 @@ class woocommerce_product {
}
}
}
// Order custom attributes (non taxonomy) as defined
if (!$attribute['is_taxonomy']) :
$options = explode('|', $attribute['value']);
$options = array_map('trim', $options);
$values = array_intersect( $options, $values );
endif;
$values = array_unique($values);
}
// empty value indicates that all options for given attribute are available
if(in_array('', $values)) {
@ -896,6 +883,17 @@ class woocommerce_product {
$options = array_map('trim', $options);
$values = array_unique($options);
} else {
// Order custom attributes (non taxonomy) as defined
if (!$attribute['is_taxonomy']) :
$options = explode('|', $attribute['value']);
$options = array_map('trim', $options);
$values = array_intersect( $options, $values );
endif;
$values = array_unique($values);
}
$available_attributes[$attribute['name']] = array_unique($values);