magento

Magento: GoogleAnalytics fix

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

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

";
?>

wget http://www.panticz.de/sites/default/files/magento/GoogleAnalytics/Ga.php.diff -O /tmp/Ga.php.diff
patch -p2 ./app/code/core/Mage/GoogleAnalytics/Block/Ga.php < /tmp/Ga.php.diff

#
# TEST
#
# get source code
cd /tmp/
svn checkout http://svn.magentocommerce.com/source/branches/1.4-trunk

# trunk
cd /tmp/1.4-trunk/

# pack
tar cjf GoogleAnalytics.tar.bz2 app/code/core/Mage/GoogleAnalytics/ app/design/frontend/base/default/layout/googleanalytics.xml app/locale/en_US/Mage_GoogleAnalytics.csv --exclude=.svn

# transfer archive to your magento machine
scp /tmp/1.4-trunk/GoogleAnalytics.tar.bz2 root@YOUR_MAGENTO_IP:/tmp

# extract
diff app/code/core/Mage/GoogleAnalytics/ /var/www/app/code/core/Mage/GoogleAnalytics/ -r

# Links
http://www.magentocommerce.com/boards/viewthread/23325/P45/
http://www.magentocommerce.com/boards/viewthread/77774/#t215469

Magento customized "Shop by" Navigation

<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/customized-shop-by/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/customized-shop-by/layer_view.css";
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/customized-shop-by/my.view.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/customized-shop-by/filter.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/customized-shop-by/filter.select.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/customized-shop-by/state.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/customized-shop-by/state.select.phtml";
echo "$URL";
echo "

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

";
?>

OPTIONAL: state.phtml with filter
ToDo: HowTo get avaiable options in a category for a filter?
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/customized-shop-by/state.phtml.with.filter.dev";
echo "$URL";
echo "

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

";
?>

other files
./app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php
./app/design/frontend/default/default/layout/catalogsearch.xml

Links
http://classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout/
http://docs.magentocommerce.com/Mage_Catalog/Mage_Catalog_Block_Layer_Filter_Attribute.html
http://www.mageintern.de/magento-shop-design/magento-navigation/filternavigation-layered-nav-mit-drop-down-auswahl.html
http://www.magentocommerce.com/boards/viewthread/28220/

Magento product back button

<?php
$URL="http://www.panticz.de/sites/default/files/magento/back-button/styles.css";
echo $URL;
echo "

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

";

$URL="http://www.panticz.de/sites/default/files/magento/back-button/back-button.view.phtml";
echo $URL;
echo "

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

";
?>

mkdir -p ./app/design/frontend/default/default/template/catalogsearch/
cp ./app/design/frontend/base/default/template/catalogsearch/result.phtml ./app/design/frontend/default/default/template/catalogsearch/result.phtml
<?php
$URL="http://www.panticz.de/sites/default/files/magento/back-button/result.phtml.diff";
echo $URL;
echo "

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

";
?>

mkdir -p ./app/design/frontend/default/default/template/page/
cp ./app/design/frontend/base/default/template/page/1column.phtml ./app/design/frontend/default/default/template/page/
<?php
$URL="http://www.panticz.de/sites/default/files/magento/back-button/1column.phtml.diff";
echo $URL;
echo "

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

";
?>

Links
http://www.mxperts.de/zuruck-button-fur-die-produktansicht/

Increase session timeout to one day (API and SESSION)

Session SQL
INSERT INTO core_config_data(path, value)
VALUES ('web/cookie/cookie_lifetime', 86400)
ON DUPLICATE KEY UPDATE value = 86400;

or manual:
System -> Configuration
General > Web
Session Cookie management
Cookie Lifetime: 86400

API SQL
INSERT INTO core_config_data(path, value)
VALUES ('api/config/session_timeout', 86400)
ON DUPLICATE KEY UPDATE value = 86400;

or manual:
System -> Configuration
General > Services
Magento Core Api
General Settings
Client Session timeout (sec.): 86400

NoRegion

http://www.magentocommerce.com/extension/1826/mxperts--noregion
/var/www/pear install magento-community/Mxperts_NoRegion

Disable telephone as required in customer/address
<?php
$URL="http://" . $_SERVER['SERVER_NAME'] . "/sites/default/files/magento/customer_address/edit.phtml.diff";
echo "

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

";
?>

Links
http://www.magentocommerce.com/boards/viewthread/9081/P45/

Change Magento Default Theme

# Modern
cd /var/www
/var/www/pear mage-setup /var/www
/var/www/pear install magento-core/Interface_Frontend_Default_Modern

System > Configuration > Design > Themes
Default: modern

# Blank
cd /var/www
/var/www/pear mage-setup /var/www
/var/www/pear install magento-core/Interface_Frontend_Default_Modern

System > Configuration
General > Design > Themes
Default: blank

# Links
http://www.magentocommerce.com/design_guide/articles/working-with-magento-themes#head-say-hello-to-multiple

Magento configuration

Error loging
set_core_config_data "dev/log/active" "0"
/var/www/var/log/exception.log
/var/www/var/log/system.log

Disable review
System > Configuration > Advanced
Mage_Review: Disabled

Disable wishlist
vi /var/www/magento/app/design/frontend/default/modern/template/catalog/product/list.phtml
helper('wishlist')->isAllow()) : ?>

Disable compare
vi /var/www/magento/app/design/frontend/default/modern/template/catalog/product/list.phtml

Create Magento SOAP account

command line

wget http://www.panticz.de/sites/default/files/soap.txt -O /tmp/soap.sql
mysql -u magento -pmagento magento < /tmp/soap.sql

Create soap role
System > Web Services > Roles
[Add New Role]
Role name: API Full Access

Roles Resources
Resource Access: All

[Save Role]

Create soap user
System > Web Services > Users
[Add New User]
User Name: soap
First Name: soap
Last Name: soap
Email: soap@soap.com
Api Key: test123
Api Key Confirmation: test123
This account is: Active

User Role

Install Magento

Installation
<?php
$URL="https://raw.githubusercontent.com/panticz/magento/master/scripts/install_magento.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 "

";
?>

LINKS
https://linoxide.com/tools/install-magento-ubuntu/
http://YOUR_SERVER_IP/magento/index.php/ - store frontend
http://YOUR_SERVER_IP/magento/index.php/admin/dashboard/ - admin menu
http://YOUR_SERVER_IP/magento/downloader/index.php - connect manager
http://www.magentocommerce.com/wiki/groups/227/installing_magento_via_shell_ssh
http://www.magentocommerce.com/wiki/general/installing-magento-on-slicehost-with-ubuntu
http://www.magentocommerce.com/wiki/groups/227/command_line_installation_wizard
http://svn.magentocommerce.com/source/branches/1.1-trunk/install.php
http://blog.magentomagik.com/how-to-install-magento-extensions-magento-extension-installation-guide/ - How to install magento extensions