rkk Posted June 5, 2019 Share Posted June 5, 2019 Is there a way to get a comprehensive look at all the variables assigned in loaded template? I've tried {debug} in different places but it doesn't go deep enough to show me the variables I need. For example, I want to see all variables assigned under the $product array. I can see $product.description referenced in the template, so I know there are more attributes of $product to work with. In themes/x/templates/catalog/product.tpl I put {debug} in the product_table block. The smarty debug console comes up, but only shows me: $product Array (2)value => PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductListingLazyArray Object (0)scope => "module:ps_featuredproducts/views/temp..." It doesn't even show that $product.description exists, even though it's defined in the template. How can I make {debug} more robust so I can see more? Something like a print_r($product); but for Smarty? Link to comment Share on other sites More sharing options...
rkk Posted June 13, 2019 Author Share Posted June 13, 2019 Nobody has any suggestions on finding all the available smarty variables available within a context? Something that goes deeper into objects than {debug} alone? Link to comment Share on other sites More sharing options...
NemoPS Posted June 14, 2019 Share Posted June 14, 2019 I am afraid {debug} is your only option. That's the only one I know to be honest Link to comment Share on other sites More sharing options...
rguillo Posted October 1, 2019 Share Posted October 1, 2019 Hi, You can try this : {$product|@var_dump} working on Smarty / Prestashop 1.7 For example, on a foreach loop : {foreach from=$listing.products item=product} {$product|@var_dump} {/foreach} You will get all informations about $product Object, instead of a single value "PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductListingLazyArray Object" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now