Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cart contents lost on login


Bryce F

Recommended Posts

Hello. I'm using a very customized version of OSC 2.2 RC1 (customizations by me).

 

Here's the scenario: An anonymous user adds some items to the cart. He then proceeds to checkout, or simply decides to login/register (either scenario produces the same issue). He either logs in with an existing account or creates a new account. Afterwards, the contents of his cart are completely erased.

 

I know that there is a function to save and restore snapshots. Snapshots work fine in that they restore the proper address, get, post, and method variables. However, the cart contents are not restored.

I can't seem to find the function/code where:

(A) anonymous user's cart contents are saved to session vars

(B) where the newly-logged-in user has the cart contents from (A) restored.

 

Where can I find the code for this?

 

Thank you!

Link to comment
Share on other sites

Never mind guys, I found the location... about 5 lines down from where shoppingCart->restore_contents() function is declared. Fixed the problem.

 

 

What was your fix? I am having similar problems

Link to comment
Share on other sites

What was your fix? I am having similar problems

 

Unfortunately, I can guarantee that my fix will not help you. I heavily modified my version of OSC, and I'm now using a new products table field called `products_sku` to reference everything rather than going by `products_id`. My problem was due to trying to restore the cart by passing this sku to a function that still was referencing by `products_id`... I'd forgotten to convert this function to use the sku.

 

But if you have a specific problem and have some more information about what you're doing, any modifications you've made, and the symptoms, I'd be glad to try to help...

 

- Bryce

Link to comment
Share on other sites

Thanks so much for replying. I actually figured out that my problem was in classes/shopping_cart.php. I reuploaded that...and FIEXED! I sweat it out for a few days.

 

Would love to see your site, as mine is heavily modified too. PM me it!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...