Magento 2.2.5: Custom checkout The Next CEO of Stack OverflowMagento2 Checkout Customizationmagento 2 captcha not rendering if I override layout xmlMagento 2: New Checkout step – Shipping Method prices not showingmain.CRITICAL: Plugin class doesn't existMagento 2 knockout js in checkout pageMagento 2 add custom data to checkoutMagento 2: How to add custom css class in Checkout shipping address formMagento 2.2.5: Custom Checkout Place Order ErrorMagento 2.2.5: How to validate shipping addressMagento 2 override minicart.phtml in custom moduleRequire custom checkout field from extension

Why does C# sound extremely flat when saxophone is tuned to G?

Too much space between section and text in a twocolumn document

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

What is the difference between "behavior" and "behaviour"?

If I blow insulation everywhere in my attic except the door trap, will heat escape through it?

Why didn't Khan get resurrected in the Genesis Explosion?

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

How to write papers efficiently when English isn't my first language?

How to write the block matrix in LaTex?

Natural language into sentence logic

Why does standard notation not preserve intervals (visually)

How long to clear the 'suck zone' of a turbofan after start is initiated?

How to start emacs in "nothing" mode (`fundamental-mode`)

Is it okay to store user locations?

Why do professional authors make "consistency" mistakes? And how to avoid them?

Can I equip Skullclamp on a creature I am sacrificing?

What's the point of interval inversion?

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

How to use tikz in fbox?

How can I open an app using Terminal?

Rotate a column

If the heap is initialized for security, then why is the stack uninitialized?

Is a stroke of luck acceptable after a series of unfavorable events?

Inappropriate reference requests from Journal reviewers



Magento 2.2.5: Custom checkout



The Next CEO of Stack OverflowMagento2 Checkout Customizationmagento 2 captcha not rendering if I override layout xmlMagento 2: New Checkout step – Shipping Method prices not showingmain.CRITICAL: Plugin class doesn't existMagento 2 knockout js in checkout pageMagento 2 add custom data to checkoutMagento 2: How to add custom css class in Checkout shipping address formMagento 2.2.5: Custom Checkout Place Order ErrorMagento 2.2.5: How to validate shipping addressMagento 2 override minicart.phtml in custom moduleRequire custom checkout field from extension










0















I'm working on Custom Checkout Module.



I've Created a Custom module follow this devdocs:



https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html
and everything is working fine, but i cant use knockout js to render item using "displayArea" and "getRegion".



So here is what i've done:
enter image description here
As you can see, the "getRegion" part doesn't work. It doesn't render anything.



My code:




C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendlayoutcheckout_index_index.xml (this file i do exactly what the devdoc said, except for the "displayArea" named "delivery-fieldsets", because devdoc doesn't say anything about that, so i was trying to put it everywhere that i thing it may work, but still no luck).




<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<item name="before-shipping-method-form" xsi:type="array">
<item name="displayArea" xsi:type="string">delivery-fieldsets</item>
<item name="children" xsi:type="array">
<item name="delivery-group" xsi:type="array">
<item name="component" xsi:type="string">Aht_MagentoCheckoutCustom/js/view/custom-shipping</item>
<item name="children" xsi:type="array">
<item name="delivery_instruction" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
<item name="config" xsi:type="array">
<!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
<item name="customScope" xsi:type="string">shippingAddress</item>
<item name="template" xsi:type="string">ui/form/field</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
</item>
<!-- value element allows to specify default value of the form field -->
<!--<item name="value" xsi:type="string">Yout value here</item>-->
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="dataScope" xsi:type="string">shippingAddress.delivery_instruction</item>
<item name="label" xsi:type="string">Delivery Instruction:</item>
<item name="sortOrder" xsi:type="string">1</item>
</item>
<item name="delivery_type" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
<item name="config" xsi:type="array">
<!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
<item name="customScope" xsi:type="string">shippingAddress</item>
<item name="template" xsi:type="string">ui/form/field</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
</item>
<item name="options" xsi:type="array">
<item name="0" xsi:type="array">
<item name="label" xsi:type="string">Delivery Type 1</item>
<item name="value" xsi:type="string">delivery_type_1</item>
</item>
<item name="1" xsi:type="array">
<item name="label" xsi:type="string">Delivery Type 2</item>
<item name="value" xsi:type="string">delivery_type_2</item>
</item>
<item name="2" xsi:type="array">
<item name="label" xsi:type="string">Delivery Type 3</item>
<item name="value" xsi:type="string">delivery_type_3</item>
</item>
</item>
<!-- value element allows to specify default value of the form field -->
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="dataScope" xsi:type="string">shippingAddress.delivery_type</item>
<item name="label" xsi:type="string">Delivery Type:</item>
<item name="sortOrder" xsi:type="string">2</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>



C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebjsviewcustom-shipping.js




/**


* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

define([
'jquery',
'underscore',
'Magento_Ui/js/form/form',
'ko',
'Magento_Customer/js/model/customer',
'Magento_Customer/js/model/address-list',
'Magento_Checkout/js/model/address-converter',
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/action/create-shipping-address',
'Magento_Checkout/js/action/select-shipping-address',
'Magento_Checkout/js/model/shipping-rates-validator',
'Magento_Checkout/js/model/shipping-address/form-popup-state',
'Magento_Checkout/js/model/shipping-service',
'Magento_Checkout/js/action/select-shipping-method',
'Magento_Checkout/js/model/shipping-rate-registry',
'Magento_Checkout/js/action/set-shipping-information',
'Magento_Checkout/js/model/step-navigator',
'Magento_Ui/js/modal/modal',
'Magento_Checkout/js/model/checkout-data-resolver',
'Magento_Checkout/js/checkout-data',
'uiRegistry',
'mage/translate',
'Magento_Checkout/js/model/shipping-rate-service'
], function (
$,
_,
Component,
ko,
customer,
addressList,
addressConverter,
quote,
createShippingAddress,
selectShippingAddress,
shippingRatesValidator,
formPopUpState,
shippingService,
selectShippingMethodAction,
rateRegistry,
setShippingInformationAction,
stepNavigator,
modal,
checkoutDataResolver,
checkoutData,
registry,
$t
)
'use strict';

return Component.extend(
defaults:
template: 'Aht_MagentoCheckoutCustom/custom-shipping',
deliveryFormTemplate: 'Aht_MagentoCheckoutCustom/shipping-delivery/delivery-form'
,
visible: ko.observable(!quote.isVirtual()),
errorValidationMessage: ko.observable(false),
isCustomerLoggedIn: customer.isLoggedIn,
isFormPopUpVisible: formPopUpState.isVisible,
isFormInline: addressList().length === 0,
isNewAddressAdded: ko.observable(false),
saveInAddressBook: 1,
quoteIsVirtual: quote.isVirtual()
);
);



C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplatecustom-shipping.html




<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<!-- custom delivery-->

<li id="delivery" class="checkout-shipping-delivery" data-bind="fadeVisible: visible()">
<div class="step-title" translate="'Delivery'" data-role="title" />
<div id="checkout-step-delivery"
class="step-content"
data-role="content">

<!-- Inline address form -->
<render args="deliveryFormTemplate" />
</div>
</li>



C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplateshipping-deliverydelivery-form.html (it goes to this file succesfully, but some how, it stopped at the "getRegion" part and i dont know why.)




<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<!-- delivery-fieldsets -->
<!-- before-shipping-method-form -->

<form class="form form-shipping-delivery" id="co-shipping-delivery-form" data-bind="attr: 'data-hasrequired': $t('* Required Fields')">
<div id="shipping-delivery" class="fieldset delivery">
<!-- ko foreach: getRegion('delivery-fieldsets') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
</form>


Here's what i've read (its all good post tho :D ):
https://stackoverflow.com/questions/40847615/magento2-knockout-render-specific-child



Magento2 Checkout Customization










share|improve this question




























    0















    I'm working on Custom Checkout Module.



    I've Created a Custom module follow this devdocs:



    https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html
    and everything is working fine, but i cant use knockout js to render item using "displayArea" and "getRegion".



    So here is what i've done:
    enter image description here
    As you can see, the "getRegion" part doesn't work. It doesn't render anything.



    My code:




    C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendlayoutcheckout_index_index.xml (this file i do exactly what the devdoc said, except for the "displayArea" named "delivery-fieldsets", because devdoc doesn't say anything about that, so i was trying to put it everywhere that i thing it may work, but still no luck).




    <?xml version="1.0"?>
    <!--
    /**
    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */
    -->
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="checkout.root">
    <arguments>
    <argument name="jsLayout" xsi:type="array">
    <item name="components" xsi:type="array">
    <item name="checkout" xsi:type="array">
    <item name="children" xsi:type="array">
    <item name="steps" xsi:type="array">
    <item name="children" xsi:type="array">
    <item name="shipping-step" xsi:type="array">
    <item name="children" xsi:type="array">
    <item name="shippingAddress" xsi:type="array">
    <item name="children" xsi:type="array">
    <item name="before-shipping-method-form" xsi:type="array">
    <item name="displayArea" xsi:type="string">delivery-fieldsets</item>
    <item name="children" xsi:type="array">
    <item name="delivery-group" xsi:type="array">
    <item name="component" xsi:type="string">Aht_MagentoCheckoutCustom/js/view/custom-shipping</item>
    <item name="children" xsi:type="array">
    <item name="delivery_instruction" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
    <item name="config" xsi:type="array">
    <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
    <item name="customScope" xsi:type="string">shippingAddress</item>
    <item name="template" xsi:type="string">ui/form/field</item>
    <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
    </item>
    <!-- value element allows to specify default value of the form field -->
    <!--<item name="value" xsi:type="string">Yout value here</item>-->
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="dataScope" xsi:type="string">shippingAddress.delivery_instruction</item>
    <item name="label" xsi:type="string">Delivery Instruction:</item>
    <item name="sortOrder" xsi:type="string">1</item>
    </item>
    <item name="delivery_type" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
    <item name="config" xsi:type="array">
    <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
    <item name="customScope" xsi:type="string">shippingAddress</item>
    <item name="template" xsi:type="string">ui/form/field</item>
    <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
    </item>
    <item name="options" xsi:type="array">
    <item name="0" xsi:type="array">
    <item name="label" xsi:type="string">Delivery Type 1</item>
    <item name="value" xsi:type="string">delivery_type_1</item>
    </item>
    <item name="1" xsi:type="array">
    <item name="label" xsi:type="string">Delivery Type 2</item>
    <item name="value" xsi:type="string">delivery_type_2</item>
    </item>
    <item name="2" xsi:type="array">
    <item name="label" xsi:type="string">Delivery Type 3</item>
    <item name="value" xsi:type="string">delivery_type_3</item>
    </item>
    </item>
    <!-- value element allows to specify default value of the form field -->
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="dataScope" xsi:type="string">shippingAddress.delivery_type</item>
    <item name="label" xsi:type="string">Delivery Type:</item>
    <item name="sortOrder" xsi:type="string">2</item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </item>
    </argument>
    </arguments>
    </referenceBlock>
    </body>
    </page>



    C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebjsviewcustom-shipping.js




    /**


    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */

    define([
    'jquery',
    'underscore',
    'Magento_Ui/js/form/form',
    'ko',
    'Magento_Customer/js/model/customer',
    'Magento_Customer/js/model/address-list',
    'Magento_Checkout/js/model/address-converter',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/create-shipping-address',
    'Magento_Checkout/js/action/select-shipping-address',
    'Magento_Checkout/js/model/shipping-rates-validator',
    'Magento_Checkout/js/model/shipping-address/form-popup-state',
    'Magento_Checkout/js/model/shipping-service',
    'Magento_Checkout/js/action/select-shipping-method',
    'Magento_Checkout/js/model/shipping-rate-registry',
    'Magento_Checkout/js/action/set-shipping-information',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Ui/js/modal/modal',
    'Magento_Checkout/js/model/checkout-data-resolver',
    'Magento_Checkout/js/checkout-data',
    'uiRegistry',
    'mage/translate',
    'Magento_Checkout/js/model/shipping-rate-service'
    ], function (
    $,
    _,
    Component,
    ko,
    customer,
    addressList,
    addressConverter,
    quote,
    createShippingAddress,
    selectShippingAddress,
    shippingRatesValidator,
    formPopUpState,
    shippingService,
    selectShippingMethodAction,
    rateRegistry,
    setShippingInformationAction,
    stepNavigator,
    modal,
    checkoutDataResolver,
    checkoutData,
    registry,
    $t
    )
    'use strict';

    return Component.extend(
    defaults:
    template: 'Aht_MagentoCheckoutCustom/custom-shipping',
    deliveryFormTemplate: 'Aht_MagentoCheckoutCustom/shipping-delivery/delivery-form'
    ,
    visible: ko.observable(!quote.isVirtual()),
    errorValidationMessage: ko.observable(false),
    isCustomerLoggedIn: customer.isLoggedIn,
    isFormPopUpVisible: formPopUpState.isVisible,
    isFormInline: addressList().length === 0,
    isNewAddressAdded: ko.observable(false),
    saveInAddressBook: 1,
    quoteIsVirtual: quote.isVirtual()
    );
    );



    C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplatecustom-shipping.html




    <!--
    /**
    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */
    -->

    <!-- custom delivery-->

    <li id="delivery" class="checkout-shipping-delivery" data-bind="fadeVisible: visible()">
    <div class="step-title" translate="'Delivery'" data-role="title" />
    <div id="checkout-step-delivery"
    class="step-content"
    data-role="content">

    <!-- Inline address form -->
    <render args="deliveryFormTemplate" />
    </div>
    </li>



    C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplateshipping-deliverydelivery-form.html (it goes to this file succesfully, but some how, it stopped at the "getRegion" part and i dont know why.)




    <!--
    /**
    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */
    -->

    <!-- delivery-fieldsets -->
    <!-- before-shipping-method-form -->

    <form class="form form-shipping-delivery" id="co-shipping-delivery-form" data-bind="attr: 'data-hasrequired': $t('* Required Fields')">
    <div id="shipping-delivery" class="fieldset delivery">
    <!-- ko foreach: getRegion('delivery-fieldsets') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
    <!--/ko-->
    </div>
    </form>


    Here's what i've read (its all good post tho :D ):
    https://stackoverflow.com/questions/40847615/magento2-knockout-render-specific-child



    Magento2 Checkout Customization










    share|improve this question


























      0












      0








      0








      I'm working on Custom Checkout Module.



      I've Created a Custom module follow this devdocs:



      https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html
      and everything is working fine, but i cant use knockout js to render item using "displayArea" and "getRegion".



      So here is what i've done:
      enter image description here
      As you can see, the "getRegion" part doesn't work. It doesn't render anything.



      My code:




      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendlayoutcheckout_index_index.xml (this file i do exactly what the devdoc said, except for the "displayArea" named "delivery-fieldsets", because devdoc doesn't say anything about that, so i was trying to put it everywhere that i thing it may work, but still no luck).




      <?xml version="1.0"?>
      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <body>
      <referenceBlock name="checkout.root">
      <arguments>
      <argument name="jsLayout" xsi:type="array">
      <item name="components" xsi:type="array">
      <item name="checkout" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="steps" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="shipping-step" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="shippingAddress" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="before-shipping-method-form" xsi:type="array">
      <item name="displayArea" xsi:type="string">delivery-fieldsets</item>
      <item name="children" xsi:type="array">
      <item name="delivery-group" xsi:type="array">
      <item name="component" xsi:type="string">Aht_MagentoCheckoutCustom/js/view/custom-shipping</item>
      <item name="children" xsi:type="array">
      <item name="delivery_instruction" xsi:type="array">
      <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
      <item name="config" xsi:type="array">
      <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
      <item name="customScope" xsi:type="string">shippingAddress</item>
      <item name="template" xsi:type="string">ui/form/field</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
      </item>
      <!-- value element allows to specify default value of the form field -->
      <!--<item name="value" xsi:type="string">Yout value here</item>-->
      <item name="provider" xsi:type="string">checkoutProvider</item>
      <item name="dataScope" xsi:type="string">shippingAddress.delivery_instruction</item>
      <item name="label" xsi:type="string">Delivery Instruction:</item>
      <item name="sortOrder" xsi:type="string">1</item>
      </item>
      <item name="delivery_type" xsi:type="array">
      <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
      <item name="config" xsi:type="array">
      <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
      <item name="customScope" xsi:type="string">shippingAddress</item>
      <item name="template" xsi:type="string">ui/form/field</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
      </item>
      <item name="options" xsi:type="array">
      <item name="0" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 1</item>
      <item name="value" xsi:type="string">delivery_type_1</item>
      </item>
      <item name="1" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 2</item>
      <item name="value" xsi:type="string">delivery_type_2</item>
      </item>
      <item name="2" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 3</item>
      <item name="value" xsi:type="string">delivery_type_3</item>
      </item>
      </item>
      <!-- value element allows to specify default value of the form field -->
      <item name="provider" xsi:type="string">checkoutProvider</item>
      <item name="dataScope" xsi:type="string">shippingAddress.delivery_type</item>
      <item name="label" xsi:type="string">Delivery Type:</item>
      <item name="sortOrder" xsi:type="string">2</item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </argument>
      </arguments>
      </referenceBlock>
      </body>
      </page>



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebjsviewcustom-shipping.js




      /**


      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */

      define([
      'jquery',
      'underscore',
      'Magento_Ui/js/form/form',
      'ko',
      'Magento_Customer/js/model/customer',
      'Magento_Customer/js/model/address-list',
      'Magento_Checkout/js/model/address-converter',
      'Magento_Checkout/js/model/quote',
      'Magento_Checkout/js/action/create-shipping-address',
      'Magento_Checkout/js/action/select-shipping-address',
      'Magento_Checkout/js/model/shipping-rates-validator',
      'Magento_Checkout/js/model/shipping-address/form-popup-state',
      'Magento_Checkout/js/model/shipping-service',
      'Magento_Checkout/js/action/select-shipping-method',
      'Magento_Checkout/js/model/shipping-rate-registry',
      'Magento_Checkout/js/action/set-shipping-information',
      'Magento_Checkout/js/model/step-navigator',
      'Magento_Ui/js/modal/modal',
      'Magento_Checkout/js/model/checkout-data-resolver',
      'Magento_Checkout/js/checkout-data',
      'uiRegistry',
      'mage/translate',
      'Magento_Checkout/js/model/shipping-rate-service'
      ], function (
      $,
      _,
      Component,
      ko,
      customer,
      addressList,
      addressConverter,
      quote,
      createShippingAddress,
      selectShippingAddress,
      shippingRatesValidator,
      formPopUpState,
      shippingService,
      selectShippingMethodAction,
      rateRegistry,
      setShippingInformationAction,
      stepNavigator,
      modal,
      checkoutDataResolver,
      checkoutData,
      registry,
      $t
      )
      'use strict';

      return Component.extend(
      defaults:
      template: 'Aht_MagentoCheckoutCustom/custom-shipping',
      deliveryFormTemplate: 'Aht_MagentoCheckoutCustom/shipping-delivery/delivery-form'
      ,
      visible: ko.observable(!quote.isVirtual()),
      errorValidationMessage: ko.observable(false),
      isCustomerLoggedIn: customer.isLoggedIn,
      isFormPopUpVisible: formPopUpState.isVisible,
      isFormInline: addressList().length === 0,
      isNewAddressAdded: ko.observable(false),
      saveInAddressBook: 1,
      quoteIsVirtual: quote.isVirtual()
      );
      );



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplatecustom-shipping.html




      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->

      <!-- custom delivery-->

      <li id="delivery" class="checkout-shipping-delivery" data-bind="fadeVisible: visible()">
      <div class="step-title" translate="'Delivery'" data-role="title" />
      <div id="checkout-step-delivery"
      class="step-content"
      data-role="content">

      <!-- Inline address form -->
      <render args="deliveryFormTemplate" />
      </div>
      </li>



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplateshipping-deliverydelivery-form.html (it goes to this file succesfully, but some how, it stopped at the "getRegion" part and i dont know why.)




      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->

      <!-- delivery-fieldsets -->
      <!-- before-shipping-method-form -->

      <form class="form form-shipping-delivery" id="co-shipping-delivery-form" data-bind="attr: 'data-hasrequired': $t('* Required Fields')">
      <div id="shipping-delivery" class="fieldset delivery">
      <!-- ko foreach: getRegion('delivery-fieldsets') -->
      <!-- ko template: getTemplate() --><!-- /ko -->
      <!--/ko-->
      </div>
      </form>


      Here's what i've read (its all good post tho :D ):
      https://stackoverflow.com/questions/40847615/magento2-knockout-render-specific-child



      Magento2 Checkout Customization










      share|improve this question
















      I'm working on Custom Checkout Module.



      I've Created a Custom module follow this devdocs:



      https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_customize.html
      and everything is working fine, but i cant use knockout js to render item using "displayArea" and "getRegion".



      So here is what i've done:
      enter image description here
      As you can see, the "getRegion" part doesn't work. It doesn't render anything.



      My code:




      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendlayoutcheckout_index_index.xml (this file i do exactly what the devdoc said, except for the "displayArea" named "delivery-fieldsets", because devdoc doesn't say anything about that, so i was trying to put it everywhere that i thing it may work, but still no luck).




      <?xml version="1.0"?>
      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <body>
      <referenceBlock name="checkout.root">
      <arguments>
      <argument name="jsLayout" xsi:type="array">
      <item name="components" xsi:type="array">
      <item name="checkout" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="steps" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="shipping-step" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="shippingAddress" xsi:type="array">
      <item name="children" xsi:type="array">
      <item name="before-shipping-method-form" xsi:type="array">
      <item name="displayArea" xsi:type="string">delivery-fieldsets</item>
      <item name="children" xsi:type="array">
      <item name="delivery-group" xsi:type="array">
      <item name="component" xsi:type="string">Aht_MagentoCheckoutCustom/js/view/custom-shipping</item>
      <item name="children" xsi:type="array">
      <item name="delivery_instruction" xsi:type="array">
      <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
      <item name="config" xsi:type="array">
      <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
      <item name="customScope" xsi:type="string">shippingAddress</item>
      <item name="template" xsi:type="string">ui/form/field</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
      </item>
      <!-- value element allows to specify default value of the form field -->
      <!--<item name="value" xsi:type="string">Yout value here</item>-->
      <item name="provider" xsi:type="string">checkoutProvider</item>
      <item name="dataScope" xsi:type="string">shippingAddress.delivery_instruction</item>
      <item name="label" xsi:type="string">Delivery Instruction:</item>
      <item name="sortOrder" xsi:type="string">1</item>
      </item>
      <item name="delivery_type" xsi:type="array">
      <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
      <item name="config" xsi:type="array">
      <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
      <item name="customScope" xsi:type="string">shippingAddress</item>
      <item name="template" xsi:type="string">ui/form/field</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
      </item>
      <item name="options" xsi:type="array">
      <item name="0" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 1</item>
      <item name="value" xsi:type="string">delivery_type_1</item>
      </item>
      <item name="1" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 2</item>
      <item name="value" xsi:type="string">delivery_type_2</item>
      </item>
      <item name="2" xsi:type="array">
      <item name="label" xsi:type="string">Delivery Type 3</item>
      <item name="value" xsi:type="string">delivery_type_3</item>
      </item>
      </item>
      <!-- value element allows to specify default value of the form field -->
      <item name="provider" xsi:type="string">checkoutProvider</item>
      <item name="dataScope" xsi:type="string">shippingAddress.delivery_type</item>
      <item name="label" xsi:type="string">Delivery Type:</item>
      <item name="sortOrder" xsi:type="string">2</item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </item>
      </argument>
      </arguments>
      </referenceBlock>
      </body>
      </page>



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebjsviewcustom-shipping.js




      /**


      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */

      define([
      'jquery',
      'underscore',
      'Magento_Ui/js/form/form',
      'ko',
      'Magento_Customer/js/model/customer',
      'Magento_Customer/js/model/address-list',
      'Magento_Checkout/js/model/address-converter',
      'Magento_Checkout/js/model/quote',
      'Magento_Checkout/js/action/create-shipping-address',
      'Magento_Checkout/js/action/select-shipping-address',
      'Magento_Checkout/js/model/shipping-rates-validator',
      'Magento_Checkout/js/model/shipping-address/form-popup-state',
      'Magento_Checkout/js/model/shipping-service',
      'Magento_Checkout/js/action/select-shipping-method',
      'Magento_Checkout/js/model/shipping-rate-registry',
      'Magento_Checkout/js/action/set-shipping-information',
      'Magento_Checkout/js/model/step-navigator',
      'Magento_Ui/js/modal/modal',
      'Magento_Checkout/js/model/checkout-data-resolver',
      'Magento_Checkout/js/checkout-data',
      'uiRegistry',
      'mage/translate',
      'Magento_Checkout/js/model/shipping-rate-service'
      ], function (
      $,
      _,
      Component,
      ko,
      customer,
      addressList,
      addressConverter,
      quote,
      createShippingAddress,
      selectShippingAddress,
      shippingRatesValidator,
      formPopUpState,
      shippingService,
      selectShippingMethodAction,
      rateRegistry,
      setShippingInformationAction,
      stepNavigator,
      modal,
      checkoutDataResolver,
      checkoutData,
      registry,
      $t
      )
      'use strict';

      return Component.extend(
      defaults:
      template: 'Aht_MagentoCheckoutCustom/custom-shipping',
      deliveryFormTemplate: 'Aht_MagentoCheckoutCustom/shipping-delivery/delivery-form'
      ,
      visible: ko.observable(!quote.isVirtual()),
      errorValidationMessage: ko.observable(false),
      isCustomerLoggedIn: customer.isLoggedIn,
      isFormPopUpVisible: formPopUpState.isVisible,
      isFormInline: addressList().length === 0,
      isNewAddressAdded: ko.observable(false),
      saveInAddressBook: 1,
      quoteIsVirtual: quote.isVirtual()
      );
      );



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplatecustom-shipping.html




      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->

      <!-- custom delivery-->

      <li id="delivery" class="checkout-shipping-delivery" data-bind="fadeVisible: visible()">
      <div class="step-title" translate="'Delivery'" data-role="title" />
      <div id="checkout-step-delivery"
      class="step-content"
      data-role="content">

      <!-- Inline address form -->
      <render args="deliveryFormTemplate" />
      </div>
      </li>



      C:xampphtdocsmagentoappcodeAhtMagentoCheckoutCustomviewfrontendwebtemplateshipping-deliverydelivery-form.html (it goes to this file succesfully, but some how, it stopped at the "getRegion" part and i dont know why.)




      <!--
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      -->

      <!-- delivery-fieldsets -->
      <!-- before-shipping-method-form -->

      <form class="form form-shipping-delivery" id="co-shipping-delivery-form" data-bind="attr: 'data-hasrequired': $t('* Required Fields')">
      <div id="shipping-delivery" class="fieldset delivery">
      <!-- ko foreach: getRegion('delivery-fieldsets') -->
      <!-- ko template: getTemplate() --><!-- /ko -->
      <!--/ko-->
      </div>
      </form>


      Here's what i've read (its all good post tho :D ):
      https://stackoverflow.com/questions/40847615/magento2-knockout-render-specific-child



      Magento2 Checkout Customization







      magento2 template knockoutjs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 19 mins ago









      Teja Bhagavan Kollepara

      3,01241949




      3,01241949










      asked Sep 11 '18 at 14:18









      fudufudu

      42311




      42311




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Okay so I was come to devdoc and read again, and i've realize that i've missing 1 step to create input, it need 2 step



          <item name="custom-checkout-form-container" xsi:type="array">
          <item name="component" xsi:type="string">%your_module_dir%/js/view/custom-checkout-form</item>
          <item name="provider" xsi:type="string">checkoutProvider</item>
          <item name="config" xsi:type="array">
          <item name="template" xsi:type="string">%your_module_dir%/custom-checkout-form</item>
          </item>
          <item name="children" xsi:type="array">
          <item name="custom-checkout-form-fieldset" xsi:type="array">
          <!-- uiComponent is used as a wrapper for form fields (its template will render all children as a list) -->
          <item name="component" xsi:type="string">uiComponent</item>
          <!-- the following display area is used in template (see below) -->
          <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
          <item name="children" xsi:type="array">
          //your item here


          As you can see, it require 2 step to make this work, 1 is "custom-checkout-form-container" and 2 is "custom-checkout-form-fieldset", but i only do 1, so that why it doesn't work. :)

          https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f241781%2fmagento-2-2-5-custom-checkout%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Okay so I was come to devdoc and read again, and i've realize that i've missing 1 step to create input, it need 2 step



            <item name="custom-checkout-form-container" xsi:type="array">
            <item name="component" xsi:type="string">%your_module_dir%/js/view/custom-checkout-form</item>
            <item name="provider" xsi:type="string">checkoutProvider</item>
            <item name="config" xsi:type="array">
            <item name="template" xsi:type="string">%your_module_dir%/custom-checkout-form</item>
            </item>
            <item name="children" xsi:type="array">
            <item name="custom-checkout-form-fieldset" xsi:type="array">
            <!-- uiComponent is used as a wrapper for form fields (its template will render all children as a list) -->
            <item name="component" xsi:type="string">uiComponent</item>
            <!-- the following display area is used in template (see below) -->
            <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
            <item name="children" xsi:type="array">
            //your item here


            As you can see, it require 2 step to make this work, 1 is "custom-checkout-form-container" and 2 is "custom-checkout-form-fieldset", but i only do 1, so that why it doesn't work. :)

            https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html






            share|improve this answer



























              0














              Okay so I was come to devdoc and read again, and i've realize that i've missing 1 step to create input, it need 2 step



              <item name="custom-checkout-form-container" xsi:type="array">
              <item name="component" xsi:type="string">%your_module_dir%/js/view/custom-checkout-form</item>
              <item name="provider" xsi:type="string">checkoutProvider</item>
              <item name="config" xsi:type="array">
              <item name="template" xsi:type="string">%your_module_dir%/custom-checkout-form</item>
              </item>
              <item name="children" xsi:type="array">
              <item name="custom-checkout-form-fieldset" xsi:type="array">
              <!-- uiComponent is used as a wrapper for form fields (its template will render all children as a list) -->
              <item name="component" xsi:type="string">uiComponent</item>
              <!-- the following display area is used in template (see below) -->
              <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
              <item name="children" xsi:type="array">
              //your item here


              As you can see, it require 2 step to make this work, 1 is "custom-checkout-form-container" and 2 is "custom-checkout-form-fieldset", but i only do 1, so that why it doesn't work. :)

              https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html






              share|improve this answer

























                0












                0








                0







                Okay so I was come to devdoc and read again, and i've realize that i've missing 1 step to create input, it need 2 step



                <item name="custom-checkout-form-container" xsi:type="array">
                <item name="component" xsi:type="string">%your_module_dir%/js/view/custom-checkout-form</item>
                <item name="provider" xsi:type="string">checkoutProvider</item>
                <item name="config" xsi:type="array">
                <item name="template" xsi:type="string">%your_module_dir%/custom-checkout-form</item>
                </item>
                <item name="children" xsi:type="array">
                <item name="custom-checkout-form-fieldset" xsi:type="array">
                <!-- uiComponent is used as a wrapper for form fields (its template will render all children as a list) -->
                <item name="component" xsi:type="string">uiComponent</item>
                <!-- the following display area is used in template (see below) -->
                <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
                <item name="children" xsi:type="array">
                //your item here


                As you can see, it require 2 step to make this work, 1 is "custom-checkout-form-container" and 2 is "custom-checkout-form-fieldset", but i only do 1, so that why it doesn't work. :)

                https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html






                share|improve this answer













                Okay so I was come to devdoc and read again, and i've realize that i've missing 1 step to create input, it need 2 step



                <item name="custom-checkout-form-container" xsi:type="array">
                <item name="component" xsi:type="string">%your_module_dir%/js/view/custom-checkout-form</item>
                <item name="provider" xsi:type="string">checkoutProvider</item>
                <item name="config" xsi:type="array">
                <item name="template" xsi:type="string">%your_module_dir%/custom-checkout-form</item>
                </item>
                <item name="children" xsi:type="array">
                <item name="custom-checkout-form-fieldset" xsi:type="array">
                <!-- uiComponent is used as a wrapper for form fields (its template will render all children as a list) -->
                <item name="component" xsi:type="string">uiComponent</item>
                <!-- the following display area is used in template (see below) -->
                <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
                <item name="children" xsi:type="array">
                //your item here


                As you can see, it require 2 step to make this work, 1 is "custom-checkout-form-container" and 2 is "custom-checkout-form-fieldset", but i only do 1, so that why it doesn't work. :)

                https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 13 '18 at 2:30









                fudufudu

                42311




                42311



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f241781%2fmagento-2-2-5-custom-checkout%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2

                    Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її