Skip to content

Instantly share code, notes, and snippets.

protected function _initCategories()
{
$collection = Mage::getResourceModel('catalog/category_collection')->addNameToResult();
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
foreach ($collection as $category) {
$structure = preg_split('#/+#', $category->getPath());
$pathSize = count($structure);
if ($pathSize > 1) {
$path = array();
for ($i = 1; $i < $pathSize; $i++) {
<?xml version="1.0"?>
<config>
....
<frontend>
<events>
<controller_action_predispatch>
<observers><log><type>disabled</type></log></observers>
</controller_action_predispatch>
<controller_action_postdispatch>
<observers><log><type>disabled</type></log></observers>
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$installer->getTable('weblog/blogpost')};
CREATE TABLE {$installer->getTable('weblog/blogpost')} (
`blogpost_id` int(11) NOT NULL auto_increment,
`title` text,
`post` text,
<?php
class Custom_ERP_Model_Observer
{
public function implementOrderStatus(Varien_Event_Observer $observer)
{
if ($this->_supplierArray) {
foreach ($this->_supplierArray as $supplierID => $productList) {
$resource = Mage::getSingleton('core/resource');
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>REDACTED - Processing</title>
<?php include 'uyt_2013_01/global-header.php'; ?>
<link rel="stylesheet" type="text/css" href="/css/global.css" />
<link rel="stylesheet" type="text/css" href="/css/thankyou.css" />
<script type='text/javascript'>
$(document).ready(function() {
UPDATE `catalog_category_entity_int` `e`
LEFT JOIN `eav_attribute` `a`
ON `a`.`attribute_id` = `e`.`attribute_id`
SET `e`.`value` = 1
WHERE `a`.`attribute_code` = 'is_anchor'
<?php
class Mdunbar_Loyalty_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
{
public function getDefaultEntities()
{
return array(
'customer' => array(
'entity_model' => 'customer/customer',
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mdunbar_Loyalty>
<version>1.0.0</version>
</Mdunbar_Loyalty>
</modules>
<global>
<resources>
<loyalty_setup>
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
array(40) {
["MANPATH"]=>
string(26) "/usr/lib/courier-imap/man:"
["HOSTNAME"]=>
string(25) "magdev.inverseparadox.net"
["TERM"]=>
string(5) "xterm"
["SHELL"]=>
string(9) "/bin/bash"
["HISTSIZE"]=>