I don't understand how our install is currently working, but we have incorrect plugin ID names for quantity and price.
$fields['quantity'] = BaseFieldDefinition::create('decimal')
->setLabel(t('Quantity'))
->setDescription(t('The number of purchased units.'))
->setReadOnly(TRUE)
->setSetting('unsigned', TRUE)
->setDisplayOptions('form', [
'type' => 'string',
'weight' => 1,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['unit_price'] = BaseFieldDefinition::create('commerce_price')
->setLabel(t('Unit price'))
->setDescription(t('The price of a single unit.'))
->setRequired(TRUE)
->setDisplayOptions('form', [
'type' => 'price_simple',
'weight' => 2,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
Both string and price_simple are not valid for the form display mode. It should be number and commerce_price_default
Comments
Comment #2
mglamanPR: https://github.com/drupalcommerce/commerce/pull/339
Comment #4
mglaman