Minor clean-up
This commit is contained in:
parent
f362e0108e
commit
8a05f72f78
|
@ -174,12 +174,13 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
|
||||||
protected function generate_product_title( $product ) {
|
protected function generate_product_title( $product ) {
|
||||||
$include_attribute_names = false;
|
$include_attribute_names = false;
|
||||||
$attributes = (array) $product->get_attributes();
|
$attributes = (array) $product->get_attributes();
|
||||||
|
|
||||||
|
//Determine whether to include attribute names through counting the number of one-word attribute values
|
||||||
$one_word_attributes = 0;
|
$one_word_attributes = 0;
|
||||||
foreach ( $attributes as $name => $value ) {
|
foreach ( $attributes as $name => $value ) {
|
||||||
if ( false === strpos( $value, '-' ) ) {
|
if ( false === strpos( $value, '-' ) ) {
|
||||||
++$one_word_attributes;
|
++$one_word_attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $one_word_attributes > 1 ) {
|
if ( $one_word_attributes > 1 ) {
|
||||||
$include_attribute_names = true;
|
$include_attribute_names = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue