either you foreach the $data['Order']['Orderline'] and calculate the sum of (price * quantity) or either you add a sum field in your orders table thats is modified when you add/edit/delete an orderline (maybe by an afterSave callback)
On 26 fév, 18:54, "mike" <[EMAIL PROTECTED]> wrote: > I have searched this board high and low and cannot find a solution to > this problem > > On Feb 26, 12:24 pm, "mike" <[EMAIL PROTECTED]> wrote: > > > I have setup table relations so that Order brings in Orderlines, but > > this leads me to another problem. I somehow need to total the order > > but this isn't as easy as I first thought. I'm wondering if anyone can > > give any help on how to do this, probably a for loop i would think? > > > Thanks very much any help greatly appreciated!! > > > [0] => Array > > ( > > [id] => 1 > > [ord_id] => 110 > > [price] => 12.00 > > ) > > > [1] => Array > > ( > > [id] => 2 > > [ord_id] => 110 > > [price] => 3.00 > > ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
