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
// 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; | |
} |
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
protected function _beforeSave() | |
{ | |
$this->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate()); | |
if ($this->isObjectNew() && null === $this->getCreatedAt()) { | |
$this->setCreatedAt(Mage::getSingleton('core/date')->gmtDate()); | |
} | |
return parent::_beforeSave(); | |
} |
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
public function log() | |
{ | |
$args = func_get_args(); | |
$formattedMsg = call_user_func_array('sprintf', $args); | |
Mage::log($formattedMsg, null, 'vendor_module.log', Mage::getStoreConfig('path/to/config')); | |
} |
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 | |
class Myvendor_Mymodule_Helper_Data extends Mage_Core_Helper_Data | |
{ | |
/** | |
* Check whether current Magento version supports Transactions | |
*/ | |
public function isTransactionSupported() | |
{ | |
return version_compare(Mage::getVersion(), '1.4.0.1', '>'); | |
} |
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 | |
class MyParent | |
{ | |
public function includeFile() | |
{ | |
include "privateaccess_included.php"; | |
} | |
} | |
class MyChild extends MyParent |
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/bash | |
git log --graph --decorate --pretty=oneline --abbrev-commit |
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/bash | |
# Requirements: patchutils - Utilities to work with patches | |
# Credits: http://inchoo.net/magento/quickly-check-if-magento-core-files-are-modified/ | |
if [ $# -ne 2 ]; then | |
echo "Usage:" | |
echo "heydidyoujusteditthecore.sh <default_sacred_core_folder> <clients_core_folder>" | |
exit 1 | |
fi | |
default_sacred_core_folder="$1" |
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
alias xdebugon='export XDEBUG_CONFIG="idekey=phpstorm-xdebug" && sudo mv /etc/php5/mods-available/xdebug.ini.no /etc/php5/mods-available/xdebug.ini && sudo service apache2 restart' | |
alias xdebugoff='sudo mv /etc/php5/mods-available/xdebug.ini /etc/php5/mods-available/xdebug.ini.no && sudo service apache2 restart' |
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
find . -type f -name 'config.xml' -exec xmllint --noout {} \; |
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 |
OlderNewer