requiredVatIdField example

$definition->addSub('shippingAddress', $this->getCreateAddressValidationDefinition($data$shippingAccountType$shippingAddress$context));
        }

        $billingAddress = $addressData->all();

        if ($data->get('vatIds') instanceof DataBag) {
            $vatIds = array_filter($data->get('vatIds')->all());
            $data->set('vatIds', $vatIds);
        }

        if ($accountType === CustomerEntity::ACCOUNT_TYPE_BUSINESS && $data->get('vatIds') !== null) {
            if ($this->requiredVatIdField($billingAddress['countryId']$context)) {
                $definition->add('vatIds', new NotBlank());
            }

            $definition->add('vatIds', new Type('array')new CustomerVatIdentification(
                ['countryId' => $billingAddress['countryId']]
            ));
        }

        if ($this->systemConfigService->get('core.loginRegistration.requireDataProtectionCheckbox', $context->getSalesChannelId())) {
            $definition->add('acceptedDataProtection', new NotBlank());
        }

        
Home | Imprint | This part of the site doesn't use cookies.