Magento: Fix bug in bug in billing / shipping address edit

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/address/address.book.phtml.diff";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/address/dashboard.address.phtml.diff";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

German translation (./app/locale/de_DE/Mage_Customer.csv)
"Default Shipping Address will use the Billing Address","Sie haben noch keine Standard Versandadresse. Die Lieferung erfolgt an die Rechnungsadresse."
"Add a new address to my address book","Neue Versandadresse hinzufügen"

Links
http://www.magentocommerce.com/boards/viewthread/7520/

Magento create category with PHP API

<?php
// Magento login information
$mage_url = 'http://YOUR_MAGENTO_SERVER/index.php/api/?wsdl';
$mage_user = 'YOUR_SOAP_USER';
$mage_api_key = 'YOUR_SOAP_PASS';

// Initialize the SOAP client
$soap = new SoapClient($mage_url);

// Login to Magento
$sessionId = $soap->login($mage_user, $mage_api_key);

// create new category
$categ = array(
15334,
array(
'name' => 'New Category 1',
'is_active' => 1,
'available_sort_by' => array('name', 'price'),
'default_sort_by' => 'name'
),
'0'
);

try {
$id = $soap->call($sessionId

Magento: Sort by newest

cp ./app/design/frontend/base/default/template/catalog/product/list.phtml ./app/design/frontend/default/default/template/catalog/product/list.phtml
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/list.phtml.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";

/*
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/sortby_newest.sql.txt";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
*/

$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/toolbar.phtml.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

OPTIONAL: change sort by for a attribute
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/sortby/Toolbar.php.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Images
/sites/default/files/magento/sortby/toolbar.phtml.diff
/sites/default/files/magento/sortby/up.png

Translations
echo '"Newest first","Сначала новые"' >> ./app/locale/ru_RU/Mage_Catalog.csv

List some products on top
UPDATE magento.catalog_product_entity
SET updated_at = now( ) + INTERVAL 1 year
WHERE catalog_product_entity.sku in ('YOUR_PRODUCT_SKU');

Links
http://www.magentocommerce.com/boards/v/viewthread/1176 - set the default sort order for catalog pages?
http://www.magentocommerce.com/boards/viewthread/37324/P15/#t285109

Magento: customized category banner block

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/categorybanner/local.xml";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";

$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/categorybanner/banner.phtml";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";

$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/categorybanner/my.banner.phtml";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Install Wine

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.wine.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Downgrade to lastest Wine 1.2 (64 bit)
sudo apt-get remove wine1.4
cd /tmp
wget http://ie.archive.ubuntu.com/ubuntu/pool/universe/w/wine1.2/wine1.2_1.2.3-0ubuntu1_amd64.deb
wget http://ie.archive.ubuntu.com/ubuntu/pool/universe/n/nss-mdns/lib32nss-mdns_0.10-3.1ubuntu1_amd64.deb
sudo dpkg -i wine1.2_1.2.3-0ubuntu1_amd64.deb lib32nss-mdns_0.10-3.1ubuntu1_amd64.deb
wine --version

OPTIONAL: fake ie6 installation
wget kegel.com/wine/winetricks -P /tmp; sh /tmp/winetricks fakeie6

Compile wine
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get build-dep wine1.3
sudo apt-get --build source wine1.3
./configure
make

LINKS
http://appdb.winehq.org/ - supported applicatinos
http://www.winehq.org/site/download-deb - Wine for Debian based distributions
http://wiki.winehq.org/AdobePhotoshop
http://wiki.winehq.org/AdobeAcrobatPro

Auto update Ubuntu PXE files

Update script
<?php
$URL="https://raw.githubusercontent.com/panticz/preseed/master/pxe/scripts/update.ubuntu.pxe.files.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Create cronjob
<?php
$URL="https://raw.githubusercontent.com/panticz/preseed/master/pxe/scripts/update.ubuntu.pxe.files.cronjob";
echo "wget $URL -O - /etc/cron.d/update.ubuntu.pxe.files.cronjob; chmod a+x update.ubuntu.pxe.files.cronjob";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Configure PXE
wget https://installit.googlecode.com/hg/preseed/preseed.precise.i386.conf -O /var/lib/tftpboot/pxelinux.cfg/preseed.precise.i386.conf
wget https://installit.googlecode.com/hg/preseed/preseed.precise.amd64.conf -O /var/lib/tftpboot/pxelinux.cfg/preseed.precise.amd64.conf
wget https://installit.googlecode.com/hg/preseed/preseed.quantal.i386.conf -O /var/lib/tftpboot/pxelinux.cfg/preseed.quantal.i386.conf
wget https://installit.googlecode.com/hg/preseed/preseed.quantal.amd64.conf -O /var/lib/tftpboot/pxelinux.cfg/preseed.quantal.amd64.conf

vi /var/lib/tftpboot/default
MENU SEPARATOR
MENU BEGIN
MENU TITLE + Preseed
MENU INCLUDE pxelinux.cfg/preseed.oneiric.i386.conf
MENU INCLUDE pxelinux.cfg/preseed.oneiric.amd64.conf
MENU INCLUDE pxelinux.cfg/preseed.precise.i386.conf
MENU INCLUDE pxelinux.cfg/preseed.precise.amd64.conf
MENU INCLUDE pxelinux.cfg/preseed.quantal.i386.conf
MENU INCLUDE pxelinux.cfg/preseed.quantal.amd64.conf

MENU SEPARATOR
LABEL Back
MENU EXIT
MENU END

Magento: formal customer name

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/formal/Customer.php.formal.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/formal/Hello.php.formal.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/formal/Order.php.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/formal/hello.phtml.formal.diff";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/formal/order_new.html";
echo "$URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

ToDo
file: formal.sql.txt ?
fix other "Hallo"s / "Hello"s
cd ./app
grep "getCustomerName()" * -R | grep Hallo

Links
http://www.magentocommerce.com/boards/v../viewthread/37850/P0/