I need to add a ID or Class in the zip code input field on checkout page, but I can't find where this element is rendered.
Any suggestion?
Thank's
The input is rendered with: magento/module-ui/view/frontend/web/templates/form/element/input.html
. While you could override it, it is used very broadly.
My recommendation is to specify a custom template. This would be done via the following approximate steps:
input.html
into a module under a similar directory view/frontend/web/templates/...
checkout_index_index.xml
and create a deep XML structure to target postcode
and specify an elementTmpl
. The last <item/>
s are: shippingAddress
> children
> shipping-address-fieldset
> children
> postcode
.<item name="postcode">
<item name="elementTmpl" xsi:type="string">MyCompany_MyModule/element/postcode</item>
</item>