Merge pull request #15570 from woocommerce/fix/15555
Show attribute data in admin list.
This commit is contained in:
commit
1f7f289a88
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue