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
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz | |
tar -xzvf magento-1.7.0.2.tar.gz | |
rm magento-1.7.0.2.tar.gz | |
cd magento | |
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz | |
tar -xzvf magento-sample-data-1.6.1.0.tar.gz | |
mv magento-sample-data-1.6.1.0/media/* media/ | |
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql data.sql | |
mysql -u magie -p | |
# On mysql shell |
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 | |
# convertImages.sh | |
# Author: Peter Jaap Blaakmeer (elgentos.nl) | |
# https://gist.github.com/peterjaap/7080989 | |
NEWQUALITY=80 | |
NEWSIZE=1000 | |
DIRECTORY=media/catalog/product/ | |
du -hs $DIRECTORY | |
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 | |
protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId) | |
{ | |
$products = array(); | |
$websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); | |
$adapter = $this->_getReadAdapter(); | |
if ($productIds !== null) { | |
if (!is_array($productIds)) { | |
$productIds = array($productIds); |
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 | |
require_once("app/Mage.php"); | |
Mage::app(); | |
$orders = Mage::getModel('sales/order')->getCollection(); | |
$i = 0; | |
foreach ($orders as $key => $order) { | |
if (!$i) { | |
$startDate = strtotime($order->getCreatedAt()); |
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 | |
/* | |
* This script deletes duplicate images and imagerows from the database of which the images are not present in the filesystem. | |
* It also removes images that are exact copies of another image for the same product. | |
* And lastly, it looks for images that are on the filesystem but not in the database (orphaned images). | |
* | |
* This script can most likely be optimized but since it'll probably only be run a few times, I can't be bothered. | |
* | |
* Place scripts in a folder named 'scripts' (or similar) in the Magento root. |
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
<catalogsearch_result_index translate="label"> | |
<reference name="head"> | |
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action> | |
</reference> | |
</catalogsearch_result_index> | |
<catalogsearch_advanced_index translate="label"> | |
<reference name="head"> | |
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action> | |
</reference> | |
</catalogsearch_advanced_index> |
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
SELECT @ATTRIBUTE_ID := attribute_id FROM eav_attribute WHERE attribute_code = 'ATTRIBUTE_CODE'; | |
UPDATE eav_attribute SET backend_model = 'eav/entity_attribute_backend_array', backend_type = 'varchar', frontend_input = 'multiselect' WHERE attribute_id = @ATTRIBUTE_ID; | |
INSERT INTO catalog_product_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) SELECT entity_type_id, attribute_id, store_id, entity_id, value FROM catalog_product_entity_int WHERE attribute_id = @ATTRIBUTE_ID; | |
DELETE FROM catalog_product_entity_int WHERE attribute_id = @ATTRIBUTE_ID; |
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
<? | |
// Preliminary work | |
error_reporting(E_ALL); | |
$start = microtime(true); | |
require 'app/Mage.php'; | |
ini_set('default_socket_timeout',48000); | |
$resource = Mage::getModel('core/resource'); |
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 | |
chdir(dirname(__FILE__)); | |
require_once '../app/Mage.php'; | |
Mage::app(); | |
umask(0); | |
require_once 'countries.php'; // import lists with all countries | |
// UK Island shipping rates; http://www.crearegroup-ecommerce.co.uk/blog/magento-advice/shipping-rates-to-the-uk-islands.php |
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 | |
// 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 |