0

In the checkout there is a coupon block and a block with the order amount. I need to move them to my created block.

enter image description here

checkout_index_index

<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="progressBar" xsi:type="array">
                                <item name="config" xsi:type="array">
                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                </item>
                            </item>
                            <item name="estimation" xsi:type="array">
                                <item name="sortOrder" xsi:type="string">2</item>
                                <item name="config" xsi:type="array">
                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                </item>
                            </item>
                            <item name="sidebar" xsi:type="array">
                                <item name="displayArea" xsi:type="string">checkout-sidebar</item>
                                <item name="config" xsi:type="array">
                                    <item name="title" xsi:type="string" translate="true">My order</item>
                                </item>
                                <item name="children" xsi:type="array">
                                    <item name="summary" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="cart_items" xsi:type="array">
                                                <item name="sortOrder" xsi:type="string">1</item>
                                            </item>
                                            <item name="totals" xsi:type="array">
                                                <item name="displayArea" xsi:type="string">checkout-sidebar</item>
                                                <item name="sortOrder" xsi:type="string">100</item>

                                                <item name="children" xsi:type="array">
                                                    <item name="tax" xsi:type="array">
                                                        <item name="config" xsi:type="array">
                                                            <item name="componentDisabled" xsi:type="boolean">true</item>
                                                        </item>
                                                    </item>
                                                    <item name="shipping" xsi:type="array">
                                                        <item name="config" xsi:type="array">
                                                            <item name="notCalculatedValue" xsi:type="string" translate="true">100</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                    <item name="btn-next" xsi:type="array">
                                        <item name="component" xsi:type="string">Magento_Checkout/js/view/btn-next</item>
                                        <item name="displayArea" xsi:type="string">btn-next</item>
                                        <item name="config" xsi:type="array">
                                            <item name="template" xsi:type="string">Magento_Checkout/btn-next</item>
                                            <item name="target" xsi:type="string">stepShipping</item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                            <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="customer-email" xsi:type="array">
                                                        <item name="config" xsi:type="array">
                                                            <item name="componentDisabled" xsi:type="boolean">true</item>
                                                        </item>
                                                    </item>
                                                    <item name="shipping-address-fieldset" xsi:type="array">
                                                        <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-address/form-address</item>
                                                        <item name="children" xsi:type="array">
                                                            <item name="region_id" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                            <item name="region" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                            <item name="company" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="fax" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="country_id" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="telephone" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="city" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="firstname" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="lastname" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="postcode" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">200</item>
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/postcode-address</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="readonly" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                            <item name="label" xsi:type="array">
                                                                <item name="config" xsi:type="array">
                                                                    <item name="additionalClasses" xsi:type="string">form__row_label</item>
                                                                </item>
                                                            </item>
                                                            <item name="frame" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="construction" xsi:type="array">
                                                                <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="comment" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">250</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="additionalClasses" xsi:type="string">form__row_comment</item>
                                                                    <item name="maxlength" xsi:type="string">255</item>
                                                                </item>
                                                              <item name="visible" xsi:type="boolean">false</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                    <item name="shipping-address-contact" xsi:type="array">
                                                        <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-address/form-contact</item>
                                                        <item name="provider" xsi:type="string">checkoutProvider</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="deps" xsi:type="array">
                                                                <item name="0" xsi:type="string">checkoutProvider</item>
                                                            </item>
                                                        </item>
                                                        <item name="displayArea" xsi:type="string">address-contact</item>
                                                        <item name="children" xsi:type="array">
                                                            <item name="firstname" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
                                                                <item name="sortOrder" xsi:type="string">1</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                                <item name="dataScope" xsi:type="string">shippingAddress.firstname</item>
                                                                <item name="customScope" xsi:type="string">shippingAddress</item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                </item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">ui/form/field</item>
                                                                    <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
                                                                    <item name="label" xsi:type="string" translate="true">First Name</item>
                                                                </item>
                                                            </item>
                                                            <item name="lastname" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
                                                                <item name="sortOrder" xsi:type="string">2</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                                <item name="dataScope" xsi:type="string">shippingAddress.lastname</item>
                                                                <item name="customScope" xsi:type="string">shippingAddress</item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                </item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">ui/form/field</item>
                                                                    <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
                                                                    <item name="label" xsi:type="string" translate="true">Last Name</item>
                                                                </item>
                                                            </item>
                                                            <item name="telephone" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/phone</item>
                                                                <item name="sortOrder" xsi:type="string">3</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                                <item name="dataScope" xsi:type="string">shippingAddress.custom_attributes.telephone</item>
                                                                <item name="customScope" xsi:type="string">shippingAddress.custom_attributes</item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                </item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">ui/form/field</item>
                                                                    <item name="elementTmpl" xsi:type="string">ui/form/element/phone</item>
                                                                    <item name="label" xsi:type="string">Phone</item>
                                                                </item>
                                                            </item>
                                                            <item name="email" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Ui/js/form/element/email</item>
                                                                <item name="sortOrder" xsi:type="string">4</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                                <item name="dataScope" xsi:type="string">shippingAddress.email</item>
                                                                <item name="customScope" xsi:type="string">shippingAddress</item>
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                    <item name="validate-email" xsi:type="boolean">true</item>
                                                                </item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">ui/form/field</item>
                                                                    <item name="elementTmpl" xsi:type="string">ui/form/element/email</item>
                                                                    <item name="label" xsi:type="string">E-mail</item>
                                                                </item>
                                                            </item>
                                                           <!-- <item name="customer-email" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">4</item>
                                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/form/element/email</item>
                                                                <item name="displayArea" xsi:type="string">address-contact</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">Magento_Checkout/form/element/email</item>
                                                                    <item name="label" xsi:type="string">Email</item>
                                                                </item>
                                                            </item>-->
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="afterMethods" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="giftCardAccount" xsi:type="array">
                                                                <item name="config" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                            <item name="storeCredit" xsi:type="array">
                                                                <item name="config" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                    <item name="payments-list" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="order-totals" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/summary/totals</item>
                                                                <item name="displayArea" xsi:type="string">order-totals</item>
                                                                <item name="dataScope" xsi:type="string">order-totals</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                                <item name="config" xsi:type="array">
                                                                    <item name="template" xsi:type="string">Magento_Checkout/summary/totals</item>
                                                                </item>
                                                                <item name="children" xsi:type="array">
                                                                    <item name="subtotal" xsi:type="array">
                                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/subtotal</item>
                                                                        <item name="sortOrder" xsi:type="string">10</item>
                                                                        <item name="config" xsi:type="array">
                                                                            <item name="title" xsi:type="string" translate="true">Cart Subtotal</item>
                                                                        </item>
                                                                    </item>
                                                                    <item name="shipping" xsi:type="array">
                                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/shipping</item>
                                                                        <item name="sortOrder" xsi:type="string">30</item>
                                                                        <item name="config" xsi:type="array">
                                                                            <item name="title" xsi:type="string" translate="true">Shipping</item>
                                                                            <item name="notCalculatedMessage" xsi:type="string" translate="true">Not yet calculated</item>
                                                                            <item name="notCalculatedValue" xsi:type="string" translate="true">100</item>
                                                                        </item>
                                                                    </item>
                                                                    <item name="grand-total" xsi:type="array">
                                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
                                                                        <item name="sortOrder" xsi:type="string">40</item>
                                                                        <item name="config" xsi:type="array">
                                                                            <item name="title" xsi:type="string" translate="true">Order Total</item>
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                            <item name="checkout-final" xsi:type="array">
                                <item name="displayArea" xsi:type="string">checkout-final</item>
                                <item name="config" xsi:type="array">
                                    <item name="component" xsi:type="string">Magento_Checkout/js/final</item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
  • have you tried <referenceBlock move=.... /> ? – Philipp Sander Feb 7 at 8:34
  • 1
    coupon code block where to move on checkout – HIren Kadivar Feb 7 at 8:40

Your Answer

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

Browse other questions tagged or ask your own question.