Zend certified PHP/Magento developer

how to override elementTmpl for billing address fields properly in checkout_index_index.xml?

I would like to change the way the company field is rendering in the billing address and I’m trying to apply a new elementTmpl which I’ve defined and works well for shipping address fields.

Here’s the xml


<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Vendor_Module::js/invoice-dependencies.js"/>
</head>
<body>
<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="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="shipping-address-fieldset" xsi:type="array">
<item name="children" xsi:type="array">
<item name="vat_id" xsi:type="array">
<item name="config" xsi:type="array">
<item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/input</item>
</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
<item name="company" xsi:type="array">
<item name="config" xsi:type="array">
<item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/input</item>
</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
<item name="io_occupation" xsi:type="array">
<item name="config" xsi:type="array">
<item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/input</item>
</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
<item name="io_tax_department" xsi:type="array">
<item name="config" xsi:type="array">
<item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/input</item>
</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</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="billing-address-form" xsi:type="array">
<item name="children" xsi:type="array">
<item name="form-fields" xsi:type="array">
<item name="children" xsi:type="array">                                                                             
<item name="company" xsi:type="array">
<item name="config" xsi:type="array">
<item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/input</item>
</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>

However, I’m receiving an error just by inserting the new elementTmpl value even if I don’t modify the original template.


Uncaught Error: Unable to process binding "ifnot: function(){return element.hasAddons() }"
Message: Unable to process binding "template: function(){return element.elementTmpl }"
Message: Anonymous template defined, but no template content was provided
init /el_GR/knockoutjs/knockout.js:6092
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3730
ignore /el_GR/knockoutjs/knockout.js:1563
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3729
arrayForEach /el_GR/knockoutjs/knockout.js:168
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3715
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3573
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToDescendants /el_GR/knockoutjs/knockout.js:3789
init /el_GR/knockoutjs/knockout.js:4857
evaluateImmediate_CallReadThenEndDependencyDetection /el_GR/knockoutjs/knockout.js:2331
evaluateImmediate_CallReadWithDependencyDetection /el_GR/knockoutjs/knockout.js:2288
evaluateImmediate /el_GR/knockoutjs/knockout.js:2253
dependentObservable /el_GR/knockoutjs/knockout.js:2085
init /el_GR/knockoutjs/knockout.js:4819
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3730
ignore /el_GR/knockoutjs/knockout.js:1563
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3729
arrayForEach /el_GR/knockoutjs/knockout.js:168
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3715
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3573
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3576
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3576
applyBindings /el_GR/knockoutjs/knockout.js:3807
_super /el_GR/mage/utils/wrapper.js:73
applyBindings /el_GR/Magento_Ui/js/lib/knockout/extender/bound-nodes.js:119
wrap /el_GR/mage/utils/wrapper.js:78
activateBindingsOnContinuousNodeArray /el_GR/knockoutjs/knockout.js:5870
invokeForEachNodeInContinuousRange /el_GR/knockoutjs/knockout.js:5821
activateBindingsOnContinuousNodeArray /el_GR/knockoutjs/knockout.js:5868
executeTemplate /el_GR/knockoutjs/knockout.js:5916
renderTemplate /el_GR/knockoutjs/knockout.js:5962
evaluateImmediate_CallReadThenEndDependencyDetection /el_GR/knockoutjs/knockout.js:2331
evaluateImmediate_CallReadWithDependencyDetection /el_GR/knockoutjs/knockout.js:2288
evaluateImmediate /el_GR/knockoutjs/knockout.js:2253
evaluatePossiblyAsync /el_GR/knockoutjs/knockout.js:2218
notifySubscribers /el_GR/knockoutjs/knockout.js:1401
valueHasMutated /el_GR/knockoutjs/knockout.js:1645
observable /el_GR/knockoutjs/knockout.js:1609
makeTemplateSource /el_GR/Magento_Ui/js/lib/knockout/template/engine.js:197
jQuery 7
loadFromFile /el_GR/Magento_Ui/js/lib/knockout/template/loader.js:102
execCb /el_GR/requirejs/require.js:1650
execCb /el_GR/mage/requirejs/resolver.js:156
check /el_GR/requirejs/require.js:866
enable /el_GR/requirejs/require.js:1113
bind /el_GR/requirejs/require.js:132
emit /el_GR/requirejs/require.js:1156
each /el_GR/requirejs/require.js:57
emit /el_GR/requirejs/require.js:1155
check /el_GR/requirejs/require.js:917
enable /el_GR/requirejs/require.js:1143
init /el_GR/requirejs/require.js:774
load /el_GR/requirejs/require.js:991
bind /el_GR/requirejs/require.js:132
loadContent /el_GR/mage/requirejs/text.js:155
onreadystatechange /el_GR/mage/requirejs/text.js:122
knockout.js:6092:39
init /el_GR/knockoutjs/knockout.js:6092
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3730
ignore /el_GR/knockoutjs/knockout.js:1563
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3729
arrayForEach /el_GR/knockoutjs/knockout.js:168
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3715
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3573
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToDescendants /el_GR/knockoutjs/knockout.js:3789
init /el_GR/knockoutjs/knockout.js:4857
evaluateImmediate_CallReadThenEndDependencyDetection /el_GR/knockoutjs/knockout.js:2331
evaluateImmediate_CallReadWithDependencyDetection /el_GR/knockoutjs/knockout.js:2288
evaluateImmediate /el_GR/knockoutjs/knockout.js:2253
dependentObservable /el_GR/knockoutjs/knockout.js:2085
init /el_GR/knockoutjs/knockout.js:4819
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3730
ignore /el_GR/knockoutjs/knockout.js:1563
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3729
arrayForEach /el_GR/knockoutjs/knockout.js:168
applyBindingsToNodeInternal /el_GR/knockoutjs/knockout.js:3715
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3573
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3576
applyBindingsToDescendantsInternal /el_GR/knockoutjs/knockout.js:3555
applyBindingsToNodeAndDescendantsInternal /el_GR/knockoutjs/knockout.js:3576
applyBindings /el_GR/knockoutjs/knockout.js:3807
_super /el_GR/mage/utils/wrapper.js:73
applyBindings /el_GR/Magento_Ui/js/lib/knockout/extender/bound-nodes.js:119
wrap /el_GR/mage/utils/wrapper.js:78
activateBindingsOnContinuousNodeArray /el_GR/knockoutjs/knockout.js:5870
invokeForEachNodeInContinuousRange /el_GR/knockoutjs/knockout.js:5821
activateBindingsOnContinuousNodeArray /el_GR/knockoutjs/knockout.js:5868
executeTemplate /el_GR/knockoutjs/knockout.js:5916
renderTemplate /el_GR/knockoutjs/knockout.js:5962
evaluateImmediate_CallReadThenEndDependencyDetection /el_GR/knockoutjs/knockout.js:2331
evaluateImmediate_CallReadWithDependencyDetection /el_GR/knockoutjs/knockout.js:2288
evaluateImmediate /el_GR/knockoutjs/knockout.js:2253
evaluatePossiblyAsync /el_GR/knockoutjs/knockout.js:2218
evaluatePossiblyAsync self-hosted:1178
notifySubscribers /el_GR/knockoutjs/knockout.js:1401
valueHasMutated /el_GR/knockoutjs/knockout.js:1645
observable /el_GR/knockoutjs/knockout.js:1609
makeTemplateSource /el_GR/Magento_Ui/js/lib/knockout/template/engine.js:197
jQuery 7
loadFromFile /el_GR/Magento_Ui/js/lib/knockout/template/loader.js:102
execCb /el_GR/requirejs/require.js:1650
execCb /el_GR/mage/requirejs/resolver.js:156
check /el_GR/requirejs/require.js:866
enable /el_GR/requirejs/require.js:1113
bind /el_GR/requirejs/require.js:132
emit /el_GR/requirejs/require.js:1156
each /el_GR/requirejs/require.js:57
emit /el_GR/requirejs/require.js:1155
check /el_GR/requirejs/require.js:917
enable /el_GR/requirejs/require.js:1143
init /el_GR/requirejs/require.js:774
load /el_GR/requirejs/require.js:991
bind /el_GR/requirejs/require.js:132
loadContent /el_GR/mage/requirejs/text.js:155
onreadystatechange /el_GR/mage/requirejs/text.js:122
openPromptSync resource://gre/modules/Prompter.jsm:1057
alert resource://gre/modules/Prompter.jsm:1329