Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating a New Account drops shopping cart contents


rubygirl

Recommended Posts

Hello! This is very strange. If I add products to my account, and login as an existing customer, the order process goes through beautifully. However when I try to create a new account, that is when the problem arises. So I could have added items to the cart, clicked checkout - then click Create New Account - site transfers to ssl - no problems - all items still in cart. Complete all fields on create_account.php and when I click Continue - I get a create account success page and all items are removed from the cart. WHY IS THIS HAPPENING??? This is driving me crazy!! Please help!

Link to comment
Share on other sites

unfortunately not - but thanks for trying! any other thoughts? This is very strange ... I don't know what could be causing this .... it is driving me crazy though!

 

well, normally in create account, the customer info is set and saved, then the cart contents is inserted into the database mirror and then the cart contents is restored again from that database mirror.

 

So either you are losing the session but then you would also be signed out or something goes wrong when saving and/or restoring the cart content.

But the same procedure is done at sign in so it should then happen there as well.

So you need to do some tracing. Check what happend to the session id in the url, does it remain the same or does it change.

Treasurer MFC

Link to comment
Share on other sites

well, normally in create account, the customer info is set and saved, then the cart contents is inserted into the database mirror and then the cart contents is restored again from that database mirror.

 

So either you are losing the session but then you would also be signed out or something goes wrong when saving and/or restoring the cart content.

But the same procedure is done at sign in so it should then happen there as well.

So you need to do some tracing. Check what happend to the session id in the url, does it remain the same or does it change.

 

okay - so I did just that - the session id is maintaining itself beautifully. I also note that I do stay logged in to the system. After I get the create account success page, I clicked My Account and was able to view everything correctly. However my cart was again emptied. I don't understand how I can login with an existing account and have it work perfectly - but when creating a new account, I loose the cart contents. The only thing that is happening is that the cart loses its products. Now that my cart is empty, I can add as many products as I need to and complete the checkout without any problems. It's just on new account creation.

Link to comment
Share on other sites

okay - so I did just that - the session id is maintaining itself beautifully. I also note that I do stay logged in to the system. After I get the create account success page, I clicked My Account and was able to view everything correctly. However my cart was again emptied. I don't understand how I can login with an existing account and have it work perfectly - but when creating a new account, I loose the cart contents. The only thing that is happening is that the cart loses its products. Now that my cart is empty, I can add as many products as I need to and complete the checkout without any problems. It's just on new account creation.

 

in create account:

 

 

if (SESSION_RECREATE == 'True') {

tep_session_recreate();

}

 

$customer_first_name = $firstname;

$customer_default_address_id = $address_id;

$customer_country_id = $country;

$customer_zone_id = $zone_id;

tep_session_register('customer_id');

tep_session_register('customer_first_name');

tep_session_register('customer_default_address_id');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

// restore cart contents

$cart->restore_contents();

 

 

in login:

 

if (SESSION_RECREATE == 'True') {

tep_session_recreate();

}

 

$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");

$check_country = tep_db_fetch_array($check_country_query);

 

$customer_id = $check_customer['customers_id'];

$customer_default_address_id = $check_customer['customers_default_address_id'];

$customer_first_name = $check_customer['customers_firstname'];

$customer_country_id = $check_country['entry_country_id'];

$customer_zone_id = $check_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

 

// restore cart contents

$cart->restore_contents();

 

 

so they are virtually the same.

Treasurer MFC

Link to comment
Share on other sites

so why do I lose the cart contents when creating an account but not when logging in?

 

like I said, you need to trace, what is happening when creating an account after contents has been added to the cart. I am not a psychic so you will need to do that yourself.

 

1) is the session id intact

2) is the content saved to the cart successfully

3) is it retrieved successfully

etc.

Treasurer MFC

Link to comment
Share on other sites

like I said, you need to trace, what is happening when creating an account after contents has been added to the cart. I am not a psychic so you will need to do that yourself.

 

1) is the session id intact

2) is the content saved to the cart successfully

3) is it retrieved successfully

etc.

 

 

yes and I thought I had posted that info above :blush: anyway, the session id is intact - the items are added to the cart successfully - however when I create a new account and click Continue - I get the create_account_success.php page and then the items that were in the cart are no longer there. I am also still logged in to the new account and can continue to add items - but the original items that were added before I created the new account are gone. Again, if I simply login to an existing account, then everything moves through fine - items stay in the cart, checkout is successful. So whatever is going on is happening when I click Continue and I am redirected to the success page - and that is when the cart contents are being emptied.

Link to comment
Share on other sites

yes and I thought I had posted that info above :blush: anyway, the session id is intact - the items are added to the cart successfully - however when I create a new account and click Continue - I get the create_account_success.php page and then the items that were in the cart are no longer there. I am also still logged in to the new account and can continue to add items - but the original items that were added before I created the new account are gone. Again, if I simply login to an existing account, then everything moves through fine - items stay in the cart, checkout is successful. So whatever is going on is happening when I click Continue and I am redirected to the success page - and that is when the cart contents are being emptied.

 

yes, I got that part but without tracing what happens behind the scenes it is impossible to determine what is the cause of it other than speculating in the blind.

Treasurer MFC

Link to comment
Share on other sites

do you know which pages are used when creating the account? I need to look somewhere - I have already tried changing the create_account.php page and login.php page to original stock pages and still the same issue - so it has to be somewhere else - just need to know which pages are included.

Link to comment
Share on other sites

do you know which pages are used when creating the account? I need to look somewhere - I have already tried changing the create_account.php page and login.php page to original stock pages and still the same issue - so it has to be somewhere else - just need to know which pages are included.

 

well, the problem is with create account -> account success as pages but it involves a bit more behind the scenes with the database and the shopping cart class.

Treasurer MFC

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...