These set of scripts are for Magento 1. For Magento 2, see this Gist.
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
#!/bin/bash | |
# Author: Colin Mollenhour | |
# | |
# Usage: Run from the webroot, .htaccess-combined will be created. | |
dest='.htaccess-combined' | |
pwd=`pwd` | |
echo -n "" > $dest | |
while read -r file; do | |
loc=`dirname $file` |
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
SET @entityid = '3'; | |
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type' | |
FROM catalog_category_entity e | |
JOIN catalog_category_entity_varchar eav | |
ON e.entity_id = eav.entity_id | |
JOIN eav_attribute ea | |
ON eav.attribute_id = ea.attribute_id | |
WHERE e.entity_id = @entityid | |
UNION |
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
Windows Registry Editor Version 5.00 | |
; | |
; Running this file will give you an extra context menu item in Windows Explorer | |
; "Delete SVN folders" | |
; | |
; For the selected folder, it will remove all subfolders named ".svn" and their content | |
; Tip from http://www.iamatechie.com/remove-all-svn-folders-in-windows-xp-vista/ | |
; | |
; Enrichened with comments by Jesper Rønn-Jensen ( http://justaddwater.dk/ ) | |
; |
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
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel(" | |
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel(" | |
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton(" | |
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']" | |
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape(" | |
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape(" | |
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']" | |
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]" | |
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct" | |
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct" |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/ | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 $installer Mage_Eav_Model_Entity_Setup */ | |
$installer = Mage::getModel('eav/entity_setup', 'default_setup'); | |
$installer->startSetup(); | |
// Example createEntityTables() call | |
$installer->createEntityTables('example_supplier'); |
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 | |
namespace Pokus; | |
class Exception extends \Exception | |
{ | |
} | |
function tttt($string) | |
{ | |
try { |
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
-- assuming Magento 1.6.1 data model | |
SELECT DISTINCT customer_email, | |
COUNT(*) AS purchases, | |
(SELECT LEFT(created_at,11) FROM `sales_flat_order` WHERE customer_email = a.customer_email ORDER BY created_at DESC LIMIT 0,1) AS last_purchase, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%IB%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS icebreaker, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%TNF%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS the_north_face, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MHW%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS mountain_hardwear, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MAR%' AND order_id IN (SELECT entity_id FROM `sales |
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
$attributeSetName = 'Editorial Product'; | |
// active_from | |
$entityTypeId = Mage::getModel('eav/entity') | |
->setType('catalog_product') | |
->getTypeId(); | |
$setId = $installer->getAttributeSet($entityTypeId, $attributeSetName, 'attribute_set_id'); | |
// Add attribute set if it does not exists | |
if($setId === null) { |
OlderNewer