Skip to content

Instantly share code, notes, and snippets.

View aleron75's full-sized avatar

Alessandro Ronchi aleron75

View GitHub Profile
@aleron75
aleron75 / Create.php
Last active August 29, 2015 13:56
Mage_Adminhtml_Model_Sales_Order_Create->initFromOrder()
// This snippet from line 267 of class Mage_Adminhtml_Model_Sales_Order_Create of Magento CE 1.8.x or EE 1.13.x
public function initFromOrder(Mage_Sales_Model_Order $order)
{
// ...
$this->getQuote()->getPayment()->addData($order->getPayment()->getData()); // line 329
// ...
$this->getQuote()->save();
return $this;
}
@aleron75
aleron75 / gist:7304592
Last active May 18, 2018 15:57
Programmaticalli create a Yes/No Magento Category Attribute
<?php
/** @var Mage_Eav_Model_Entity_Setup $installer */
$installer = $this;
$installer->startSetup();
$this->addAttribute(
'catalog_category',
'my_custom_attribute',
array(
'group' => 'General Information',