<?php
// clear cache
Mage::app()->removeCache('catalog_rules_dirty');
// reindex prices
Mage::getModel('index/process')->load(2)->reindexEverything();
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
jQuery(function ($) { | |
$(document).ready(function () { | |
if (typeof IFRAME_MARGIN == 'undefined') { | |
IFRAME_MARGIN = 5; | |
} | |
$('iframe').each(function (index, item) { | |
if ($(item).attr('src').match(/iframebasedomaingoeshere/)) { | |
//eg for a youtube video just replace the above with youtube | |
var w = $(item).attr('width'); | |
var h = $(item).attr('height'); |
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
<reference name="root"> | |
<action method="addBodyClass"><classname>whatever</classname></action> | |
</reference> |
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
$(document).on('click', function(e) { | |
console.log('my height is ' + $(e.target).height()); | |
console.log('my outerHeight is ' + $(e.target).outerHeight()); | |
}); |
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
{ | |
"rules": { | |
"declaration-colon-space-after": "always", | |
"indentation": ["tab"], | |
"max-empty-lines": 2, | |
"color-hex-case": "lower", | |
"color-hex-length": "short", | |
"number-leading-zero": "never", | |
"comment-empty-line-before": null, | |
"at-rule-empty-line-before": null, |
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 exportTableToCSV($table, filename) { | |
var $rows = $table.find('tr:has(td),tr:has(th)'), | |
// Temporary delimiter characters unlikely to be typed by keyboard | |
// This is to avoid accidentally splitting the actual contents | |
tmpColDelim = String.fromCharCode(11), // vertical tab character | |
tmpRowDelim = String.fromCharCode(0), // null character | |
// actual delimiter characters for CSV format |
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 getPriceRange($productId) { | |
$max = ''; | |
$min = ''; | |
$pricesByAttributeValues = array(); | |
$product = Mage::getModel('catalog/product')->load($productId); | |
$attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product); | |
$basePrice = $product->getFinalPrice(); |
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 | |
/** | |
* | |
* Magento (has some problems) | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* that is bundled with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: |
OlderNewer