You are here

function uc_product_kit_node_builder in Ubercart 8.4

Entity form builder to add product kit information to the node.

@todo Remove this in favor of an entity field.

1 string reference to 'uc_product_kit_node_builder'
uc_product_kit_form_node_form_alter in uc_product_kit/uc_product_kit.module
Implements hook_form_BASE_FORM_ID_alter() for node_form().

File

uc_product_kit/uc_product_kit.module, line 654
The product kit module for Ubercart.

Code

function uc_product_kit_node_builder($entity_type, $entity, &$form, FormStateInterface $form_state) {
  $entity->mutable = $form_state
    ->getValue('mutable');
  $entity->products = $form_state
    ->getValue('products');
  if ($form_state
    ->hasValue('items')) {
    $entity->items = $form_state
      ->getValue('items');
  }
  if ($form_state
    ->hasValue('kit_total')) {
    $entity->kit_total = $form_state
      ->getValue('kit_total');
  }
}