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->_addContent($this->getLayout()->createBlock('photo/adminhtml_photograph'));
$this->renderLayout();
}
public function editAction()
{
...
$this->_addContent($this->getLayout()->createBlock('photo/adminhtml_photograph_edit'));
$this->renderLayout();
} |
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
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
Posted
on June 4, 2017, 10:40 am,
by admin,
under
Tips.
The only thing different in Magento’s MVC model that is different from other MVCs is the way it uses Block. In normal MVC, variables are passed to the View through Controller. However, in Magento, Views get data from Block, and Block gets its data from Model.
Posted
on June 18, 2016, 3:25 pm,
by admin,
under
Magento 2.0.
<?php
namespace Imran\Test\Controller\Index;
use \Magento\Framework\App\Action\Action;
class Index extends Action
{
/**
* @var \Magento\Framework\View\Result\Page
*/
protected $resultPageFactory;
/**
* @param \Magento\Framework\App\Action\Context $context
*/
public function __construct(\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
$this->resultRedirectFactory->create()->setUrl('https://www.someurl.com');
}
} |
Posted
on April 23, 2016, 12:33 pm,
by admin,
under
Magento 1.x.
CE – Community Edition
PE – Professional Edition
EE – Enterprise Edition
CE 1.9 – ZF 1.12.3
CE 1.5 – CE 1.8 – ZF 1.11.1
CE 1.4.2.0 – ZF 1.10.8
CE 1.4.0.1 – ZF 1.9.6
CE 1.3.2.1 – ZF 1.7.2
CE 1.2.0.1 – ZF 1.7.2
CE 1.1.6 – ZF 1.5.1
CE 1.0.19870.4 – ZF 1.5.1
PE 1.11 – ZF 1.11.1
PE 1.10 – ZF 1.11.1
EE 1.14 – ZF 1.12.3
EE 1.10 – 1.13 – ZF 1.11.1
EE 1.9.1.1 – ZF 1.10.8