This topic is locked

Orderdetails_childnumber replacement

1/6/2009 1:14:17 AM
PHPRunner General questions
G
Geoffww author

Trying to figure out how to use a different value in place of the default.
On the live demo #1 on the Orders_list page fourth column are links called Order details. There is the option to include the order details child number in this link. Such as Order details (6) 6 being the number of details with that order. I need to change this number to instead be the total quantity of all the orders' details.

For example in my order details are Model Color and Quantity columns. I'd like the orderdetails_childnumber to instead be the grand total of the detail's quantities.
Total details: 3

Model Color Quantity

1aRed4

1aBlue9

2c_Green1
____Total:14
Again I'd like the aformetioned link in Orders_list to reflect the value 14 in lieu of 3 so it's quick and easy to see how many total pieces in an order on the list page.
I've made a few different attempts at producing the value in that link but having no success. Any suggestions?
Thanks.

J
Jane 1/6/2009

Hi,
you can calculate quantity manually in the List page: After record processed event on theEvents tab.

Here is just a sample:

$rs = CustomQuery("select sum(Quantity) from DetailTable where DetailKey=".$data["MasterKey"]);

$data2 = db_fetch_numarray($rs);

$record["DetailTable_childnumber"]=$data2[0];