5

Installed Version of Magento is - 2.1.0

I have added a custom field "Bank Account Number" as you can see red square box in the below image.

enter image description here

The problem I am facing is that it's not getting displayed in the summary as shown in below image.

enter image description here

2
  • Do you need to add a field to customer address? Nov 15, 2016 at 14:38
  • 1
    @SergeyIvashchenko : I have updated my question . So let me know the possible solution here...Thanks !
    – user44966
    Nov 17, 2016 at 12:23

1 Answer 1

0

The next template is responsible for rendering this summary block:

module-checkout/view/frontend/web/template/shipping-address/address-renderer/default.html

How to override:

  1. From Theme. File located by following path will override mentioned template:

app/design/frontend/YourTheme/default/Magento_Checkout/web/template/shipping-address/address-renderer/default.html

  1. From Module. Using RequireJs configuration:

Create app/code/YourNamespace/YourModule/view/frontend/requirejs-config.js in the module that is dependent on Magento_Checkout (has Magento_Checkout in sequence in module.xml) with the following content:

var config = {
    map: {
        '*': {
            'Magento_Checkout/js/view/shipping-address/address-renderer/default': 'YourNamespace_YouModule/js/view/shipping-address/address-renderer/default'
        }
    }
};

And create corresponding template file in your module.

See more information about template customization in Magento 2 Frontend Development Guide

How to render address attribute:

Address attribute in this particular block should be rendered by knockout.js, here is the basic example of syntax to render the attribute string:

<!-- ko text: address().yourattribute --><!-- /ko -->

See more information about knockout.js rendering in Knockout.js documentation.

1
  • How to get value of this.address() in default.js file? In js file no address function is defined. please let me know hot this value is getting in above default.js file? Mar 27, 2017 at 13:16

Your Answer

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