NeedZoom Posted March 9, 2018 Share Posted March 9, 2018 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, Link to comment Share on other sites More sharing options...
NeedZoom Posted March 9, 2018 Author Share Posted March 9, 2018 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 ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now