♥Tsimi 525 Posted October 7, 2016 @@Mikepo Adding the tick icon to the customers page is a good idea and is sure helpful. The admin could then delete older guest accounts. The only problem is if I add a product to the cart and continue as guest then leave the shop without placing any order then later that same day I go back to that shop and try to place that order I can't login as guest because of the existing mail address error. The best way would be something like @@burt explained, delete account data when mail address exist and the customer_guest field is status 1. 1 Mikepo reacted to this Share this post Link to post Share on other sites
Mikepo 77 Posted October 7, 2016 @@Tsimi, Had a quick look at solving this issue the way @@burt suggested, and it looks easy to do, so I'll code it and post the solution back. 2 Tsimi and raiwa reacted to this osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 8, 2016 (edited) I gave it a try: In account_pwa.php under: $process = true; Add: $check_query = tep_db_query("select customers_guest from customers where customers_email_address = '" . $_POST['email_address'] . "'"); $check = tep_db_fetch_array($check_query); if ( $check['customers_guest'] == 1) { tep_db_query("delete from customers where customers_email_address = '" . $_POST['email_address'] . "'"); } Edited October 8, 2016 by raiwa 2 Mikepo and Tsimi reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
Mikepo 77 Posted October 8, 2016 @@raiwa Something similar to my attempt, should work well, I'm still testing osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
Mikepo 77 Posted October 8, 2016 @@Tsimi @@raiwa I just checked this out and all seems well on my test server in file account_pwa.php FIND: $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } else { ADD AFTER: // check to see if guest email address is in DB and whether the flag is set $check_email_guest_query = tep_db_query("select customers_guest from " . TABLE_CUSTOMERS ." where customers_email_address = '". tep_db_input($email_address) . "'"); // if flag set to 1 delete quest details so customer can proceed $check_guest = tep_db_fetch_array($check_email_guest_query); if ($check_guest['customers_guest'] == 1) { //delete the guest details tep_db_query("delete from " . TABLE_CUSTOMERS ." where customers_email_address = '". tep_db_input($email_address) . "'"); } The assumption is the quest flag is only set if the customer uses the PWA process, so no one can try and enter another persons email address to delete the account details without permission. I think the logic is right? I've got to add postcode formatting to the account_pwa.php file before I go live. So please check this out before using. Mike osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 9, 2016 (edited) @@Mikepo I tried your code but it still gives me the e-mail already exist message. Raiwas code in post #53 on the other hand did the trick and works fine. I also tried to use mail addresses of registered customers and it won't delete them as it should be. Edited October 9, 2016 by Tsimi Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 9, 2016 Not sure if you have done this already but I replaced all FILENAME_ and TABLE_ instances for compatibility with latest EDGE shops. Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 9, 2016 The same error can appear if a guest which filled in his info and didn't finish the guest order decides to register a regular account. So the code should be also added to create_account.php. Maybe it's possible to do by hook to avoid core file change? Another question: If we arrive to a satisfying solution it maybe should be included in the add-on package. ALso like Lmbros mentioned, the add-on should be updtaed for latest EDGE compatibility. deDocta isn't any more with us and the package has no public uploads allowed. Someone may wish to "adopt" it and upload the updated version as a new "reloaded" package. Any volunteer?? rgd Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
burt 5,437 Posted October 9, 2016 Or a HT Module.... I believe (though I am not sure) that I can unlock addons. What is the exact addon URL ? Help shape the future of Phoenix; join the Phoenix Club Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 9, 2016 Purchase without account for 2.3.4 and BS2334 About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
burt 5,437 Posted October 9, 2016 Start up a new one. Once done I'll put a note on this one telling people so. 1 Tsimi reacted to this Help shape the future of Phoenix; join the Phoenix Club Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 9, 2016 @@raiwa You have this installed in your shop right? Do you use PayPal Express? Share this post Link to post Share on other sites
Mikepo 77 Posted October 9, 2016 The same error can appear if a guest which filled in his info and didn't finish the guest order decides to register a regular account. So the code should be also added to create_account.php. Maybe it's possible to do by hook to avoid core file change? Another question: If we arrive to a satisfying solution it maybe should be included in the add-on package. ALso like Lmbros mentioned, the add-on should be updtaed for latest EDGE compatibility. deDocta isn't any more with us and the package has no public uploads allowed. Someone may wish to "adopt" it and upload the updated version as a new "reloaded" package. Any volunteer?? rgd Rainer @@raiwa agreed, the create_account.php also needs this code. I've checked this to confirm. works OK! regarding creating a "reloaded" package, I could do this but it would be for BS gold, and I'm not understanding hooks, so I couldn't create a package without core changes. Mike osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 10, 2016 (edited) @@Mikepo, @@Tsimi, @@raiwa You have this installed in your shop right? Do you use PayPal Express? Yes I use PayPal express and it works well together with PWA. @@raiwa agreed, the create_account.php also needs this code. I've checked this to confirm. works OK! regarding creating a "reloaded" package, I could do this but it would be for BS gold, and I'm not understanding hooks, so I couldn't create a package without core changes. Mike I will give it a try and create a Header Tag module for the code inclusion in create_account.php. I can also de the update to latest EDGE. Give me just some days, maybe one week and I'll upload first here for you to test and check if all is ok. I did a fast check with Mike's code and it seems to work for me. Lambros could you give it a second try. In general I like Mike's solution better. I's more correct placed and using tep_db_input($email_address) seems to be more secure. I'll check again and see. rgds Rainer Edited October 10, 2016 by raiwa About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 10, 2016 Lambros could you give it a second try. In general I like Mike's solution better. I's more correct placed and using tep_db_input($email_address) seems to be more secure. I'll check again and see. Just did and this time it worked not sure why it didn't the first time. Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 11, 2016 Hi, Here the ht module to remove guest accounts in create account page. I had to find a workaround for the following: Header tags are loaded in template_top.php, this is after the error checks of the create account page. So the error appeared on first intent because of the account wasn't deleted yet when the mail was checked. I added a redirect to the create account page itself after the account delete query in the header tag. It works and I hope it's the correct way. Or anyone has a better idea? Please give it a try. I'll continue with the EDGE update of all files. rgds Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 11, 2016 @@raiwa Hi Rainer Just tested your HT module. First I created a guest account and logged out so that the guest account data was left in the database. Then I added a product into the cart and clicked the checkout button. At the login page I chose create new account and entered the same mail address as I used for the guest account. After filling out all fields and clicking on the continue button the create account page reloads and the fields are empty. In the admin and database the guest account has been deleted. But no new account has been created nor does it continue with the checkout. It does what the code inside the HT module says but it should continue with the checkout or redirect to the create account success page right? Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 11, 2016 @@Tsimi, I could swear it worked for me this morning. Now I tried again and the same like you say. :- The html parameters got lost. I tried several things, but the only thing I got to work is with javascript: Please try this change in ht module: if ($check_guest['customers_guest'] == 1) { //delete the guest details tep_db_query("delete from customers where customers_email_address = '". tep_db_input($email_address) . "' and customers_guest = '1'"); //reload page to check e-mail after guest account has been deleted // tep_redirect(tep_href_link('create_account.php', tep_get_all_get_params(), 'SSL')); ?> <script> location.reload(); </script> <?php } } } thanks About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 11, 2016 (edited) @@raiwa Now it loads the page and continues to the success page and from there to the checkout process. :thumbsup: I tested with Chrome and Firefox browsers. With Firefox I get this popup message To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier With Chrome all is working fine as it suppose to. Edited October 11, 2016 by Tsimi 1 raiwa reacted to this Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 11, 2016 @@Tsimi, Yes, saw this with Firefox, it also happens with some other add-ons, if I well remember. Anyway, lets say it will not happen too often and better than to be unable to create the account. If anyone has any better idea, very welcome. rgds Rainer 1 Tsimi reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 12, 2016 (edited) new version updated and ready for testing and suggestions. Changes Version. 2.0- update for EDGE compatibility: hardcoded filenames, database table names, paths. Superglobals. fa icons- removed check_account.js.php- added check for existing guest account with the same e-mail in account_pwa.php- added ht module to check for existing guest account with the same e-mail for create_account.php- moved language definitions to module- made remove database guest column in orders table optional when module is uninstalled to keep guest orders flagged.- added comments to all core file changes- instructions rewritten- update instructions added I modified the guest account check and delete script in account_pwa.php and ht_pwa_delete_account.php to check for customer_id where customers_email_address = '". tep_db_input($email_address) . "' and customers_guest = '1' then the entries in customer and also address_book tables are deleted by customer_id: $check_guest_query = tep_db_query("select customers_id from customers where customers_email_address = '". tep_db_input($email_address) . "' and customers_guest = '1'"); $check_guest = tep_db_fetch_array($check_guest_query); if ( tep_not_null($check_guest) ) { tep_db_query("delete from customers where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'"); tep_db_query("delete from address_book where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'"); I added and customers_guest = '1' to all queries to make sure that only guest entries are deleted. Even it shouldn't be needed in the delete queries, but it also doesn't make harm. Please give it a try and let me know if there are any errors or if you have any suggestions. Thanks and best regards Rainer Edited October 12, 2016 by raiwa 1 Tsimi reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
Mikepo 77 Posted October 12, 2016 @@raiwa I noticed last night the text EMAIL_WARNING is not defined in the email sent to the "guest" customer after the order is confirmed. Defining this in the appropriate language file fixes the problem. I used the following text Note: This email address was used to purchase products from our web store. If you did not intend to or not aware of this online purchase please send an email to admim@store.com I'll test the package later Mike osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 12, 2016 (edited) @@Mikepo, this is moved from the checkout_process language file to the login module. Check in this package please. You'll need to uninstall and reinstall the module and change the code in checkout_process.php. See update instructions. Edited October 12, 2016 by raiwa About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 13, 2016 (edited) @@raiwa Hi Rainer I just installed your PWA for BS 2.0.zip package. All looks good here. I only found this typo; Inside the install manual Step 2.2 the FIND query has no TABLE_ definitions and can therefore not be found. Your thinking is the correct, future proof way, Gary will replace those TABLE_ instances in the future but till then they are there. That step could be changed to something like Find: $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); or $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from orders where orders_id = '" . (int)$oID . "'"); then further below the same thing with this piece here <?php if (isset($HTTP_GET_VARS['cID'])) { $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']); $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC"; } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) { $status = tep_db_prepare_input($HTTP_GET_VARS['status']); $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } else { $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } Another thing that we/you could add is Mikepos code for the admin/customer.php file to show the guest tick icon there too just in case a guest doesn't intend to continue his shopping for...eternity. Then the admin can delete the account manually after a certain time. Edited October 13, 2016 by Tsimi 1 raiwa reacted to this Share this post Link to post Share on other sites
♥raiwa 1,421 Posted October 13, 2016 @@Tsimi, Yes, thank you for these points. For the table constants, maybe I'll include both versions in the "Find:" code. Like this it is already prepared when the TABLE_ 's will be replaced and no new version will be needed. The "tick"s in customer.php will be added, makes sense. I'll re-read the thread if there are more issues to be included. Best regards Rainer 1 Tsimi reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites