protected function getFieldsCompare(array $products)
    {
        $labels = array();

        foreach ($products as $product) {
            if (!empty($product['field_value_labels'])) {
                foreach ($product['field_value_labels'] as $type => $fields) {
                    foreach (array_keys($fields) as $field_id) {
                        $labels[$type][$field_id] = $product['fields'][$type][$field_id]['title'];
                    }
                }
            }
        }

        return $labels;
    }
protected function getFieldsCompare(array $products)
    {
        $labels = array();

        foreach ($products as $product) {
            if (!empty($product['field_value_labels'])) {
                foreach ($product['field_value_labels'] as $type => $fields) {
                    foreach (array_keys($fields) as $field_id) {
                        $labels[$type][$field_id] = $product['fields'][$type][$field_id]['title'];
                    }
                }
            }
        }

        return $labels;
    }
protected function getFieldsCompare ( array $ products ) { $ labels = array ( ) ; foreach ( $ products as $ product ) { if ( ! empty ( $ product [ 'field_value_labels' ] ) ) { foreach ( $ product [ 'field_value_labels' ] as $ type => $ fields ) { foreach ( array_keys ( $ fields ) as $ field_id ) { $ labels [ $ type ] [ $ field_id ] = $ product [ 'fields' ] [ $ type ] [ $ field_id ] [ 'title' ] ; } } } } return $ labels ; }
Returns an array of all fields for the given products
@param array $products
@return array
Returns an array of all fields for the given products