I've successfully added custom attribute to checkout and when creating the order is saving in quote, and order table, but how to implement the same when creating an order via admin backend?

Thx in advance!


Use plugin around the parent Magento\Sales\Block\Adminhtml\Order\Create\Data blocks getChildHtml method. Within the plugin I then check the name of the block being rendered and inject my new block where appropriate. E.g


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Block\Adminhtml\Order\Create\Data">
        <plugin name="after_order_create_data" type="Namespace\Module\Plugin\Sales\Block\Adminhtml\Order\Create\DataPlugin" sortOrder="10"/>


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="data">
            <block class="Namespace\Module\Block\Adminhtml\Order\Create\Form\CustomBlock" template="Namespace_Module::order/create/form/newsection.phtml" name="newcustom_filed" />


namespace Namespace\Module\Plugin\Sales\Block\Adminhtml\Order\Create;

class DataPlugin

    public function aroundGetChildHtml(\Magento\Sales\Block\Adminhtml\Order\Create\Data $subject, callable $proceed, $id, $useCache = true)
        $html = $proceed($id, $useCache);

        if ($id == 'form_account') { // <- different sections can be targeted by changing block name
            $block = $subject->getChildHtml('newcustom_filed');
            $html = $html . $block;

        return $html;


<!-- we are injecting into an existing section so close it first and then open new one. This may need to be adjusted depending on what block the new block is injected in -->

<section id="order-customblock" class="admin__page-section order-customblock">

   <!-- put new block content here -->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.