0

I am using magento 2.3.5 and require to change the shipping address and billing address field input during checkout, what I required to do is

  1. change addresses input field label as per desired

enter image description here

  1. change street address input type from text input to textarea input
  2. reposition all input using sequence as below
  • Full Name
  • Contact Number
  • Postal Code
  • State ( Dropdownlist )
  • City ( Dropdownlist )
  • Full Address ( text area )
  1. combine first name and last name to become one input which is full name

I already able to do the no 1 which is changing the label through adding the wording list here

app/design/frontend/MageBig/martfury/layout01/i18n/en_US.csv

I am also able to do some of the part in no 3 which is by modifying the code at here

app/code/SR/ModifiedCheckout/Plugin/Block/LayoutProcessor.php

even though some of the input are able to reposition using orderBy it does not reflect to all field such as street address

I also am having a hard time to accomplish the no 2, I tried creating this file

app/code/SR/ModifiedCheckout/view/frontend/web/template/billing-address/form.html

and fill in using content which I get from its vendor

vendor/magento/module-checkout/view/frontend/web/template/billing-address/form.html

and modify as necessary so that it becomes as below

<div class="billing-address-form" data-bind="fadeVisible: isAddressFormVisible">
    <div class="step-title" data-bind="i18n: 'Billing Address'" data-role="title"></div>
    <!-- ko foreach: getRegion('before-fields') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
    <!--/ko-->
    <fieldset id="billing-new-address-form" class="fieldset address">
        <!-- ko foreach: getRegion('additional-fieldsets') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <!-- ko if: (isCustomerLoggedIn) -->
            <div class="field save-address">
                <input type="checkbox" class="checkbox" id="billing-save-in-address-book"
                       data-bind="checked: saveInAddressBook" />
                <label class="label" for="billing-save-in-address-book">
                    <span data-bind="i18n: 'Save in address book'"></span>
                </label>
            </div>
        <!-- /ko -->
    </fieldset>
</div>

if I were to change the id or class I am able to see it is reflected into the billing address form

but I don't understand how this code behave and how do I add in codes to edit the street address input field

Kindly help

1 Answer 1

1

I would suggest, this is a long requirement, so you have to work try and run. Please review the below reference link which will help you to achieve your task.

https://inchoo.net/magento-2/frontend/reorder-input-fields-shipping-billing-step-magento-2/

Magento 2: change shipping address form fields order

https://stackoverflow.com/questions/43783831/checkout-page-shipping-address-form-edit-magento2/45455426

https://www.fmeextensions.com/blog/add-custom-field-magento-2-shipping-address/

I hope this will help.

Please let me know if you are facing any specific issues. Thanks

1
  • Hi thank you, I am finally able to change all the input field label and make sure the ordering is correct, now the problem I am facing is part in which I need to modify the State text input field to Dropdownlist input field, and also the Full Address text input field to Textarea input field Sep 22, 2021 at 2:25

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.