This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Returns boolean true or false */ | |
Mage::getConfig()->getModuleConfig('Namespace_Modulename')->is('active', 'true'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mage_Eav_Model_Entity_Attribute_Backend_Time_Created::beforeSave | |
файл app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php | |
http://magento.stackexchange.com/questions/18062/customer-created-at-date-off-by-months |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Простой пример, как сделать отладку(«дебаг») SQL-запросов в Magento, для коллекций продуктов. | |
Пример на коллекции продуктов, для показа на странице категории. | |
Откроем файл шаблона(template) template/catalog/product/list.phtml и добавим/изменим код | |
$_productCollection=$this->getLoadedProductCollection(); | |
$_productCollection->printLogQuery(true); | |
Добавили $_productCollection->printLogQuery(true); этот метод Magento будет выводить SQL-запрос, который делается чтобы получить список(коллекцию) продуктов из базы данных Magento. | |
SQL запрос Magento | |
Можно также записывать SQL-запросы в лог-файл, и не выводить броузере | |
$_productCollection->printLogQuery(false, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $this->getLayout()->createBlock('amfile/file')->toHtml() ?> | |
на Сms Page {{block type="myfolder/newfile" template="myfolder/newfile.phtml"}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/code/core/Mage/Core/Block/Template.php | |
public function getShowTemplateHints() | |
if($_SERVER['REMOTE_ADDR'] == '213.184.226.82') { | |
self::$_showTemplateHintsBlocks = true; | |
return true; | |
} |
NewerOlder