booster Posted January 7, 2005 Share Posted January 7, 2005 I'm seeing a problem very similar to that displayed here: http://www.oscommerce.com/forums/index.php?showtopic=48872 Where the wrong customer address is entered for a new customer. To quote from that message:- Issue: Two new users would like to create an account and then buy something. Person A is first and creates an account succesful and his data is written to [address_book] and [customers]. No problem with Person A. But then, Person B arrives and also creates an account, and goes shopping. He does a checkout and pays. Person A receives a message that what Person B bought! However, the CC from Person B has payed for it. (Which is correct). Person B never receives an email. What happened? Well, person A will get the address from person A and Person B never actually appears in the DB [customers]. Snapshot example of how the dbase looks afterwards [customers] customerID=200, NAME=Person A [address_book] customerID=200, address_book_id=1, name=Person A customerID=200, address_book_id=2, name=Person B Unfortunately I haven't seen any explanation or answer to why this is happening. Help? Dave. Link to comment Share on other sites More sharing options...
Guest Posted January 7, 2005 Share Posted January 7, 2005 what does your configure.php file have regarding store_sessions, is it set to mysql? sounds like it could be a cookie problem also. are you using an ssl certificate? Link to comment Share on other sites More sharing options...
cudovich Posted January 7, 2005 Share Posted January 7, 2005 what does your configure.php file have regarding store_sessions, is it set to mysql?sounds like it could be a cookie problem also. are you using an ssl certificate? <{POST_SNAPBACK}> Mibble, I am having the same problem on my store. 3 times now orders/accounts have been crossed while different users on different computers are ordering at the same time. I check the store_sessions and it is set to mysql. I am using a SSL cert. Any thoughts on whats wrong or how to fix it? Thanks. -jc Link to comment Share on other sites More sharing options...
Guest Posted January 7, 2005 Share Posted January 7, 2005 post your configure.php without the database info, lets see if possibly something in there. are you using shared or your own ssl? Link to comment Share on other sites More sharing options...
booster Posted January 7, 2005 Author Share Posted January 7, 2005 what does your configure.php file have regarding store_sessions, is it set to mysql?sounds like it could be a cookie problem also. are you using an ssl certificate? <{POST_SNAPBACK}> Hi Mibble. Originally the store was using the default file based sessions but the problem persists with 'mysql' being used instead. The store is using a shared SSL. The configuration is as below... define('HTTP_SERVER', 'http://www.teststore.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://securehostXX.hrwebservices.net/~teststore'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', true); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'www.teststore.com'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/catalog/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); It seems that the code in create_account.php might not be giving the results that are hoped for. i.e. around about line 182... tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); $customer_id = tep_db_insert_id(); The first lines resulting insert will provide the auto-update value for the customer_id but it seems that this customer_id is being "re-used" by another client who creates an account about the same time or slightly later. As the customer table entry is an "update" rather than an "insert" no error will be given when the "2nd" new account overwrites the first :( I checked that persistent connections were off in configuration, the last thing I tried was setting the Configuration/sessions/ Recreate Session to true - haven't seen enough results from that change to tell if it's made any difference. It seems to be an "optimistic" way of creating a new user account but for most stores it seems to work fine. Can't yet find what's up with this one - may be the shared SSL handling by the server host? Dave. Link to comment Share on other sites More sharing options...
booster Posted January 7, 2005 Author Share Posted January 7, 2005 The configuration is as below... <{POST_SNAPBACK}> <?php /* $Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://www.teststore.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://securehostXX.hrwebservices.net/~teststore'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', true); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'www.teststore.com'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/catalog/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_IMAGESBIG', DIR_WS_IMAGES . 'big/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'])); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'XXX'); define('DB_SERVER_PASSWORD', 'YYY'); define('DB_DATABASE', 'ZZZ'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); ?> Actually here's the whole config file. Dave. Link to comment Share on other sites More sharing options...
Guest Posted January 7, 2005 Share Posted January 7, 2005 securehostXX.hrwebservices.net/~teststore should be in the https cookie domain and /cataog/ should be in the cookie path Link to comment Share on other sites More sharing options...
booster Posted January 7, 2005 Author Share Posted January 7, 2005 securehostXX.hrwebservices.net/~teststore should be in the https cookie domain and /cataog/ should be in the cookie path <{POST_SNAPBACK}> Will try that John. I've been round the block so many time with this store I think I may have tried this before ;) but lets see. Dave. Link to comment Share on other sites More sharing options...
booster Posted January 7, 2005 Author Share Posted January 7, 2005 Will try that John. I've been round the block so many time with this store I think I may have tried this before ;) but lets see. Dave. <{POST_SNAPBACK}> Nope that didn't help at all :( The customer table entry is being lost (over written) arrrgghhh. Dave. Link to comment Share on other sites More sharing options...
booster Posted January 9, 2005 Author Share Posted January 9, 2005 Hmmm checking the code in create_account.php around line 182 :- tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); $customer_id = tep_db_insert_id(); The first line inserts (hopefully) a new entry in the customers table and the 2nd line retrieves the auto-incremented value of the new customers_id field. This customers_id value is used to create an address book entry that points to the related new customer. But wait a minute, theres no error handling. If the TABLE_CUSTOMERS insert fails (for whatever reason) the create_account.php code will continue executing but it will use the previous "customers_id" value. DOH! This is what I think is happening here - it fully explains the mis matched results I'm seeing in the customers and address tables - and the screwed up order that results. What I need to find out is WHY the customer table insert is failing. Anyone have any debug tips to test this out? Dave. Link to comment Share on other sites More sharing options...
cudovich Posted February 3, 2005 Share Posted February 3, 2005 post your configure.php without the database info, lets see if possibly something in there.are you using shared or your own ssl? <{POST_SNAPBACK}> -------------- <?php /* $Id: configure.php,v 1.14 2003/02/21 16:55:24 dgw_ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ // define our webserver variables // FS = Filesystem (physical) // WS = Webserver (virtual) define('HTTP_SERVER', 'http://www.mysite.com'); define('HTTP_CATALOG_SERVER', ''); define('HTTPS_CATALOG_SERVER', ''); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) define('DIR_WS_ADMIN', '/store/admin/'); define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); define('DIR_WS_CATALOG', '/store/'); define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); // define our database connection define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'gameops_osc2'); define('DB_SERVER_PASSWORD', 'lldLl_cn1I'); define('DB_DATABASE', 'gameops_osc2'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', ''); ?> ----------------- this is just a guess....but is this a problem? define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module (it is set to false, and I have a ssl certificate) Thanks for your help.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.