Skip to content

Instantly share code, notes, and snippets.

// Drop this javascript in the page where your grid is - maybe using a .phtml
// in before_body_end or whatever.
$$(".admin-autoemail-adminhtml-rule-index td:contains('Inactive')").each(function(status) {
$(status).up().select('td, a').invoke('setStyle',{ color: '#aaa' });
});

Debugging (Resource) Model Instantiation

Follow each step manually and any bugs during (resource) model instantiation will become obvious.

Since many people find model and resource model instantiation to be one of the more challenging things in Magento 1, these are all the steps Magento does to resolve the factory name to the real PHP class name.

To debug, simply follow each step manually until you find a non-match. This works really well in my experience.
Less guessing, more and faster results.

In the examples I use a factory name of "example/thing".

class Sample_Model_Observer
{
protected $colToAdd = 'colname';
/**
* @param Varien_Event_Observer $observer
*/
public function urapidflow_profile_action( $observer )
{
$action = $observer->getData( 'action' );
$profile = $observer->getData( 'profile' );
ytp923p92gjp923galkjew;klajsd;lgjasl;dgjjzij;lkj;lkjl;;¬…¬˚¬˚∆˚∆∆¬∆…øˆp;.lojmu•ºª•¨ª¨¨øˆø¨øjjklła ?:>l,./;;l,kmjn mk,bvhn098765tr4890p8iu7t5r4ety67890-=0p9sgw32g23g /'/
<?php
/**
* Magento version/edition helper for determining the Magento BASE version (regardless of edition) and adds functions to check if Enterprise, Professional or Community are being run.
* Adds isMageCommunity(), isMageProfessional() and isMageEnterprise()
*
* @category TBT
* @package TBT_Rewards
* @author WDCA Sweet Tooth Team <contact@sweettoothhq.com>
*/
class TBT_Rewards_Helper_Version extends Mage_Core_Helper_Abstract {
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA[]]></var>
<var name="fieldnames"></var>
<var name="map">
<map name="sku"><![CDATA[sku]]></map>
<map name="image"><![CDATA[image]]></map>
<map name="image_label"><![CDATA[image_label]]></map>
<map name="small_image"><![CDATA[small_image]]></map>
<map name="small_image_label"><![CDATA[small_image_label]]></map>
#!/usr/bin/env php
<?php
//
// PHP REPL with initialized Magento environment
//
// Thanks to https://github.com/d11wtq/boris
//
// Drop this script in your $PATH and run it anywhere in a Magento directory tree to start the REPL
//
@philwinkle
philwinkle / addPingdomProbesToDebugList.php
Last active December 19, 2015 18:39
Update using Zend_Feed_Rss
<?php
require_once 'app/Mage.php';
Mage::app();
$xml = new Zend_Feed_Rss('https://my.pingdom.com/probes/feed');
$debugIps = Mage::getStoreConfig('dev/restrict/allow_ips');
if($debugIps) {
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php