Skip to content

Instantly share code, notes, and snippets.

View molotovbliss's full-sized avatar
⚗️
Code, Eat, Sleep++;

Jared molotovbliss

⚗️
Code, Eat, Sleep++;
  • DFW, Texas
View GitHub Profile
@milkfarm
milkfarm / counter.js
Created February 27, 2012 20:11
Prototype UJS Character Counter: Twitter-style character counter with optional input field truncation
/* Counter Script
* Requires Prototype Library
* By: <stuff@milkfarmproductions.com>
* http://milkfarmproductions.com
* This work is licensed under the Creative Commons Attribution-Share Alike 3.0
* http://creativecommons.org/licenses/by-sa/3.0/us/
*
* Requirements:
* - A 'texter' input field, the field to be counted
* - A 'counter' input field with class equal to 'countClass' variable, the field to contain the count
@jasonbaik
jasonbaik / gist:2327644
Created April 7, 2012 11:11 — forked from behrendtio/gist:2260890
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@trev
trev / filter.phtml
Created April 13, 2012 06:11
Magento Color Attribute Swatches Implementation
<ol>
<?php foreach ($this->getItems() as $_item): ?>
<li>
<?php if ($_item->getCount() > 0): ?>
// Add attribute option image before label
<?php if($_item->getName() == "Color") : ?>
<img src="<?php echo Mage::helper('attributeoptionimage')->getAttributeOptionImage($_item->getValue()); ?>" alt="" />
<?php endif; ?>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a>
<?php else: echo $_item->getLabel() ?>
@hightemp
hightemp / gist:2387916
Created April 14, 2012 21:16 — forked from borriglione/gist:2237588
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@molotovbliss
molotovbliss / gist:2562551
Last active September 7, 2022 20:18 — forked from davidalexander/gist:1086455
Magento Snippets

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
@ashfame
ashfame / config.xml
Created May 4, 2012 20:26
Overriding admin template in magento
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Anattadesign_Adminoverrider>
<version>1.0.0</version>
</Anattadesign_Adminoverrider>
</modules>
<global>
<layout>
<adminhtml_sales_order_create_index>
@peterdietz
peterdietz / fix-oscommerce-import-to-magento.diff
Created May 9, 2012 02:51
The Magento oscommerce-migration-tool is broken and needs to be manually patched to successfully import. This is the changes I had to do (picked it up from forum posts) to get the import to work. Also, make sure all products have images, and none of your
diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php
index 4b5e822..7d46a2a 100644
--- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php
+++ b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php
@@ -158,7 +158,7 @@ function sendImportData(data) {
new Ajax.Request("'.$this->getUrl('*/*/batchRun').'", {
- method: "post",
+ method: "get",
@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');
@colinmollenhour
colinmollenhour / Data.php
Created May 17, 2012 02:45
Zend_Locale_Data local caching fix.
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd