Jump to content

Automaticly set the vat_number field in address form


MARK-APP.com

Recommended Posts

Hi All,

I need some help to find/use the right hook in PrestaShop 1.7.6.

I want to automatically set the vat_number field for a new address in the checkout or creating a new address with a hook. Is this possible in PrestaShop 1.7.6?

I found the form in classes/form/CustomerAddressForm.php.

So I tried to set the field with the hook actionCustomerAddressFormBuilderModifier but it doesn't work.
 

public function hookActionCustomerAddressFormBuilderModifier(array $params)
    {
        /** @var FormBuilderInterface $formBuilder */
        $formBuilder = $params['form_builder'];
        
		$params['data']['vatnumber'] = $vatReference['vatnumber'];

        $formBuilder->setData($params['data']);
    }

All help is welcome.

Edited by MARK-APP.com
typo (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...