Skip to content

Instantly share code, notes, and snippets.

View t10u's full-sized avatar

Toni Grigoriu t10u

View GitHub Profile
protected function _construct()
{
$this->addData(array(
'cache_lifetime' => 3600,
'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG),
));
}
DELETE FROM directory_country_region WHERE country_id = 'DE';
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="top.links">
<remove name="checkout_cart_link"/>
<block type="checkout/links" name="checkout_cart_link_custom">
<action method="addCheckoutLink"></action>
</block>
<action method="addLink" translate="label title" module="customer">
<label>My Cart</label>
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.7.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0^M
http://pear.php.net/dtd/tasks-1.0.xsd^M
http://pear.php.net/dtd/package-2.0^M
http://pear.php.net/dtd/package-2.0.xsd">
<name>Tonigrigoriucom_Scp</name>
<channel>pear.tonigrigoriu.com</channel>
<summary>Makes the admin category products list sortable</summary>
<description>Makes the admin category products list sortable</description>
<lead>
<img src="{{media url="dir1/dir2/image.png"}}" alt="" />
cd <MAGENTO DIR>
mkdir -p mage_tmp
./pear config-set mage_dir $PWD/mage_tmp
./pear config-set mage_etc_dir $PWD/mage_tmp/etc
./pear config-set mage_community_dir $PWD/mage_tmp/app/code/community
./pear config-set mage_design_dir $PWD/mage_tmp/app/design
./pear config-set mage_lib_dir $PWD/mage_tmp/lib
./pear config-set mage_local_dir $PWD/mage_tmp/app/code/local
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');
$collection->addAttributeToFilter('my_custom_attribute', array('notnull' => ''));
foreach ($collection as $product) {
echo $product->getId(). ' '. $product->getName();
}
<?php
require 'app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false);
try {
$client = new Zend_Soap_Client('http://local.magento/api/soap/?wsdl');
// login
$sessionId = $client->login('user', 'pass');
--- app/code/core/Mage/Core/Block/Template.php (revision 96724)
+++ app/code/core/Mage/Core/Block/Template.php (revision 102008)
@@ -34,6 +34,9 @@
*/
class Mage_Core_Block_Template extends Mage_Core_Block_Abstract
{
+ const XML_PATH_DEBUG_TEMPLATE_HINTS = 'dev/debug/template_hints';
+ const XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS = 'dev/debug/template_hints_blocks';
+ const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink';
@t10u
t10u / gist:1035684
Created June 20, 2011 14:22
Magneto
$ curl -I http://magnetocommerce.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 147
Content-Type: text/html; charset=utf-8
Location: http://www.magentocommerce.com
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 20 Jun 2011 14:20:18 GMT