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 | |
define('DS', DIRECTORY_SEPARATOR); | |
define('PS', PATH_SEPARATOR); | |
define('BP', dirname(dirname(__FILE__))); | |
Mage::register('original_include_path', get_include_path()); | |
if (defined('COMPILER_INCLUDE_PATH')) { | |
$appPath = COMPILER_INCLUDE_PATH; | |
set_include_path($appPath . PS . Mage::registry('original_include_path')); |
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 | |
static public function register() | |
{ | |
spl_autoload_register(array(self::instance(), 'autoload')); | |
} | |
/** | |
* Load class source code | |
* | |
* @param string $class |
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 | |
$configurable = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); | |
$collection = $configurable->getUsedProductCollection(); | |
$collection->addAttributeToSelect('*'); | |
$collection->addFilterByRequiredOptions(); | |
foreach ($collection as $product) { | |
print_r($product->debug()); | |
} |
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 | |
public function getAllCategoryNames() | |
{ | |
$names = array(); | |
// Build out a category collection and add the name attribute to the select. | |
$model = Mage::getModel('catalog/category'); | |
$collection = $model->getCollection(); | |
$collection->addAttributeToSelect('name'); |
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 | |
/** | |
* Error reporting | |
*/ | |
error_reporting(E_ALL | E_STRICT); | |
/** | |
* Compilation includes configuration file | |
*/ | |
define('MAGENTO_ROOT', getcwd()); |
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
<?xml version="1.0"?> | |
<!-- | |
http://magento.stackexchange.com/questions/4748/how-rendering-of-price-phtml-in-catalog-product-listing-page-is-happening | |
http://magento.stackexchange.com/questions/14124/overriding-price-phtml-template-using-addpriceblocktype-in-magento-ce-1-7-0-2 | |
--> | |
<layout> | |
<default> |
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 | |
try | |
{ | |
$proxy = new SoapClient('./api/v2_soap/?wsdl'); | |
$sessionId = $proxy->login('XXXXX', 'XXXXX'); | |
$result = $proxy->giftcardAccountCreate( | |
$sessionId, | |
array( |
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 | |
$transaction = Mage::getModel('core/resource_transaction'); | |
$transaction->addObject($model_a) | |
$transaction->addObject($model_b) | |
$transaction->save(); |
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 | |
public function find($includeArgs = true) | |
{ | |
// ... | |
$dirs = array(PHP_BINDIR); | |
// ... | |
return $this->executableFinder->find('php', false, $dirs); |
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 | |
public function find($name, $default = null, array $extraDirs = array()) | |
{ | |
if (ini_get('open_basedir')) { | |
// ... | |
} else { | |
$dirs = array_merge( | |
explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), | |
$extraDirs |