Not sure this is what you mean, but I am trying to help.
If I understand the cart data is saved somewhere in your database, and is linked to the user.
How did you do your cart form?
I think I have a similar scenario, in my case, I have a ModelForm based on an Order model I have defined
(which in your case, could be linked to a session ID in the begining and later to the user)
So when user looks at his/hers orders, and click on one, it actualy open the ModelForm with the related data
If you want to actualy duplicate it, you can use the data from the order that was just clicked as an "initial" data to a new instance of the ModelForm
One note - in a cart scenarion, the ModelForm is normally a ModelFormSet because the cart, includes many products, and you should be able to modify the quantity or delete each product
Hope this helps
Galia
On Monday, March 25, 2013 4:51:36 PM UTC+1, slim wrote:
-- On Monday, March 25, 2013 4:51:36 PM UTC+1, slim wrote:
Hello everyone,I have an e-commerce siteA user arrives without first logging in, adds a few things to their cart, a session is established for this user, and then proceeds to the checkout. the command is then saved in database.Now I need the user to log in and see their recent commands,untill now no probleme (at least at first sight) but the user want to "duplicate" one of their recent commands put it in the current cart then modify on it if necessary before checkoutI have absolutely no idea how to do that :/If possible,I need a quick answer on the complexity of doing it and how much time I need so I can go back to my bossthen any clues to help me do that would be greatly appreciatedThanks in advance
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment