Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
#!/bin/bash | |
# usage: magento [-?][-d "ET"][-bmc -p "Test"][-o "Mage_Model_Class"] | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [-?][-d "ET"][-bmc -p "Test"][-o "Mage_Model_Class"] | |
With this script you can create your own MODULE, copy Mage class and... | |
OPTIONS: |
<?php | |
umask(0); | |
ini_set('memory_limit','512M'); | |
set_time_limit(0); | |
if(file_exists('app/Mage.php')) require 'app/Mage.php'; | |
else require '../../app/Mage.php'; | |
// Init without cache so we get a fresh version | |
Mage::app('admin','store', array('global_ban_use_cache' => TRUE)); |
mkdir demo | |
cd demo | |
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz | |
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz | |
tar -zxvf magento-1.7.0.2.tar.gz | |
tar -zxvf magento-sample-data-1.6.1.0.tar.gz | |
mv magento-sample-data-1.6.1.0/media/* magento/media/ | |
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql | |
mv magento/* magento/.htaccess . | |
chmod o+w var var/.htaccess app/etc |
<config> | |
<modules> | |
<!-- Modules declaration and initialization, like in app/etc/modules/namespace_module.xml --> | |
</modules> | |
<global> | |
<!-- Configurations that should be shared between all scope, for example database settings class declaration/rewrites --> | |
<!-- overwriting magento model/block/helper classes example --> | |
<models/blocks/helper> | |
<module_name> | |
<rewrite> |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers | |
var t_page = "westvirginiau"; // the account name for your main twitter account | |
function add_commas(number) { | |
if (number.length > 3) { | |
var mod = number.length % 3; |
<?php | |
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup'); | |
if (!$installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) { | |
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION: | |
'label' => 'Label', // eav_attribute.frontend_label admin input label | |
'group' => 'General', // (not a column) tab in product edit screen | |
'sort_order' => 0 // eav_entity_attribute.sort_order sort order in group | |
'backend' => 'module/class_name', // eav_attribute.backend_model backend class |