tomdchi Posted September 14, 2013 Share Posted September 14, 2013 I am working on a addon that needs to know what products are in the shopping cart and I am trying to use the hook PreCalculateCartTotals. The problem is that this hook doesn't give much useful info other than the product id. I thought I had a solution when I put the cartsummary.tpl into debug mode and the smarty debug console showed a very detailed $products array of everything in the cart. Array (1) 0 => Array (12) pid => "3" domain => "" billingcycle => "monthly" configoptions => "" customfields => Array (0) addons => Array (0) server => "" productinfo => Array (9) pid => "3" gid => "2" type => "other" groupname => "test" name => "blah blaha" description => "" freedomain => "" freedomainpaymentterms => Array (1) 0 => "" freedomaintlds => Array (1) 0 => "" allowqty => "1" qty => 1 pricing => Array (5) baseprice => "$125.00 USD" setup => "$0.00 USD" recurring => Array (1) Monthly => "$125.00 USD" totaltoday => "$125.00 USD" recurringexcltax => Array (1) Monthly => "$125.00 USD" pricingtext => "$125.00 USD" PERFECT...not so fast... In my hook function I am grabbing the smarty vars like this: global $smarty; $tpl_vars = $smarty->get_template_vars(); Thought I was golden until I realized that the $tpl_vars array is not the same as what is in the smarty debug console. The products array is not there at all. Anyone have an idea of how to get this products array from smarty? This array has to be somewhere. I looked in the session array and nothing was there so I don't know where its hiding. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.