Hide Prices / Customer Approval
Posted: Thu Apr 17, 2008 10:24 pm
You will need to make the following change to the function index() in catalog\controller\account_create.php so that the address entered is linked correctly to the customer account. Some surrounding code is shown to help with location
Code: Select all
if (($request->isPost()) && ($this->validate())) {
$sql = "insert into customer set firstname = '?', lastname = '?', email = '?', telephone = '?', fax = '?', password = '?', newsletter = '?', status = '0', date_added = now()";
$database->query($database->parse($sql, $request->get('firstname', 'post'), $request->get('lastname', 'post'), $request->get('email', 'post'), $request->get('telephone', 'post'), $request->get('fax', 'post'), md5($request->get('password', 'post')), $request->get('newsletter', 'post')));
$customerId = (int)$database->getLastId();
/* $customer->login($request->get('email', 'post'), $request->get('password', 'post'));
*/
$sql = "insert into address set customer_id = '?', firstname = '?', lastname = '?', company = '?', address_1 = '?', address_2 = '?', city = '?', postcode = '?', country_id = '?', zone_id = '?'";
$database->query($database->parse($sql, $customerId(), $request->get('firstname', 'post'), $request->get('lastname', 'post'), $request->get('company', 'post'), $request->get('address_1', 'post'), $request->get('address_2', 'post'), $request->get('city', 'post'), $request->get('postcode', 'post'), $request->get('country_id', 'post'), $request->get('zone_id', 'post')));
$database->query("update customer set address_id = '" . (int)$database->getLastId() . "' where customer_id = '" . $customerId . "'");
$mail = $this->locator->create('mail');