function commerce_cart_blocks_order_type_form_submit in Commerce Cart Blocks 8
Form submission handler for 'commerce_order_type_form'.
Parameters
array $form: The form array.
\Drupal\Core\Form\FormStateInterface $form_state: The form state object.
Throws
\Drupal\Core\Entity\EntityStorageException
1 string reference to 'commerce_cart_blocks_order_type_form_submit'
File
- ./
commerce_cart_blocks.module, line 165 - Contains commerce_cart_blocks.module.
Code
function commerce_cart_blocks_order_type_form_submit(array $form, FormStateInterface $form_state) {
/** @var \Drupal\commerce_order\Entity\OrderTypeInterface $order_type */
$order_type = $form_state
->getFormObject()
->getEntity();
$settings = $form_state
->getValue([
'commerce_cart_blocks',
]);
$order_type
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_ajax', $settings['commerce_cart_blocks_ajax'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_ajax_modal', $settings['commerce_cart_blocks_ajax_modal'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_refresh_page_after_modal', $settings['commerce_cart_blocks_refresh_page_after_modal'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_add_cart', $settings['commerce_cart_blocks_links']['commerce_cart_blocks_add_cart'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_add_checkout', $settings['commerce_cart_blocks_links']['commerce_cart_blocks_add_checkout'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_add_keep_browsing', $settings['commerce_cart_blocks_links']['commerce_cart_blocks_add_keep_browsing'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_ajax_modal_title', $settings['commerce_cart_blocks_ajax_modal_title'])
->setThirdPartySetting('commerce_cart_blocks', 'commerce_cart_blocks_append_block_id', $settings['commerce_cart_blocks_append_block_id'])
->save();
}