Commit ccf842ca authored by rszrama's avatar rszrama Committed by mglaman

Issue #2638958 by rszrama, vasike, mglaman, bradjones1, niko-, PlayfulWolf,...

Issue #2638958 by rszrama, vasike, mglaman, bradjones1, niko-, PlayfulWolf, bojanz, edaa, jagundez, jespermb: Views has problems using the purchased_entity field
parent 32945689
......@@ -370,6 +370,13 @@ class OrderItem extends CommerceContentEntityBase implements OrderItemInterface
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
/** @var \Drupal\commerce\PurchasableEntityTypeRepositoryInterface $purchasable_entity_type_repository */
$purchasable_entity_type_repository = \Drupal::service('commerce.purchasable_entity_type_repository');
$default_purchasable_entity_type = $purchasable_entity_type_repository->getDefaultPurchasableEntityType();
if ($default_purchasable_entity_type) {
$fields['purchased_entity']->setSetting('target_type', $default_purchasable_entity_type->id());
}
$fields['title'] = BaseFieldDefinition::create('string')
->setLabel(t('Title'))
->setDescription(t('The order item title.'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment