I am trying to add gift option section on checkout page.

I called gift option by following code. in checkout_index_index.xml

<referenceContainer name="content">
        <block class="Magento\GiftMessage\Block\Cart\GiftOptions" name="checkout.cart.order.actions.gift_options" template="cart/gift_options.phtml" cacheable="false">
                    <argument name="jsLayout" xsi:type="array">
                        <item name="types" xsi:type="array"/>
                        <item name="components" xsi:type="array">
                            <item name="giftOptionsCart" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_GiftMessage/js/view/gift-message</item>
                                <item name="config" xsi:type="array">
                                    <item name="template" xsi:type="string">Magento_GiftMessage/gift-message</item>
                                    <item name="formTemplate" xsi:type="string">Magento_GiftMessage/gift-message-form</item>
                                <item name="sortOrder" xsi:type="string">1</item>

And it display in last. But I want this section in payment methods brfore payment selection like this. enter image description here

How can I achieve this.

  • is that your full checkout_index_index? – magefms Mar 28 at 7:44
  • Yes i override in my custom theme and contain only this code – Tirth Patel Mar 28 at 7:48

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.