Posts Tagged ‘magento’

Magento Spanish Email Templates

12/02/2013

Spanish translation for magento does'nt include that files.??

Here you have the spanish email templates that i use for magento in spanish.
Unzip this file on your Magento DocumentRoot directory.

Changelog:??MARIA SALUD MOLINA BELDA is out.
Anuncis

How to see what fails when you get internal server error in PHP (500 HTTP Error)

31/01/2013

Add this lines as first lines when debugging in maintenance mode:

error_reporting(E_ALL | E_STRICT);

ini_set(‘display_errors’, 1);

 

In Magento you can set developer mode:

Mage::setIsDeveloperMode(true);

 

How to get a url to another urk key in current Magento store

29/01/2013

Don’t use:

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).’cms-or-catalog-url’; ?>

Use instead:

<? echo Mage::app()->getStore()->getUrl(‘cms-or-catalog-url’) ?>;

Tip to debug objects in Magento development environment

25/01/2013

Change $_item with the object you want to debug and see methods and attributes:

$var=$_item;echo 'Class '.get_class($var).':';echo ''.implode("() ",get_class_methods($var));foreach($var->getData() as $k=>$v){        echo 'getData(''.$k.'')';}

 

Howto check if Magento core code has been modified

25/01/2013

Your magento is working weird, but there are no third-party extensions actived on the store?

Use standard *nix diff command to compare all current Magento files with corresponding files of default Magento.

$ diff -qrbB cleanmagento/app/code/core shop/app/code/core

Windows tip: Use WinMerge instead

 

Magento Tip: Template and modules debug functions

03/10/2012

Some helpful snippets of code to use when debugging magento templates in development:

  var_export(get_class_methods(get_class($classname)));

  var_export(array_keys( $this->getData() )); //or

  var_export(array_keys( $object->getData() ));

  var_export($object->debug());

 

When using with Mage::log() for modules in community or local code pools.

  Mage::log(var_export(get_class_methods(get_class($classname)), TRUE),NULL,’some_filename.log’);

  Mage::log(var_export(array_keys( $this->getData() ), TRUE),NULL,’some_filename.log’); //or

  Mage::log(var_export(array_keys( $object->getData() ), TRUE),NULL,’some_filename.log’);

  Mage::log(var_export($object->debug(), TRUE));

Install Magento 1.4.1.1 via SSH

11/08/2010

1. Getting Magento files in your server

$ wget http://www.magentocommerce.com/downloads/assets/1.4.1.1/magento-1.4.1.1.tar.gz
$ tar -zxvf magento-1.4.1.1.tar.gz $ mv magento/* magento/.htaccess .
$ chmod -R o+w media $ ./pear mage-setup .
$ ./pear install magento-core/Mage_All_Latest
$ touch var/.htaccess | mkdir -p app/etc
$ chmod o+w var var/.htaccess app/etc
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
$ rm -rf magento/ magento-1.4.1.1.tar.gz

2. Requiriments

Go to webpage and….

Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

Set .htaccess

   Action php5-cgi /cgi-bin/php5-cgi

    AddHandler php5-cgi .php

3. Web Config

Set Localitzation, BBDD, URL, Session storage, Admin account…