Skip to content

Conversation

xabikip
Copy link

@xabikip xabikip commented Apr 1, 2015

I have written this code and it works fine. But if the user leaves the browser or going to another page the cart is lost. Can you think of how to fix this?

@hparfr
Copy link
Owner

hparfr commented Apr 1, 2015

Create a Guest object in each addProduct call is not a good idea.

I think it's better to write a separate function who creates or load a Guest.
Then you can use addToCurrentCart function.

@xabikip
Copy link
Author

xabikip commented Apr 1, 2015

Yes, that's a good idea, but i don't know how to load a Guest. You have any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants