Welcome Guest, Not a member yet? Register   Sign In
How to Fetch Single Cart Options Value?
#1

[eluser]ginteno[/eluser]
Hi i want to get a single specific value within cart options.. how do i get the value
form this data array...

Code:
$data = array(
       'id'      => 11,
       'qty'     => 1,
       'price'   => 222,
       'name'    => 'test',
       'options' => array('inventory' => 888)
    );

i want to fetch the inventory value.. how i do that??
#2

[eluser]Tim Brownlaw[/eluser]
You just need to walk down the array... like so...


Code:
$data = array(
       'id'      => 11,
       'qty'     => 1,
       'price'   => 222,
       'name'    => 'test',
       'options' => array('inventory' => 888)
    );


echo $data['options']['inventory'];


Displays: 888

Cheers




Theme © iAndrew 2016 - Forum software by © MyBB