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
function runOnFolderEntry() { | |
if [ "$PWD" != "$MYOLDPWD" ]; then | |
MYOLDPWD="$PWD"; | |
showGitBranch ${MYOLDPWD}; | |
showMagentoVersion ${MYOLDPWD}; | |
fi | |
} | |
function showGitBranch() { | |
if [ -d "$1/.git" ]; then |
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
UPDATE catalog_eav_attribute SET is_used_for_promo_rules = 0, is_visible_on_front = 1, is_searchable = 1, is_filterable = 0, is_visible = 1, is_used_for_price_rules = 0, is_filterable_in_search = 0, used_in_product_listing = 0, used_for_sort_by = 0 WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code LIKE 'ezbase%'); |
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 | |
protected function _getProducts($productIds = null, $storeId, $entityId = 0, &$lastEntityId) | |
{ | |
$products = array(); | |
$websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); | |
if (!is_null($productIds)) { | |
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 | |
chdir(dirname(__FILE__)); | |
require_once '../app/Mage.php'; | |
Mage::app(); | |
umask(0); | |
$resource = Mage::getModel('core/resource'); | |
$db = $resource->getConnection('core_write'); |
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); | |
$productModel = Mage::getModel('Mage_Catalog_Model_Product'); | |
$categoryModel = Mage::getModel('Mage_Catalog_Model_Category'); |
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
diff --git a/lib/Zend/Db/Statement/Pdo.php b/lib/Zend/Db/Statement/Pdo.php | |
index cd0a947..b116e3d 100644 | |
--- a/lib/Zend/Db/Statement/Pdo.php | |
+++ b/lib/Zend/Db/Statement/Pdo.php | |
@@ -231,7 +231,7 @@ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggrega | |
} | |
} catch (PDOException $e) { | |
#require_once 'Zend/Db/Statement/Exception.php'; | |
- throw new Zend_Db_Statement_Exception($e->getMessage(), (int) $e->getCode(), $e); | |
+ throw new Zend_Db_Statement_Exception($e->getMessage() . PHP_EOL . $this->_stmt->queryString, (int) $e->getCode(), $e); |