Scaling Magento presentation with 60 slides and notes, which was then reviewed by Alan Storm.
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 | |
| /** | |
| * changeAttributeSetImport.php | |
| * Allows you to change the attribute set for a list of skus | |
| * | |
| * @author Tegan Snyder <tsnyder@mmm.com> | |
| */ | |
| /* | |
| Preparing your 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
| <?php | |
| /* | |
| n98-magerun url formater to CSV | |
| usuage: n98-magerun.phar config:get web/ | php n98-urls-to-csv.php > csv-of-urls.csv | |
| */ | |
| $str = stream_get_contents(fopen("php://stdin", "r")); | |
| $str = str_replace("+","",$str); |
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_once 'app/Mage.php'; | |
| umask(0); | |
| Mage::app('default'); | |
| $cat_id = 2117; | |
| $skus = 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 | |
| define('MAGENTO', realpath(dirname(__FILE__))); | |
| require_once MAGENTO . '/app/Mage.php'; | |
| Mage::app(); | |
| $category = Mage::getModel ('catalog/category'); | |
| $tree = $category->getTreeModel(); | |
| $tree->load(); |
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
| rsync -chavzP --exclude='path/to/installation/var/cache' --exclude='path/to/installation/.git' --exclude='path/to/installation/media/catalog/product/cache' --exclude='path/to/installation/var/tmp' --exclude='path/to/installation/var/session' --exclude='kiboots/var/report' --stats username@host:path/to/installation /destination/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
| # in case you just did a yum install of mysql and php and need to upgrade use the remi repo | |
| wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
| rpm -ivh epel-release-6-8.noarch.rpm | |
| wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
| rpm -Uvh remi-release-6*.rpm | |
| yum --enablerepo=remi upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml |
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
| SELECT sku, GROUP_CONCAT(entity_id) as category_ids FROM ( | |
| SELECT c3.sku, c2.entity_id | |
| FROM catalog_category_product c1 | |
| INNER JOIN catalog_category_entity_varchar c2 ON (c1.category_id = c2.entity_id) | |
| INNER JOIN catalog_product_entity c3 ON (c1.product_id = c3.entity_id) | |
| WHERE c2.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 3) | |
| ) main | |
| GROUP BY sku |
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
| ## change c2.entity_id to category id | |
| SELECT c3.sku, si.created_at as purchase_date, increment_id | |
| FROM catalog_category_product c1 | |
| INNER JOIN catalog_category_entity_varchar c2 ON (c1.category_id = c2.entity_id) | |
| INNER JOIN catalog_product_entity c3 ON (c1.product_id = c3.entity_id) | |
| INNER JOIN sales_flat_order_item si ON (si.product_id = c3.entity_id) | |
| INNER JOIN sales_flat_order so ON (so.entity_id = si.order_id) | |
| WHERE c2.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 3) | |
| AND c2.entity_id = 2117 |
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
| SELECT cat_id, SUM(row_total) as total_sales_by_cat, cv.value FROM ( | |
| SELECT c2.entity_id as cat_id, si.row_total | |
| FROM catalog_category_product c1 | |
| INNER JOIN catalog_category_entity_varchar c2 ON (c1.category_id = c2.entity_id) | |
| INNER JOIN catalog_product_entity c3 ON (c1.product_id = c3.entity_id) | |
| INNER JOIN sales_flat_order_item si ON (si.product_id = c3.entity_id) | |
| WHERE c2.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 3) | |
| ORDER BY si.created_at DESC | |
| ) main | |
| INNER JOIN catalog_category_entity_varchar cv ON (cv.entity_id = cat_id) |