Post by rgnewbury » Thu Oct 18, 2012 6:01 am

There are a number of places where opencart reports successfui completion to the admin user.
It would be nice to have that report give the time/date of completion, as sometimes the action takes a while to complete.

Instead of "Success: You have successfully imported your database" how about:

"Database successfully imported at Wed Oct 17 17:59:05 EDT 2012"

In a bash script this would be done with 'echo "Database successfully imported at"date
My php knowledge is not up to doing this (yet) in the code.
This particular example is in backup.php. There are 8 in total involving 'success'.

New member

Posts

Joined
Thu Oct 18, 2012 5:50 am

Post by dazmiller » Thu Oct 18, 2012 11:49 am

Hi,
quite easy to do in PHP

Code: Select all

 
$date = date('d/m/Y H:i:s');
echo $date;
will output the date.

To append to the message, add the date variable (note you can change the format of the outputted date see here http://www.php.net/manual/en/function.date.php) and then add the $date variable. This will append the date to the end of the string.

You can change the start of the message by editing your text in the associated language file.

Code: Select all

if ($content) {
$this->model_tool_backup->restore($content);
$date = date('d/m/Y H:i:s');				
$this->session->data['success'] = $this->language->get('text_success').' at '.$date;
Hope this helps

Darren

New member

Posts

Joined
Thu Aug 30, 2012 9:29 am
Location - Sydney, Australia
Who is online

Users browsing this forum: No registered users and 3 guests