added product variations to home page on pricing
This commit is contained in:
@@ -98,6 +98,26 @@ function materio_home_entity_bundle_field_info(EntityTypeInterface $entity_type,
|
||||
])
|
||||
->setClass(\Drupal\materio_home\Plugin\Field\FieldType\ComputedArticlesReferences::class);
|
||||
|
||||
$fields['computed_products_reference'] = BaseFieldDefinition::create('entity_reference')
|
||||
->setName('computed_products_reference')
|
||||
->setLabel(t('Computed Products References'))
|
||||
->setDescription(t('Computed Products References.'))
|
||||
// // The Entity Type this field belongs to.
|
||||
->setTargetEntityTypeId($entity_type->id())
|
||||
// // The Entity Type bundle this field belongs to.
|
||||
->setTargetBundle($bundle)
|
||||
->setSetting('target_type', 'commerce_product_variation')
|
||||
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
|
||||
->setComputed(TRUE)
|
||||
->setRevisionable(FALSE)
|
||||
->setTranslatable(FALSE)
|
||||
->setDisplayConfigurable('view', TRUE)
|
||||
->setDisplayOptions('view', [
|
||||
'label' => 'hidden',
|
||||
'weight' => -5,
|
||||
])
|
||||
->setClass(\Drupal\materio_home\Plugin\Field\FieldType\ComputedProdVariationsReferences::class);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user