How to do var_dump () die in magento downloadble products

I want to do var_dump (); die; to get a downloadable product model,

I tried to add this method when admin click to download information donwadle magento \ app \ design \ frontend \ rwd \ default \ template \ downloadable \ catalog \ product \ links.phtml in _prepareLayout (), but the process does not work as shown in figure.

 protected function _prepareLayout()
{
    $this->setChild(
        'upload_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array(
            'id'      => '',
            'label'   => Mage::helper('adminhtml')->__('Upload Files'),
            'type'    => 'button',
            'onclick' => 'Downloadable.massUploadByType(\'links\');Downloadable.massUploadByType(\'linkssample\')'

        ))



    );
    $links=Mage::getModel('downloadable/link')
    ->getCollection()
    ->addFieldToFilter('product_id',array('eq'=>$productid));

    var_dump($links);die;
}

      

+3


source to share


1 answer


Try using Zend_Debug:

Zend_Debug::dump($product->debug())

      

When you try to var_dump a lot of data models, it will lead to an error or slow down your computer. If you use Zend_Debug instead of magento var_dump, it will limit the data that will be displayed, but will not cause your computer to fail.

Try it!



If the "$ links-> debug ()" throw error method uses this directly:

Zend_Debug::dump($links)

      

Font: http://www.atwix.com/magento/debugging-hints/

0


source







All Articles