Skip to content

Instantly share code, notes, and snippets.

@ho-nl
ho-nl / local.xml
Created August 25, 2011 15:38
Magento empty local.xml file
<?xml version="1.0"?>
<!--
/**
* This is the override xml for my theme
*
* @category design
* @package simplestore_mytheme
* @copyright Copyright (c) 2011 YourCompany. (http://www.magentocommerce.com)
* @license http://www.yourwebsite.com/license Commercial License
*/
@ho-nl
ho-nl / Observer.php
Created June 29, 2011 12:25
Update to Decadentwaste_Chromeframe
<?php
class Decadentwaste_Chromeframe_Model_Observer
{
const HEAD_EXPRESSION = '{(<head[^>]*?>)}i';
public function insertMetaTags($observer)
{
$body = $observer->getResponse()->getBody();
if(strpos(strToLower($body), 'x-ua-compatible') === false) {
$body = preg_replace(self::HEAD_EXPRESSION,'$1'.$this->_getTag(),$body);
$observer->getResponse()->setBody($body);
@ho-nl
ho-nl / ee.html
Created June 16, 2011 17:54
Expression Enginen template engine vs. Native PHP
{exp:weblog:entries
entry_id="47"
dynamic="off"
status="not closed"
disable="categories|category_fields|member_data|pagination|trackbacks"
}
{embed="page/.screen"
title='{if "{seo_title_{nsm_lang}}" != ''}{seo_title_{nsm_lang}}{if:else}{title}{/if}'
meta_description="{meta_description_{nsm_lang}}"
}
@ho-nl
ho-nl / MagentoStickyFooter.css
Created March 21, 2011 15:59
Magento sticky footer
/* ================================= Magento Sticky Footer ================================ */
html,body { margin:0; padding:0; height:100%; }
.wrapper { min-height:100%; position:relative; _height:100% /* _height = for ie */ }
.header-container { }
.main-container { padding-bottom:300px; height:100%; }
.footer { padding:0;margin:0 }
.footer-container { padding:0;position:absolute; left:0; bottom:0; width:100%; height:300px; }
.footer-container { background:#496778}
/* ================================= Solution by www.h-o.nl =============================== */
@ho-nl
ho-nl / example.css
Created March 18, 2011 14:59
‪Free Magento Extension: Add the visitors' browser and platform to your template's body class‬
* Clears and hasLayout fixes */
.ie .header-container,
.ie .header-container .top-container,
.ie .header,
.ie .header .quick-access,
.ie #nav,
.ie .main,
.ie .footer,
.ie .footer-container .bottom-container,
.ie .col-main,
public function getThumbnailUrl()
{
$url = false;
if ($image = $this->getThumbnail()) {
$url = Mage::getBaseUrl('media').'catalog/category/'.$image;
}
return $url;
}
<option value="Maat S">T-shirt maat S €19,95</option>
<option value="Maat M">T-shirt maat M €24,95</option>
<option value="Maat L">T-shirt maat L €29,95</option>
@ho-nl
ho-nl / example.php
Created January 26, 2011 19:44
Add facebook like button to Magento product pages
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo Mage::helper('core/url')->getCurrentUrl();?>&layout=standard&show_faces=true&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowtransparency="true" style="display:block; clear:both; border:none; overflow:hidden; width:450px; height:61px"></iframe>
p img[style*='float: left;'] {margin: 0 1.5em 0 0;}
p img[style*='float: right;'] {margin: 0 0 0 1.5em;}
class Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_Abstract