I need to edit the city field HTML of New shipping address form on checkout
in Magento 2.
I am not getting the file from where we can change this or add some classes in these fields. Please share some idea to achieve this.
I need to edit the city field HTML of New shipping address form on checkout
in Magento 2.
I am not getting the file from where we can change this or add some classes in these fields. Please share some idea to achieve this.
Here is the path where you can edit city text field for New Shipping Address Form which was rendered form XML file:
app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
VendorNameSpace\Module\etc\di.xml
<type name="Magento\Checkout\Block\Checkout\AttributeMerger">
<plugin name="customAttributeMerger" type="VendorNameSpace\Module\Plugin\AttributeMergerPlugin"/>
</type>
AttributeMergerPlugin.php VendorNameSpace\Module\Plugin
<?php
namespace VendorNameSpace\Module\Plugin;
class AttributeMergerPlugin
{
public function afterMerge(\Magento\Checkout\Block\Checkout\AttributeMerger $subject, $result)
{
if (array_key_exists('city', $result)) {
$result['city']['additionalClasses'] = 'cusotom_city';
}
return $result;
}
}
Hope this will help you. thanks