Jump to content
Sign in to follow this  
mandreiana

purchase without account improvements

Recommended Posts

I'm using the Purchase without account contribution. Author said not to email him and post here instead.

 

In checkout_success.php, I don't display notifications if the user doesn't have an account and I also remove the account. It needs to be removed as we stated we won't hold any customer information. In the future, if the same person wants to order again with the same e-mail, he will be able as the account won't exist ( now it complains the account is already there ).

 

Of course, changing it not to create an account at all would be best.

Share this post


Link to post
Share on other sites

Would you be so kind as to explain how you remove the account after checkout? Obviously this is a neccessary step when using Purchase without Account, yet I am not skilled enough in PHP to figure this out.

 

Any help would be much appreciated.

 

Thanks!

Mike

Share this post


Link to post
Share on other sites

I had the same problem, when I did some test purchases without creating an account. I was able to go back and click on 'Password Forgotten?' link and get a new password and of course get access to the account, which this is not the way it is supposed to work.

 

Here is the way I fixed it:

in /catalog/checkout_success.php insert the following code right before the HTML code but within the php tags.

  // Added a check for a Guest checkout and cleared the session - 030411 

 if (tep_session_is_registered('noaccount')) { 

      	 tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customer_id) . "'");

      	 tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customer_id) . "'");

      	 tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customer_id) . "'");

      	 tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customer_id) . "'");

      	 tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customer_id) . "'");

      	 tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customer_id) . "'");

	 tep_session_destroy(); 

	 

 }

 

this will get rid of the customer account information, therefore the customer will not have access to the account nor the order history but you will keep the order information. :idea:

 

If you have any problems just let me know.

Share this post


Link to post
Share on other sites

Thanks so much phelan, I'll try this! One question though: by deleting the customers account info, do you also lose their phone number and email address? If so, how do you send any confirmation emails regarding their order, or ship via FedEx without a phone number (I know the phone number isn't absolutely required but it's highly recommended).

 

Thanks,

Mike

Share this post


Link to post
Share on other sites
One question though: by deleting the customers account info, do you also lose their phone number and email address?

 

No. The code above only deletes the customer profile but you still keep the order information which contains customer's name, address, phone number and email, you will see this information when you list the orders thru the administration, so it is very important that you either back up this information and don't delete the order, just in case you need this information again.

Share this post


Link to post
Share on other sites

I tried that code hoping it would fix my problem. I get an error whenever someone would try and return and purchase a second time, it says there was an email/password issue. How do you fix this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×