It seems very basic, but I stuck on this one.
$value = 0;
foreach($this->products->result() as $this->product)
{
$value += $this->product->price;
}
//$value += $this->get_order_shipping_cost($orders_id);
return $value;
The value supposed to get added to create total price and then outside the loop to add a shipping cost, but for some reason my loop is returning only the first value, so I am overwriting something somewhere.
$this->products->result()what is this ? is it an array of products ?