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 | |
| $products = Mage::getModel('catalog/product')->getCollection() | |
| ->addFieldToFilter('type_id','simple') | |
| ->addFieldToFilter('status',1); | |
| $counter = 0; | |
| foreach ($products as $product) | |
| { | |
| if ($counter < 100) { |
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 | |
| $now = Mage::getModel('core/date')->date(); | |
| // output: 2013-10-09 12:00:27 | |
| $date = new DateTime(); | |
| $date = $date->modify('-1 day'); | |
| $yesterday = Mage::getModel('core/date')->date(null, $date->getTimestamp()); | |
| // output: 2013-10-08 12:01:51 |
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
| # find a file/folder which contains certain string | |
| find . -iname '*filename*' | |
| # count all files in current directory | |
| # -type f = files | |
| # wc -l = word count lines | |
| find . -type f | wc -l | |
| # diff commands | |
| # write diff results to file |
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
| # crontab -e | |
| */5 * * * * /bin/sh /var/www/src/cron.sh | |
| # system logging for cronjobs | |
| # tail -f /var/log/syslog | grep 'CRON' |
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
| $setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'custom_product_attribute', array( | |
| 'group' => 'General', | |
| 'input' => 'boolean', | |
| 'type' => 'int', | |
| 'label' => 'Attribute Label', | |
| 'source' => 'eav/entity_attribute_source_boolean', | |
| 'visible' => 1, | |
| 'required' => 0, | |
| 'user_defined' => 1, | |
| 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, |
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
| // error templates | |
| // Code exception | |
| http://website.com/errors/report.php?id=123456789 | |
| // 503 error | |
| http://website.com/errors/503.php | |
| // 404 error | |
| http://website.com/errors/404.php | |
| // Ogone template | |
| http://website.com/ops/payment/paypage/ |
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 | |
| require 'app/Mage.php'; | |
| Mage::init('admin'); | |
| $product = Mage::getModel('catalog/product')->load('123'); | |
| var_dump($product->getData()); |