Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem dumping content of variable
 
troald
Jr. Member
 
Total Posts:  1
Joined:  2013-01-29
 

Hi,

I am new to writing Magento addons, but have made an attempt at making my own shipping module. As part of this I am trying to pass one additional field called “Note” as part of the carrier result, and I am doing some debugging to see why it currently isn’t working.

In the block Mage_Checkout_Block_Onepage_Shipping_Method_Available (public_html\m\app\code\core\Mage\Checkout\Block\Onepage\Shipping\Method\available.php)

Line number 28 says:

<?php $_shippingRateGroups $this->getShippingRates(); ?>

I am trying to list the content of this variable but I’m not able to do it using print_r, var_dump or ->debug() field.

When using Mage::log($_shippingRateGroups) nothing is included in the log file. However using a foreach loop I see that there seems to be some entries in the array.

Can anyone help?? smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

When the output from a var_dump or log is too big, nothing will be displayed.

Try:

foreach ($_shippingRateGroups as $group{
   Mage
::log($group->getData());
}

Don´t forget to enable logging in the configuration.

 
Magento Community Magento Community
Magento Community
Magento Community
 
creatviec123
Jr. Member
 
Total Posts:  3
Joined:  2012-12-26
India
 

Thanks for answring this quetion i am also looking for the same.!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top