Skip to content

Instantly share code, notes, and snippets.

View ivanweiler's full-sized avatar
👾

Ivan Weiler ivanweiler

👾
View GitHub Profile
@ivanweiler
ivanweiler / Mage_Checkout_Block_Onepage_Billing.php
Created June 17, 2015 10:00
Magento Checkout - fill address forms from Quote address (if possible) for guest customers
/**
* Mage_Checkout_Block_Onepage_Billing::getAddress() should be something like this
*
* Similar for Mage_Checkout_Block_Onepage_Shipping
*/
public function getAddress()
{
if (is_null($this->_address)) {
$this->_address = $this->getQuote()->getBillingAddress(); //always take address from quote
{
"require": {
"magento/magento-composer-installer": "*",
"magento/product-community-edition": "0.1.0-alpha97"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.magento.com/"
}
<?php
class Inchoo_Edu_Model_Example
{
/*
* Custom cache example
*
* @see: Directory, Adminhtml_Block, etc.
*
*/
<?php
class Inchoo_Edu_Model_Resource_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
/*
* Collection that always caches all its queries
*
*/
protected function _construct()
{
$this->_init('inchoo_edu/dummy');
@ivanweiler
ivanweiler / magento-block-cache.php
Last active August 29, 2015 14:05
Magento block cache examples
<?php
class Inchoo_Edu_Block_Template extends Mage_Core_Block_Template
{
/*
* Block caching
*
*/
protected function _construct()
{