Question

In one page checkout i need to find html file for the address block. Please can someone help me with that. I want to put first name and last name together in a div.

Was it helpful?

Solution

You can override from

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

to

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

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div class="shipping-address-item" data-bind="css: isSelected() ? 'selected-item' : 'not-selected-item'">
    <!-- ko text: address().prefix --><!-- /ko --> 

    <div>
        <!-- ko text: address().firstname --><!-- /ko -->
        <!-- ko text: address().middlename --><!-- /ko -->
        <!-- ko text: address().lastname --><!-- /ko -->
    </div> 

    <!-- ko text: address().suffix --><!-- /ko --><br/>
    <!-- ko text: _.values(address().street).join(", ") --><!-- /ko --><br/>
    <!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>
    <!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/>
    <!-- ko if: (address().telephone) -->
    <a data-bind="text: address().telephone, attr: {'href': 'tel:' + address().telephone}"></a>
    <!-- /ko --><br/>
    <!-- ko foreach: { data: address().customAttributes, as: 'element' } -->
        <!-- ko foreach: { data: Object.keys(element), as: 'attribute' } -->
            <!-- ko if: (typeof element[attribute] === "object") -->
                <!-- ko text: element[attribute].value --><!-- /ko -->
            <!-- /ko -->
            <!-- ko if: (typeof element[attribute] === "string") -->
                <!-- ko text: element[attribute] --><!-- /ko -->
            <!-- /ko --><br/>
        <!-- /ko -->
    <!-- /ko -->
    <!-- ko if: (address().isEditable()) -->
    <button type="button"
            class="action edit-address-link"
            data-bind="click: editAddress, visible: address().isEditable()">
        <span data-bind="i18n: 'Edit'"></span>
    </button>
    <!-- /ko -->
    <button type="button" data-bind="click: selectAddress" class="action action-select-shipping-item">
        <span data-bind="i18n: 'Ship Here'"></span>
    </button>
</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top