Haithem.SL Posted September 28, 2013 Share Posted September 28, 2013 Bonjour , Je voulais savoir si quelqu'un pourrait m'aider à personnaliser un petit peu l'inscription des clients comme le montre l'exemple ci-dessous: Exemple: Lors de l'inscription , le client selectionne le type de son compte. Si Particulier == > Compte activé ( par défaut ) Si Pro ==> Compte désactivé ( par défaut ) Merci! Link to comment Share on other sites More sharing options...
Haithem.SL Posted September 29, 2013 Author Share Posted September 29, 2013 (edited) Bonjour , J'ai trouvé une soluton qui n'est pas encore parfaite. J'ai modifié le fichier AuthController.php (~ ligne 156) $customer->active = 1; par if($id_group == 2) $customer->active = 0; else $customer->active = 1; ça fonctionne, mais avec une erreur : An error occurred while creating your account. AuthController.php (~ ligne 162) if(!$customer->add(true, true, $id_group)) $this->errors[] = Tools::displayError('An error occurred while creating your account.'); Voici le code de la function "add" classes/Customers.php public function add($autodate = true, $nullValues = true, $id_group) { $this->birthday = (empty($this->years) ? $this->birthday : (int)($this->years).'-'.(int)($this->months).'-'.(int)($this->days)); $this->secure_key = md5(uniqid(rand(), true)); $this->last_passwd_gen = date('Y-m-d H:i:s', strtotime('-'.Configuration::get('PS_PASSWD_TIME_FRONT').'minutes')); if(!parent::add($autodate, $nullValues)) return false; $row = array('id_customer' => intval($this->id), 'id_group' => $id_group); $result = Db::getInstance()->ExecuteS('UPDATE '._DB_PREFIX_.'customer SET id_default_group = '.$id_group.' WHERE id_customer = '.intval($this->id)); $result = Db::getInstance()->AutoExecute(_DB_PREFIX_.'customer_group', array('id_customer' => intval($this->id), 'id_group' => 1), 'INSERT'); return Db::getInstance()->AutoExecute(_DB_PREFIX_.'customer_group', $row, 'INSERT'); } Edited September 29, 2013 by Haithem.SL (see edit history) 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