<?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
<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
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: |
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/sh | |
exec 1>&2 | |
exec < /dev/tty | |
git diff --cached --name-only | while read FILE; do | |
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then | |
if [[ -f $FILE ]]; then | |
php -l "$FILE" 1> /dev/null | |
if [ $? -ne 0 ]; then | |
echo -e "\e[1;31m\tAborting commit due to files with syntax errors.\e[0m" >&2 |
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
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'); |
OlderNewer