Use term name for tax-based attribute reorder

This commit is contained in:
claudiulodro 2017-05-05 09:15:27 -07:00
parent e005fe0207
commit afe1a0dd21
1 changed files with 4 additions and 1 deletions

View File

@ -588,9 +588,12 @@ class WC_Form_Handler {
foreach ( $item->get_meta_data() as $meta ) {
if ( taxonomy_is_product_attribute( $meta->key ) ) {
$variations[ $meta->key ] = $meta->value;
$term = get_term_by( 'slug', $meta->value, $meta->key );
$variations[ $meta->key ] = $term ? $term->name : $meta->value;
$test['tax'][] = $meta->key;
} elseif ( meta_is_product_attribute( $meta->key, $meta->value, $product_id ) ) {
$variations[ $meta->key ] = $meta->value;
$test['tax'][] = $meta->key;
}
}