This file contains 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
<reference name="product.info.additional"> | |
<block type="cms/block" name="product.info.addtional.foo"> | |
<action method="setBlockId"><block_id>my_block_identifier</block_id></action> | |
</block> | |
</reference> |
This file contains 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 | |
Mage::app()->getLayout()->getNode()->asNiceXml('/tmp/foo'); |
This file contains 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 | |
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Collection */ | |
//note for 1.6 collection class is Mage_Catalog_Model_Resource_Product_Attribute_Collection | |
$collection = Mage::getResourceModel('catalog/product_attribute_collection') | |
->setItemObjectClass('catalog/resource_eav_attribute') | |
->setCodeFilter(ATTRIBUTE_CODE) | |
->addStoreLabel(Mage::app()->getStore()->getId()) | |
->load(); | |
/* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ | |
$attribute = $collection->getFirstItem(); |
This file contains 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
if (formatCurrency) {//Encapsulate formatCurrency to prevent global variable leaking.... | |
formatCurrency = (function(f) { | |
var origMethod = Object.clone(f); | |
return function(price, format, showPlus) { | |
return origMethod(price, format,showPlus); | |
}; | |
}(formatCurrency)); | |
} |
This file contains 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
.buildpath | |
.htaccess | |
.htaccess.sample | |
.settings | |
.project | |
app/etc/local.xml | |
app/code/community/Find/ | |
app/code/community/Phoenix/ | |
app/code/core/ | |
app/design/adminhtml/default/default/ |
This file contains 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
class Foo { | |
public $x = null; | |
} | |
$a = new Foo(); | |
$b = new Foo(); | |
$c = new Foo(); | |
$d = new Foo(); | |
$a->x = $c; |
This file contains 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
#/usb/bin/php | |
<?php | |
//author rgranadino aug 22 2012 | |
//tested on a D-Link DIR-615 B2 v2.25 firmware. | |
//this is a php translation of: | |
// http://www.shulerent.com/2009/08/21/cracking-the-d-link-settings-file/ | |
$file = $argv[1]; | |
if (!is_readable($file)) { | |
echo "Cannot read file: $file\n"; |
This file contains 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
#!/usr/bin/env php | |
<?php | |
require 'app/Mage.php'; | |
if (!Mage::isInstalled()) { | |
echo "Application is not installed yet, please complete install wizard first."; | |
exit(1); | |
} | |
$baseDir = getcwd(); | |
//not sure if this is necessary, ported over from cron.php script | |
$_SERVER['SCRIPT_NAME'] = $baseDir.'/index.php'; |
This file contains 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
public function syncConfigProductAttributes(Mage_Catalog_Model_Product $product) | |
{ | |
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { | |
/* @var $productType Mage_Catalog_Model_Product_Type_Configurable */ | |
$productType = $product->getTypeInstance(true); | |
$syncAttributes = array('short_description', 'description'); | |
foreach ($productType->getUsedProductCollection($product) as $childProduct) { | |
//$childProduct->load($childProduct->getId()); | |
/* @var $childProduct Mage_Catalog_Model_Product */ | |
foreach ($syncAttributes as $attributeCode) { |
This file contains 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 | |
class Email { | |
//... | |
public function setAttachments(array $files) { | |
$this->attachment_list = array(); | |
foreach($files as $filename => $file) { | |
if (is_str($filename)) { | |
$this->addAttachment($file, $filename); | |
} else { |
OlderNewer