Skip to content

Instantly share code, notes, and snippets.

@elfeffe
elfeffe / attributes-values.txt
Last active September 26, 2015 12:25
Find all values for one attribute in Magento by SQL
SELECT DISTINCT value FROM catalog_category_entity_varchar WHERR attribute_id = 1906
ORDER BY value DESC
@elfeffe
elfeffe / gist:11294549
Created April 25, 2014 16:02
Clean inputs on focus, and refill on blur
<script type="text/javascript">
jQuery.fn.doCleanInputs = function () {
jQuery(this).each(function() {
var default_value = this.value;
jQuery(this).focus(function(){
if(this.value == default_value) {this.value = '';}
});
jQuery(this).blur(function(){
if(this.value == '') {this.value = default_value;}