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 | |
$attributeUtility = Mage::getModel('core/setup'); | |
$attributeUtility->addAttribute('catalog_category', 'attribute_code', | |
array( | |
'sort_order' => '0', | |
'backend_type' => 'int', | |
'input' => "boolean", | |
'label' => 'Custom Attribute Label', | |
'source_model' => 'eav/entity_attribute_source_boolean', |
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
yum update -y | |
yum install inotify-tools | |
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/i/inotify-tools-devel-3.14-8.el7.x86_64.rpm | |
rpm -Uvh http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.12.0-1.el7.centos.x86_64.rpm |
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 | |
// http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/ | |
<?php | |
$installer = $this; | |
$setup = new Mage_Eav_Model_Entity_Setup('core_setup'); | |
$installer->startSetup(); | |
/** | |
* Adding Different Attributes | |
*/ |
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
function getLastLine($file, $bufferSize){ | |
$fp = fopen($file, 'r'); | |
$size = filesize($file); | |
$buffer = ''; | |
for ($pos = $size - $bufferSize; ; $pos -= $bufferSize) { | |
$pos = max(0, $pos); | |
fseek($fp, $pos); | |
$b = rtrim(fread($fp, $bufferSize)); | |
$nlPos = strrpos($b, "\n"); |
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
delete FROM `catalog_product_entity_datetime` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_decimal` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_gallery` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_group_price` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_int` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_media_gallery` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_text` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_tier_price` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_varchar` where entity_id not in (select entity_id fro |
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 -d apc.enable_cli=0 magerun |
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
# install as superuser | |
wget http://files.magerun.net/n98-magerun-latest.phar -O magerun && chmod +x magerun && mv magerun /usr/local/bin/ |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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 | |
// Base-name | |
$name = 'foobar'; | |
// Init Magento | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
// Create the root catalog |