Orders Gateway Template - how to access deeply nested item array
Posted: Tue Aug 04, 2009 1:37 pm
Hi folks.
I've been working on my first implementation of Products, Orders, Cart, PaypalGateway for the past couple of weeks.
Thanks to Calguy and others excellent work on these modules, everything is working great!
However, I am having difficulty figuring out how to access the Orders->items object in the Gateway Template (after the order comes back from the gateway).
I used {get_template_vars} and {$order|@print_r} to obtain this structure of the object:
However, I haven't been able to figure out how to print_r or access the items.
I tried {$order->items|@print_r} but that just returns a 1.
Thanks for any help!
Cart 1.4.2
Products 2.4
Orders 1.4
PaypalGateway 2.0
CGPaymentGatewayBase 1.0
I've been working on my first implementation of Products, Orders, Cart, PaypalGateway for the past couple of weeks.
Thanks to Calguy and others excellent work on these modules, everything is working great!
However, I am having difficulty figuring out how to access the Orders->items object in the Gateway Template (after the order comes back from the gateway).
I used {get_template_vars} and {$order|@print_r} to obtain this structure of the object:
Code: Select all
$Order
225JoeSmith3610 River RoadMendotaVA24270US2766693455joeSmith@gmail.com0.02000.02proposed2009-08-04 07:16:242009-08-04 07:16:24Array ( [0] => Array ( [id] => 3 [order_id] => 2 [shipping_first_name] => Joe [shipping_last_name] => Smith [shipping_address1] => 3610 River Road [shipping_address2] => [shipping_city] => Mendota [shipping_state] => VA [shipping_postal] => 24270 [shipping_country] => US [shipping_phone] => 2766693455 [shipping_fax] => [shipping_email] => joeSmith@gmail.com [shipping_message] => [subtotal] => 0.02 [tax] => 0 [shipping_cost] => 0 [total] => 0.02 [weight] => 0 [create_date] => 2009-08-04 07:16:24 [modified_date] => 2009-08-04 07:16:24 [items] => Array ( [0] => Array ( [id] => 3 [order_id] => 2 [shipping_id] => 3 [item_id] => 1 [quantity] => 2 [product_name] => Test Payment [details] => [price] => 0.01 [weight] => 0 [status] => notshipped [create_date] => 2009-08-04 07:16:24 [modified_date] => 2009-08-04 07:16:24 ) ) ) ) Array
$item
32312Test Payment 0.010notshipped2009-08-04 07:16:242009-08-04 07:16:24Array
I tried {$order->items|@print_r} but that just returns a 1.
Thanks for any help!
Cart 1.4.2
Products 2.4
Orders 1.4
PaypalGateway 2.0
CGPaymentGatewayBase 1.0