I have create module for testing in Magento and i call change action url from browser and there SQL query for catalog/product is printed.
I user this code
<?php
class Test_Demo_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$block = $this->getLayout()->createBlock('capacityweb/Test','Test',array('template' => 'capacity/web/test.phtml'));
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
public function changeAction()
{
$this->loadLayout();
$this->renderLayout();
$action=$this->getRequest()->getParam('action');
$id=$this->getRequest()->getParam('id');
if($action!=null && $id!=null)
{
$relContact = Mage::getModel('catalog/product')->getCollection()->load($id);
}
}
}
if i use
$relContact = Mage::getModel('catalog/product')->getCollection()->load($id);
then magento display SQL query but instead of this
i use
$relContact = Mage::getModel('catalog/product')->getCollection();
then magento not display anything.
So how to fix issue with
$relContact = Mage::getModel('catalog/product')->getCollection()->load($id);