Commit 1579cf01 authored by bojanz's avatar bojanz

Set the target bundle on the created variations field.

parent a44d7104
......@@ -85,7 +85,14 @@ function commerce_product_add_variations_field($product_type) {
'bundle' => $product_type->id(),
'label' => 'Variations',
'required' => TRUE,
'settings' => ['display_summary' => FALSE],
'settings' => [
'handler' => 'default',
'handler_settings' => [
'target_bundles' => [
$product_type->getVariationType(),
],
],
],
]);
$field->save();
......
......@@ -18,5 +18,7 @@ default_value: { }
default_value_callback: ''
settings:
handler: 'default:commerce_product_variation'
handler_settings: { }
handler_settings:
target_bundles:
- default
field_type: entity_reference
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