I have created a new checkout step with 4 form fields. The step is called additional-order-info.

I created the step and the form with the help of the devdocs for Magento 2(.1).

I have also created table columns in the quote and sales_order tables to save the data into.

Everything seems to be working with the step (validation, etc) apart from the fact that the form fields are not in the post data for the checkout.

This is what I see when I click 'Place Order': Dev Tools Network Tab

My section is not there. I have expanded the billingAddress and paymentMethod objects but my fields are not there.

Here is my component's JS file if needed:

    function (ko,
    ) {
        'use strict';
         * mystep - is the name of the component's .html template,
         * <Vendor>_<Module>  - is the name of the your module directory.
        return Component.extend({
            defaults: {
                template: 'Wildcard_CheckThisOut/additional-order-info'

            //add here your logic to display step,
            isVisible: ko.observable(false),

             * @returns {*}
            initialize: function () {

                // register your step
                    //step code will be used as step content id in the component template
                    //step alias
                    //step title value
                    'Additional Information',
                    //observable property with logic when display step or hide step

                    _.bind(this.navigate, this),

                     * sort order value
                     * 'sort order value' < 10: step displays before shipping step;
                     * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                     * 'sort order value' > 20 : step displays after payment step

                return this;

            onSubmit: function () {
                // trigger form validation
                this.source.set('params.invalid', false);

                if (!this.source.get('params.invalid')) {
                    // data is retrieved from data provider by value of the customScope property
                    var formData = this.source.get('additionalOrderInfoForm');
                    // do something with form data

                } else {
                    return false;

            validateForm: function (form) {
                return $(form).validation();

             * The navigate() method is responsible for navigation between checkout step
             * during checkout. You can add custom logic, for example some conditions
             * for switching to your custom step
            navigate: function () {
                var self = this;

             * @returns void
            navigateToNextStep: function () {

What my end-goal is for this is to save the contents of the fields in the database against the order. There are a lot of similar questions out there but they all refer to extending the shipping/payment sections, not using a custom section.

My idea was to write a plugin or observer to listen for the saving of the order but if my data is not being sent with the checkout, this won't be possible.

Another idea of mine was to add and Ajax call in the JS above and use a controller to set the data in the DB.

Can someone please let me know what I have to do to achieve this. And whether I am on the right track. I am on a pretty tight deadline with this project so really need to get this working ASAP. Thanks in advance.

Using Magento version 2.1.5

  • Someone must have some insight into this! Really need this sorted and this is my last hope!
    – Wildcard27
    May 5, 2017 at 3:17

1 Answer 1


You have to use event observer method approach to save data before placed order.

As you said you have already made sales_order table field for custom form.

Just use sales_model_service_quote_submit_before to save data inside table.

Inside observer you can get post data of your custom form and save inside table.

  • Thanks for your answer. Unfortunately this didn't work. I tried logging $this->request->getParams() after injecting Magento\Framework\App\RequestInterface and $observer->getEvent()->getRequest(); but both return nothing.
    – Wildcard27
    May 7, 2017 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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