Gemshop Posted May 14, 2007 Share Posted May 14, 2007 I'm trying to add two information fields to the reistration document. It is the weather the customer is a retailer and thier buisness license number. I added the fields to the database so the information has somewhere to go. However i can't find the function that places the information in the database. I tried using the error message to find it however all i got was this: "1054 - Unknown column 'entry_wholesale' in 'field list' insert into address_book (customers_id, entry_firstname, entry_lastname, entry_street_address, entry_postcode, entry_city, entry_country_id, entry_gender, entry_company, entry_wholesale, entry_wholesale_number, entry_suburb, entry_zone_id, entry_state) values ('5', 'tester', 'tester', '334 nowhere st', '55456', 'Sprinfield', '223', 'm', 'Test', '1', '4445445433434', '', '31', '') [TEP STOP]" I looked for this "insert into adress_book" fucntion and found it in "upgrade_3.php" i tried modifying it but that didn't help. i looked for the funcion surrounding it "osc_db_query" and found that in "database.php" "function osc_db_query($query, $link = 'db_link') { global $$link; return mysql_query($query, $$link); }" This was no real help. Does anyone know where i can find out how to push the new data into the databse? Link to comment Share on other sites More sharing options...
Gemshop Posted May 14, 2007 Author Share Posted May 14, 2007 The idea is, when someone registers as a retailer wholesale items and prices are displayed, however if the person is not registered as a retailer (or not registered at all) they will not see certain items, nor will they see the wholesale prices. This allows us to have one shop and have only certain users see our wholesale products. This could be adapted for other uses as well, like a preferred customer etc. Link to comment Share on other sites More sharing options...
Qihun Posted May 14, 2007 Share Posted May 14, 2007 Do you have column called entry_wholesale in your database ? the script being asked to pull information out there , but couldn't find that place. Link to comment Share on other sites More sharing options...
bill110 Posted May 14, 2007 Share Posted May 14, 2007 In catalog/create_account.php $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); add your fields and change accordingly. Then further down you need to add your fields to the data array if ($error == false) { $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_password' => tep_encrypt_password($password)); And further down the code add where necessary. Just use the other entries as a pattern. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai Link to comment Share on other sites More sharing options...
spax Posted May 14, 2007 Share Posted May 14, 2007 The idea is, when someone registers as a retailer wholesale items and prices are displayed, however if the person is not registered as a retailer (or not registered at all) they will not see certain items, nor will they see the wholesale prices. This allows us to have one shop and have only certain users see our wholesale products. This could be adapted for other uses as well, like a preferred customer etc. Just use this: http://www.oscommerce.com/community/contributions,716 There are lots of great add-ons for it also. See all Seperate Pricing Per Customer (SPPC) related contributions. http://www.oscommerce.com/community?contri...mp;category=all Link to comment Share on other sites More sharing options...
Gemshop Posted May 14, 2007 Author Share Posted May 14, 2007 Thanks to Qihun I found out I had added the fields to the "customer" table and not the "address book" table. I now have them pushing to the "address book" table correctly but both fields in the "customer" table are still set to NULL. any idea where the code is sto set this? Link to comment Share on other sites More sharing options...
Gemshop Posted May 14, 2007 Author Share Posted May 14, 2007 Just use this: http://www.oscommerce.com/community/contributions,716 There are lots of great add-ons for it also. See all Seperate Pricing Per Customer (SPPC) related contributions. http://www.oscommerce.com/community?contri...mp;category=all Thanks! (if this doesn't solve my problem outright it should certainly save me a boat load of time) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.