Place the CPF field on the checkout in Magento 2

0

Does anyone know how to put the CPF field in the Magento2 checkout? There are several tips out there on how to put in previous versions of Magento, but I have not found anywhere how to do this in the new version (I am currently in 2.2.3).

I was able to put the field using LayoutProcessor, like this:

    $shippingFields['taxvat'] = [
        'component' => 'Magento_Ui/js/form/element/abstract',
        'label' => __('CPF'),
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/input',
        ],
        'placeholder' => 'CPF *',
        'validation' => [
            'required-entry' => 1
        ],
        'provider' => 'checkoutProvider',
        'source' => 'customer.taxvat',
        'dataScope' => 'customer.taxvat',
        'sortOrder' => 1,
    ];

But it is not saving in the database.

Does anyone know how to do it?

Thank you!

    
asked by anonymous 29.03.2018 / 06:47

0 answers