
Originally Posted by
coxdabd
PHP Code:
$item = array(
'id' => $product->repair_id,
'qty' => 1,
'price' => 0.00,
'name' => $product->name.' '.$product->repair_name,
'img' => $product->repair_image,
'link' => 'fix/'.$product->url,
'options' => array('price' => 5.60, 'name' => 'Screen'), array('price' => 5.60, 'name' => 'New Battery')
);
Side note: What you've defined there is not a multidimensional array. I -think- you did this just as an example, but what you meant was an array of arrays...
PHP Code:
'options' => array(array('price' => 5.60, 'name' => 'Screen'), array('price' => 5.60, 'name' => 'New Battery'))
The initial code would have looked like:
PHP Code:
$item = array(
'id' => $product->repair_id,
'qty' => 1,
'price' => 0.00,
'name' => $product->name.' '.$product->repair_name,
'img' => $product->repair_image,
'link' => 'fix/'.$product->url,
'options' => array('price' => 5.60, 'name' => 'Screen'),
0 => array('price' => 5.60, 'name' => 'New Battery')
);
Bookmarks