I should probably explain a little more. Once an order has been placed cakePHP creates an xml file which is sent to another server to be imported by some industry software we use, not all of the information is saved (Except a dump of the XML file is stored as text in the orders table, this was intended for backups).
Here is some example data: *Order XML Example File: *http://pastie.org/private/j7aaterwdw6tuf5vtkrrlg *Order Session Example Data*: http://pastie.org/private/2llox9iv5jcworlroahlaw The information in the above links aren't related to each other, they're just examples of the type of data I'm wishing to save and how it is used. Here is my orders table: *Order.id (MEDIUMINT UNSIGNED PRIMARY KEY auto increment) Order.user_id (MEDIUMINT UNSIGNED) Order.reference (VARCHAR 32) Order.delivery_method (VARCHAR 32) Order.filename (VARCHAR 40) Order.xml_dump (TEXT) Order.created (DATETIME) Order.modified (DATETIME) * I can include the user_id in a save, but I can't generate the XML file without processing the order, this is why I need to save the session data and associate it with the user id, so that the user can load it back into their session later on. Any ideas? Perhaps if the [options] => array( ... ) part wasn't in my session data it'd be easier to save in individual fields. On 16 November 2010 18:24, cricket <[email protected]> wrote: > On Tue, Nov 16, 2010 at 9:23 AM, Stephen <[email protected]> > wrote: > > Hi There > > > > I need to give my customers the ability to save incomplete orders and > > restore them at a later date. > > > > The orders are quite intricate and can sometimes contain a lot of data > (this > > is another reason why I need save and load). > > > > The data is contained within > > > > $this->Session->read('Order'); > > > > Any hints on how I can achieve this? > > > > I don't want to save other session data including auth session data. > > You could create a SavedOrder model, complete with associations to all > other data models involved. I've done something similar. Or, I guess > you could save the Order, but leave some flag column set to 0 > (incomplete), for example. > > Are the users logged in? Having a user_id would make it a bit simpler > but it's not strictly necessary. You could simply save a long-term > cookie with the SavedOrder.id (I'd suggest to use UUID for that). If > the cookie expires before they return, too bad. > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
