0

i have created custom field on checkout billing address and it is showing perfect and i also add required field valdation but it is not working.

someone help me with this please.

i have add below code using layout processor

$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                    ['payment']['children']['payments-list']['children'][$paymentGroup]['children']['form-fields']['children']['customfield'] = [
                        'component' => 'Magento_Ui/js/form/element/abstract',
                        'config' => [
                            'customScope' => 'billingAddress',
                            'template' => 'ui/form/field',
                            'elementTmpl' => 'ui/form/element/input',
                            'id' => 'customfield'
                        ],
                        'dataScope' => $groupConfig['dataScopePrefix'].'.customfield',
                        'label' => __('Custom'),
                        'provider' => 'checkoutProvider',
                        'visible' => true,
                        'validation' => ['required-entry' => true],
                        'sortOrder' => 75,
                        'id' => 'custom-field',
                      
                    ];

1 Answer 1

0

Kindly refer following link from dev docs

Use billingAddress instead shippingAddress and use 'billing-step' instead of 'shipping-step' Hopefully it will work .

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.