Skip to content
Snippets Groups Projects

added commerce products attributes

1 file
+ 4
0
Compare changes
  • Side-by-side
  • Inline
@@ -41,6 +41,10 @@ function entityreference_filter_views_data_alter(array &$data) {
if ($field_name === 'product_id') {
$target_entity_type = 'commerce_product';
}
// Commerce product attributes.
if ($field_name === 'attribute_value_id' || (mb_substr($field_name, -10) === '_target_id' && $field_info['filter']['field_name'] === 'attributes')) {
$target_entity_type = 'commerce_product_attribute_value';
}
}
// Other entityreference fields.
elseif (!empty($field_info['filter']['field_name']) && !empty($field_info['filter']['entity_type']) && mb_substr($field_name, -10) === '_target_id') {
Loading