Show attribute data in admin list.

This commit is contained in:
Mike Jolley 2017-06-12 13:37:52 +01:00
parent 396c8aa4fc
commit 54a9387361
4 changed files with 27 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5424,6 +5424,11 @@ table.bar_chart {
margin: 0;
padding: 8px;
}
.description {
display: block;
color: #999;
padding-top: 4px;
}
}
.select2-dropdown {
border-color: #ddd;
@ -5464,6 +5469,9 @@ table.bar_chart {
}
.select2-selection__choice {
padding: 2px 6px;
.description {
display: none;
}
}
}
.select2-selection__clear {

View File

@ -78,6 +78,23 @@ class WC_Product_Variation extends WC_Product_Simple {
return apply_filters( 'woocommerce_product_title', $this->parent_data['title'], $this );
}
/**
* Get product name with SKU or ID. Used within admin.
*
* @return string Formatted product name
*/
public function get_formatted_name() {
if ( $this->get_sku() ) {
$identifier = $this->get_sku();
} else {
$identifier = '#' . $this->get_id();
}
$formatted_variation_list = wc_get_formatted_variation( $this, true, true );
return sprintf( '%2$s (%1$s)', $identifier, $this->get_name() ) . '<span class="description">' . $formatted_variation_list . '</span>';
}
/**
* Get variation attribute values. Keys are prefixed with attribute_, as stored.
*