Status History

Does cs-cart keep track of the history of the statuses on an order, perhaps with timestamp and user_id of changer?



I don’t mind building it myself, but I’d rather not build something that’s already there.



Thanks!

Logs under administration.

[quote name=‘JesseLeeStringer’]Logs under administration.[/QUOTE]



Excellent.



Now, can someone point me to a description on how to parse the option code, such as this:



a:2:{s:5:“order”;s:7:“# 15602”;s:6:“status”;s:23:“Processing → Processed”;}

That’s a serialized array. It contains the order # and the status.

[quote name=‘gginorio’]That’s a serialized array. It contains the order # and the status.[/QUOTE]



I realize that. I can use it, I just don’t want to have my code break down the road if the index values change, so I was interested in where that stuff is described (even if source code) so I can monitor it. Makes sense?

That’s a good question. I don’t know that answer.

[quote]

I realize that. I can use it, I just don’t want to have my code break down the road if the index values change, so I was interested in where that stuff is described (even if source code) so I can monitor it. Makes sense?

[/quote]



In the function fn_change_status() is a call to fn_log_event(). Each event has a “type” (such as ‘requests’, ‘order’, ‘user’, etc.) and also an ‘action’ such as ‘change_status’, ‘send’, etc…



Unfortunately, the events (and what additional processing is done with them) is hard coded. The ‘actions’ are stored in the database and are the checkbox items for each ‘event type’ on the settings page of the Administration/Logs page.



So essentially, “what” to display in the log is determined at the time of the event. The log page is really only a “viewer”. Each index of the array will be a language variable for the label and the value of each index is the actual value of the event.



So you shouldn’t ever “loose” anything. But if you do your own events (like I do with my email logging addon), you have to keep up with any possible changes that happen within fn_log_event() from release to release. Since cs-cart does not publish an API there is never a guarantee that anything you refer to within the system will be there or in the same form in a subsequent release. In fact they won’t even make this guarantee on custom work that they might do.

[quote name=‘tbirnseth’]In the function fn_change_status() …[/QUOTE]



Ah, thanks. I think I’ll have to do something like that. Thanks for the explanation.