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 | |
$attributeId = Mage::getResourceModel('eav/entity_attribute') | |
->getIdByCode('catalog_product', 'color'); |
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 | |
/** | |
* MAGENTO_ROOT_DIR/unused.php | |
* php -f unused.php | |
*/ | |
$mageFilename = 'app/Mage.php'; | |
if (!file_exists($mageFilename)) { | |
echo $mageFilename." was not found"; |
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 | |
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; | |
$encoder = new MessageDigestPasswordEncoder(); | |
echo $encoder->encodePassword('foo', ''); | |
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg== |
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 Mage_Catalog_Helper_Product_Flat $helper */ | |
$process = Mage::helper('catalog/product_flat')->getProcess(); | |
$status = $process->getStatus(); | |
$process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING); | |
/** @var $collection Mage_Catalog_Model_Resource_Product_Collection */ | |
$collection = Mage::getResourceModel('catalog/product_collection'); // Use EAV tables | |
// ... custom stuff |
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 | |
/* | |
Edit file vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php | |
and add the following code at line 237 | |
*/ | |
$sqlQuery = $sql; | |
if (is_string(key($bind))) { | |
foreach ($bind as $field => $value) { | |
$sqlQuery = str_replace($field, $this->quote($value), $sqlQuery); |
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 | |
/** | |
* Copy all images from $productSrc to $productDest | |
* | |
* @param Mage_Catalog_Model_Product $productSrc | |
* @param Mage_Catalog_Model_Product $productDest | |
*/ | |
public function copyProductImages(Mage_Catalog_Model_Product $productSrc, Mage_Catalog_Model_Product $productDest) | |
{ | |
$images = array(); |
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
<?xml version="1.0"?> | |
<!-- app/code/Namespace/Test/etc/di.xml --> | |
<config> | |
<type name="Magento\Module\Updater\SetupFactory"> | |
<param name="resourceTypes"> | |
<value> | |
<test_setup>Magento\Core\Model\Resource\Setup</test_setup> | |
</value> | |
</param> | |
</type> |
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
<Files *.js.gz> | |
AddType "text/javascript" .gz | |
AddEncoding gzip .gz | |
</Files> | |
<Files *.css.gz> | |
AddType "text/css" .gz | |
AddEncoding gzip .gz | |
</Files> | |
# Check to see if browser can accept gzip files. |
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 | |
// app/code/community/JR/Search/Model/Resource/Catalog/Product/Collection.php | |
// Making an override would be better! | |
protected function _getParams() | |
{ | |
$store = Mage::app()->getStore($this->getStoreId()); | |
$params = array(); | |
$params['locale_code'] = $store->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE); | |
$params['filters'] = $this->_searchQueryFilters; |
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 | |
// app/code/local/Namespace/Module/Model/Indexer/Group.php | |
class Namespace_Module_Model_Indexer_Group extends Bubble_Launcher_Model_Indexer_Abstract | |
{ | |
protected function _buildIndexData() | |
{ | |
$data = array(); | |
$collection = Mage::getModel('customer/group')->getCollection(); |
NewerOlder