Posted on June 16, 2017, 8:27 am, by admin, under
Tips.
hen we do toHtml(), we render only single block, for example in Adminhtml sorting, when we click on field we want to render only single block not whole page public function gridAction() { $this->loadLayout(); // $this->getResponse()->setBody( // $this->getLayout()->createBlock(‘storelocator/adminhtml_entity_grid’)->toHtml() // ); // return $this; } but if we dont do toHtml() and follow with renderLayout() then […]
Posted on June 16, 2017, 8:26 am, by admin, under
Dictionary.
Block – In Magento, a Block is a piece of your website works “alone”, you can insert just anywhere. In fact, a block is a kind of “mini controller” that you can add anywhere in your site. According to the page on your site, you can assign it different templates based on the view that […]
Posted on June 16, 2017, 8:25 am, by admin, under
Tips.
By default, Magento will automatically connect to it’s database and provide two separate resources which you can use to access data: “core_read” and “core_write”. <?php /** * Get the resource model */ $resource = Mage::getSingleton(’core/resource’); /** * Retrieve the read connection */ $readConnection = $resource->getConnection(’core_read’); /** * Retrieve the write connection */ $writeConnection […]
Posted on June 13, 2017, 3:18 pm, by admin, under
Tips.
ALL Magento Models inherit from the Mage_Core_Model_Abstract class. Difference starts from the Resource object. All resources extend the base Mage_Core_Model_Resource_Abstract class but simple Models have a resource that inherits from Mage_Core_Model_Mysql4_Abstract (Mage_Core_Model_Resource_Db_Abstract), and EAV Models have a resource that inherits from Mage_Eav_Model_Entity_Abstract
Posted on June 13, 2017, 11:58 am, by admin, under
Tips.
Adminhtml Grid and Edit is possible to add from layout or it is possible to specify directly in Adminhtml controller for example: this way: app/design/adminhtml/default/default/layout/photo.xml <?xml version="1.0"?> <layout> <adminhtml_photograph_index> <reference name="content"> <block type="photo/adminhtml_photograph" name="photograph" /> </reference> </adminhtml_photograph_index> <adminhtml_photograph_edit> <reference name="content"> <block type="photo/adminhtml_photograph_edit" name="photograph_edit" /> </reference> </adminhtml_photograph_edit> </layout> or this way: public function indexAction() { … […]
This: $model = Mage::getModel(’shop/people’); comes from: app/local/VendorName/PluginName/etc/config.xml <models> <shop> <class>VisionDirect_StoreLocator_Model</class> <resourceModel>storelocator_mysql4</resourceModel> </shop> <shop_mysql4> <class>VisionDirect_StoreLocator_Model_Mysql4</class> <entities> <people> <table>storelocator_people</table> </people> </entities> </shop_mysql4> </models>
Posted on June 12, 2017, 10:45 am, by admin, under
Tips.
1. Firstly, create adminhtml.xml file and put there and blocks within . Alternatively, you can put to config.xml -> block. 2. In order to have path to controller working propertly, never forget to add block in config.xml 3. Also, put to either adminhtml.xml or alternatively to config.xml block.
In case you forgot admin password it is possible to reset it directly in db: SELECT * FROM admin_user WHERE username=’admin’; UPDATE admin_user SET password=MD5(’admin123’) WHERE username=’admin’;
Posted on June 9, 2017, 3:04 pm, by admin, under
Tips.
Rename the local.xml.sample in /errors to local.xml and you would be able to see the error and the entire stack trace
Posted on June 4, 2017, 10:45 am, by admin, under
Magento 1.x.
1. Go to Magento Admin Panel > System > Cache Management > Select all cache from left side checkboxes > Select Action: disable from right top dropdown > Click Submit