Jump to content

Echo/Print info from Array from Session Variable


jay83rr

Recommended Posts

Hi I have a session $_SESSION['pdf_quote'] which has a number of variables which i can easily echo/print. But... in the same session i have 2 arrays. I have no idea how to echo/print the contents of what is in the arrays.

These are the arrays
[product_arr] => Array
and
[extra_arr] => Array

when i run that i get the following but it still won't show me the contents of product_arr 

 

i think i need to implode to get the array... but thats where i get lost.

Array(    [id] => 46    [location_id] => 4    [type] => pickup    [status] => pending    [payment_method] => none    [is_paid] => 0    [txn_id] =>     [processed_on] =>     [price_subtotal] => 3125.00    [price_delivery] => 0.00    [price_total] => 3125.00    [voucher_code] =>     [created] => 2013-10-15 21:12:20    [p_dt] => 2013-10-25 08:00:00    [d_address_1] =>     [d_address_2] =>     [d_country_id] =>     [d_state] =>     [d_city] =>     [d_zip] =>     [d_notes] =>     [d_dt] =>     [c_name] => test    [c_email] => [email protected]    [c_phone] => 8298392832    [c_address_1] => eokeoj    [c_address_2] =>     [c_notes] =>     [c_country] =>     [c_state] => test    [c_city] =>     [c_zip] => 2000    [cc_type] =>     [cc_num] =>     [cc_code] =>     [cc_exp] =>     [product_arr] => Array        (            [0] => Array                (                    [extra_arr] => Array                        (                        )                )        ))

 

 

I'm guessing these are stored in the array that i can't see the contents of.

Try looking to see what is stored within the whole of $_SESSION variable

printf('<pre>%s</pre>', print_r($_SESSION, true));

If the product info is not in the session then your shopping cart is most likely storing the products information within the database. The $_SESSION['pdf_quote']['id'] varibale could hold the product id, This is used in database query to get the products information.  You will want to look at your shopping carts documentation on how it stores and retrieves products in the database.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.