Jump to content

 

dansmithpm

Member Since 08 Feb 2012
Offline Last Active Dec 23 2012 11:17 PM
-----

Posts I've Made

In Topic: Creating addon - have list of orders in template

19 December 2012 - 11:25 PM

figured this out.- adding here in case it can help someone else

1. in my addon's func.php added custom function


function fn_getorderlist() {
$data=db_get_array('select concat(order_id,"%",total,"%",shipping_cost,"%",firstname," ",lastname,"%",email) as odata, order_id from ?:orders order by order_id desc;');
return $data;

}


in the main controller added

$view->assign('order_data',fn_getorderlist());

then in the template used {foreach} loop to create the select box, using the order_data. had an onchange javascript event to take the value, split to individual elements and apply the values to the relevant fields on the template.