How can I remove the name field from the new billing address field from Magento 2 checkout payment page?
I tried the below code which is not working.
I used a plugin for this class MagentoCheckoutBlockCheckoutLayoutProcessor
public function afterProcess(
LayoutProcessor $subject,
array $jsLayout
) {
$billingConfiguration = $jsLayout;
if (isset($billingConfiguration)) {
foreach ($billingConfiguration as $key => &$billingForm) {
if (!strpos($key, '-form')) {
continue;
}
if ($billingForm['children']['form-fields']['children']) {
unset($billingForm['children']['form-fields']['children']['name']);
}
}
}
return $billingConfiguration;
}