$error = true; $messageStack->add('create_store_account', ENTRY_PASSWORD_ERROR); } elseif ($password != $confirmation) { $error = true; $messageStack->add('create_store_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING); } if ($error == false) { if (!smn_session_is_registered('customer_id')) { //ADD THE STORE OWNER DATA .... $new_customer = new customer(); $new_customer->set_firstname($customer_first_name); $new_customer->set_lastname($lastname); $new_customer->set_email_address($email_address); $new_customer->set_telephone($telephone); $new_customer->set_fax($fax); $new_customer->set_newsletter($newsletter); $new_customer->set_password($password); $new_customer->set_gender($gender); $new_customer->set_dob($dob); $new_customer->set_street_address($street_address); $new_customer->set_postcode($postcode); $new_customer->set_city($city); $new_customer->set_country_id($customer_country_id); $new_customer->set_company($company); $new_customer->set_zone_id($customer_zone_id); $new_customer->set_state($state); $customer_id = $new_customer->create(); $customer_default_address_id = $new_customer->get_default_address(); smn_session_register('customer_id'); smn_session_register('customer_first_name'); smn_session_register('customer_default_address_id');
if ($error === false) { $customerInfo->set_firstname($customer_first_name); $customerInfo->set_lastname($lastname); $customerInfo->set_email_address($email_address); $customerInfo->set_dob($dob); $customerInfo->set_street_address($street_address); $customerInfo->set_postcode($postcode); $customerInfo->set_city($city); $customerInfo->set_country_id($customer_country_id); $customerInfo->set_company($company); $customerInfo->set_zone_id($customer_zone_id); $customerInfo->set_state($state); $customerInfo->set_telephone($telephone); $customerInfo->set_tollfree($tollfree); $customerInfo->set_fax($fax); $customerInfo->set_newsletter($newsletter); if (isset($_POST['affiliate_id'])) { $customerInfo->set_affiliate_id($_POST['affiliate_id']); } $customerInfo->create($customer_id); if (smn_session_is_registered('customer_store_id')) { $customerInfo->update_store_admin(); $customersStore->set_store_name($new_store_name); $customersStore->set_store_category($_POST['store_catagory']); $customersStore->set_store_description($_POST['store_description']); $customersStore->update_store_info(); $customersStore->put_store_category(); } echo '{success:true}'; } else { echo '{
$check_email = smn_db_fetch_array($check_email_query); if ($check_email['total'] > 0) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); } if (strlen($_POST['telephone']) < ENTRY_TELEPHONE_MIN_LENGTH) { $error = true; $messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR); } if ($error == false) { $profile_edit->set_firstname($_POST['firstname']); $profile_edit->set_lastname($_POST['lastname']); $profile_edit->set_email_address($_POST['email_address']); $profile_edit->set_telephone($_POST['telephone']); $profile_edit->set_fax($_POST['fax']); $profile_edit->set_newsletter($newsletter); $profile_edit->set_gender($_POST['customers_gender']); $profile_edit->set_dob($_POST['customers_dob']); $profile_edit->set_street_address($_POST['street_address']); $profile_edit->set_postcode($_POST['postcode']); $profile_edit->set_city($_POST['city']); $profile_edit->set_country_id($_POST['country']); $profile_edit->set_company($_POST['company']); if ($zone_id > 0) { $L_state = smn_get_zone_name($_POST['country'], $zone_id, ''); $profile_edit->set_zone_id($zone_id); $profile_edit->set_state($L_state); } else { $profile_edit->set_zone_id('0'); $profile_edit->set_state($_POST['state']); }