Jump to content

Order history details stopped being written to the database


Recommended Posts

Prestashop version

PHP version 5.6


I don't know if other people have had trouble with this but my problem right now is that order history details have stopped writing into the order_history database on the backend. No update was done to PS nor files were touched when the problem started occurring. It just stopped working really recently.


Now I am unable to view the order history details of an order starting Dec 4 because nothing was recorded. I am able to save orders to different states but the history of its past statuses are not written to the db.


Because of this, we are having trouble with our payment modules which currently redirect to the order-history page of the user's account.


I checked the order_history table and it's not locked either so I'm baffled as to why nothing is getting written there anymore.


Any help would be appreciated.

EDIT: In addition, clicking the "Update Status" button on the backend Order admin page doesn't write anything on the order history table either. I found the same issue experienced by diana13. Topic was posted on May 04 2015 12:39 AM

Edited by wimbie.sy (see edit history)
Link to comment
Share on other sites

I found the temporary solution for this and I say it's temporary is because this solution will probably have to be regularly performed until the bug is solved.


The cause of the issue is that the smarty_lazy_cache table in the prestashop database was corrupted for reasons unknown to me.

How I found out was I turned on debugging for my store and an exception "smarty_lazy_cache table doesn't exist" message got thrown.


The solution is the following code that needs to be entered in your database command line:


DROP TABLE IF EXISTS `PREFIX_smarty_lazy_cache`;
CREATE TABLE `PREFIX_smarty_lazy_cache` (
`template_hash` varchar(32) NOT NULL DEFAULT '',
`cache_id` varchar(255) NOT NULL DEFAULT '',
`compile_id` varchar(32) NOT NULL DEFAULT '',
`filepath` varchar(255) NOT NULL DEFAULT '',
`last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)


What this does is it drops the corrupted smarty lazy cache table and creates a new one. The new one then get automatically repopulated by the system and your issue should be resolved.

I have seen the smarty error before without touching anything. So I'm guessing this solution needs to be run every now and then to minimize effects of corrupt smarty lazy cache table on your website.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...