Skip to content

Instantly share code, notes, and snippets.

Avatar
🚬
Code, Eat, Sleep++;

Jared molotovbliss

🚬
Code, Eat, Sleep++;
View GitHub Profile
View gist:2562551

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
@molotovbliss
molotovbliss / gist:2766535
Created May 22, 2012
Fix for Fooman GoogleAnalytics Plus not working in 1.7 CE, 1.11 EE.
View gist:2766535
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- 991
+++ 992
@@ -62,7 +62,8 @@
$success = false;
}
- if (version_compare(Mage::getVersion(), '1.4.1.1') > 0 && version_compare(Mage::getVersion(), '1.7.0.0') < 0) {
+ // Fix for invalid version detection as well as forward compatibility
@molotovbliss
molotovbliss / Magento Ignore Tables list EE
Created Aug 8, 2012
List of tables to possibly ignore upon integration points
View Magento Ignore Tables list EE
core_cache, core_cache_tag, core_session, cron_schedule, customer_address_entity, customer_address_entity_datetime, customer_address_entity_decimal, customer_address_entity_int, customer_address_entity_text, customer_address_entity_varchar, customer_entity, customer_entity_datetime, customer_entity_decimal, customer_entity_int, customer_entity_text, customer_entity_varchar, dataflow_batch, dataflow_batch_export, dataflow_batch_import, dataflow_import_data, dataflow_profile_history, dataflow_profile_history, dataflow_session, dataintercept_api_debug, enterprise_customerbalance, enterprise_customerbalance_history, enterprise_customersegment_customer, enterprise_customersegment_event, enterprise_customersegment_segment, enterprise_customersegment_website, enterprise_customer_sales_flat_order, enterprise_customer_sales_flat_order_address, enterprise_customer_sales_flat_quote, enterprise_customer_sales_flat_quote_address, enterprise_giftcardaccount, enterprise_giftcardaccount_history, enterprise_giftcardaccount_po
@molotovbliss
molotovbliss / gist:7253347
Created Oct 31, 2013
Inline Renderer with onBlur JS Handler for ATWIX Inline Grid Editing.
View gist:7253347
// http://www.atwix.com/magento/inline-editing-in-magento-backend-grids/
public function render(Varien_Object $row)
{
$html = '<input type="text" ';
$html .= 'name="' . $this->getColumn()->getId() . '" ';
$html .= 'value="' . $row->getData($this->getColumn()->getIndex()) . '"';
$html .= 'class="validate-number input-text ' . $this->getColumn()->getInlineCss() . '" onblur="updateField(this, '. $row->getId() .'); return false"/>';
//$html .= '<button onclick="updateField(this, '. $row->getId() .'); return false">' . Mage::helper('deals')->__('Update') . '</button>';
return $html;
@molotovbliss
molotovbliss / gist:7572997
Created Nov 20, 2013
Magento Upgrade EE: When using shell/url_migration_to_1_13.php this greatly increased the completion time by 4x-5x.
View gist:7572997
ALTER TABLE `enterprise_url_rewrite_redirect`
ADD INDEX `redirect_id` (`redirect_id`) ;
ALTER TABLE `enterprise_url_rewrite`
ADD INDEX `request_path` (`request_path`) ;
View gist:8865428
Open 3 crawlers recursive, 4 levels deep and only crawl sites with domain thesite.com
wget -r -l4 –spider -D thesite.com http://www.thesite.com &
wget -r -l4 –spider -D thesite.com http://www.thesite.com &
wget -r -l4 –spider -D thesite.com http://www.thesite.com
Alternative to wget: http://aria2.sourceforge.net/
@molotovbliss
molotovbliss / gist:8866859
Last active Nov 16, 2016
MySQL Dump for Magento without locking the DB
View gist:8866859
mysqldump -u<USERNAME> -p<PASSWORD> --skip-opt --triggers --single-transaction --max_allowed_packet=512M db > db.sql
View create_file_hashes.php
<?php
/**
* This script outputs an array of file hashes recursively for the current directory.
* Useful for generating hashlist for security scanning programs
*
*/
function recursive_md5($dir, $types = null, $recursive = true, $baseDir = '')
{
$to_ignore = array(
'.',
View space-invader-css
#space-invader{
box-shadow:
0 0 0 1em green,
0 1em 0 1em green,
-2.5em 1.5em 0 .5em green,
2.5em 1.5em 0 .5em green,
-3em -3em 0 0 green,
3em -3em 0 0 green,
-2em -2em 0 0 green,
@molotovbliss
molotovbliss / gist:9122178
Created Feb 20, 2014
enterprise.xml FPC with umask permissions & FPC Memcache example
View gist:9122178
<!-- example of two level cache setup with slow backend at files. -->
<full_page_cache>
<backend_options>
<cache_dir>full_page_cache</cache_dir>
</backend_options>
<slow_backend_options>
<hashed_directory_level>1</hashed_directory_level>
<hashed_directory_umask>0777</hashed_directory_umask>
<file_name_prefix>fpc</file_name_prefix>
<cache_dir><![CDATA[full_page_cache]]></cache_dir>