Thursday 15 April 2010

database - Saving orders in session magento -


I have to pass an array of Mage_Sales_Model_Order objects not saved between requests, but try to save them in checkout / session They have not been saved in DB. Apart from this, all the data that was added after that, say, the core / session is also cured. My code:

In the model:

  // $ order is an array command command: getSingleton ('checkout / session') - & gt; Set-orders ($ order); Dana :: getSingleton ('core / session') - & gt; SetIsMultishipping (true); // ...   

In the Controller:

  $ this-> _redirectUrl ($ url); First of all, I thought this order is not a serialize object, so I tried to translate it into the translator:  
  $ serialized = serialize (Dana: : GetModel ('Sales / Order') -> Load (1111));   

And this string returned as it is supposed to be. Then I checked that the serialized order fits for maximum sessions of storage sessions:

  & gt; Echo strlen ($ serialized); 11465   

To store session data in the database, there is a small value keeping in mind the medieval type field type.

Do you know any other reasons why Magento is quietly failing in a database saving session?

Thank you.

OK, I thought it was my fault - changing the object based on my order Were removed / deleted because the order was saved in the database, therefore serialization failed silently.

No comments:

Post a Comment