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; | |
} |
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
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
Простой пример, как сделать отладку(«дебаг») 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_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
/* 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
app/Mage.php should look like: | |
public static function dispatchEvent($name, array $data = array()) | |
{ | |
// log event name | |
Mage::log($name, null, 'events.log', true); | |
Varien_Profiler::start('DISPATCH EVENT:'.$name); | |
$result = self::app()->dispatchEvent($name, $data); | |
#$result = self::registry('events')->dispatch($name, $data); |
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 | |
$str = '1'; | |
echo sprintf("%04d", $str); | |
// Выводит "0001" | |
?> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
{"lastUpload":"2020-06-27T10:14:49.762Z","extensionVersion":"v3.4.3"} |
OlderNewer