Jump to content

Recommended Posts

Bonjour,

je cherche à rendre alias d’adresse est unique pour le client

c 'est à dire un client ne peux pas avoir deux alias égaux.

 

PS:1.7

 

cordialement,

Share this post


Link to post
Share on other sites

j'ai trouvé une solution :

ajouter ces lignes dans CustomerAddressForm.php

if ( $aliasField = $this->getField('alias')) {
			
			//$customer = $this->getCustomer();
			$coun = Address::aliasExist($aliasField->getValue(),1,$this->getField('id_customer')->getValue());
			if ($coun > 0) {
            $aliasField->addError(sprintf(
                $this->translator->trans(
                    'The alias "%s" has already been used. Please select another one', array(), 'Shop.Notifications.Error'
                ),
                $aliasField->getValue()
            ));
			 $is_valid = false;
        }
           
        }

il y a t il un override CustomerAddressFormCore ?

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More