Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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.

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...