Post by rsmck » Sun Feb 19, 2012 5:47 am

I'm in the process of upgrading a store that's been running 1.4 for some time with various custom hacks in place and something which worked perfectly in 1.4 has me a little baffled in 1.5

Basically we need to know if the order has ever had 'complete' as a status, and amend a couple of other options in the template accordingly.

controller/sale/order.php has been modified as follows;

Code: Select all

$this->data['has_completed'] = 0;
foreach ($results as $result) {
     $this->data['histories'][] = array(
         'notify'     => $result['notify'] ? $this->language->get('text_yes') : $this->language->get('text_no'),
         'status'     => $result['status'],
         'comment'    => nl2br($result['comment']),
         'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])));
      if ($result['status'] == "Complete") { $this->data['has_completed'] = 1; }
}
And the template has been modified to use the variable $has_completed.

This worked fine in 1.4, and if I add var_dump($this->data); into the controller I can see the variable has been set, but the template just presents the following;

Notice: Undefined variable: has_completed in /store/admin/view/template/sale/order_info.tpl on line 96

Any advice anyone can offer would be much appreciate, other changes (to add a couple of tabs to the order_info.tpl) have worked as expected.. but this has me vexed.

Newbie

Posts

Joined
Sun Mar 20, 2011 9:01 am

Post by grgr » Sun Feb 19, 2012 5:23 pm

You have put the variable has_completed in the order_info template but created the variable in the order history() function. You need to put the variable in the order_history template or create the variable in the order info() function.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by rsmck » Mon Feb 20, 2012 4:55 am

Thanks - this has changed quite a bit from 1.4 then ; )

I've gone about it a completely different way - added a 'date_completed' to the order table and modified the model / controller / view etc appropriately.

Thanks for your help :)

Newbie

Posts

Joined
Sun Mar 20, 2011 9:01 am
Who is online

Users browsing this forum: Bing [Bot] and 80 guests