I got 4 records in the carts db. I got the result: 4444. How can I change the result to 1234 instead?
View:
$i = 0;
foreach($carts AS $cart) {
$x = $i+1;
echo $x;
}
Controller:
function confirm() {
$orders = $this->data;
$sessionId = $this->passedArgs['ct_session_id'];
$this->set('data', $sessionId );
$carts = $this->Cart->find(
'all',
array('conditions' => array('Cart.ct_session_id' => $sessionId), 'recursive' => 1)
);
$this->set(compact('carts', 'orders'));
}