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.
i think this is where the overwrite heapens:
i don’t know what you’re doing before but maybe you could use a temp variable name in the for loop like this:
hope it works 😉
greets, stefan