attributes ) { $attributes = $config->attributes; } if ( ! $attributes ) { return $output; } $key = array_search( $product_attribute, $attributes, true ); // ! empty( $key ) this condition is removed because it is not working for 0 index. if ( isset( $config->suffix ) && array_key_exists( $key, $config->suffix ) ) { $unit = $config->suffix[ $key ]; if ( ! empty( $unit ) && ! empty( $output ) ) { $output .= ' ' . $unit; } elseif ( ! empty( $wc_unit ) && ! empty( $output ) ) { $output .= $wc_unit; } } return $output; } }