Monthly Archives: December 2011

Magento Speed Boost Up with Nitrogento

Speeding up in magento is most important key factor. Every Merchant needs that there site should run as fast so that user may not leave there site.
Nitrogento will help to boost up the performance of the Magento storeFeatures of Nitrogento

  • Full Page Cache for Community Edition
  • Bloc caching of 8 new entries (footer, etc.)
  • Custom bloc cache:put your block in cache
  • Auto Sprite & theme patching
  • Auto deployment of CDN & theme patching
  • Minify & Compression of JS and CSS
  • Htaccess settings (activate browser cache)
  • Simple use: setup & controlled from B.O
So get a free trail version of Nitrogento and then check your result
Hope this will help you

Magento Easy Tabs

Now adding the tabs in your theme became easy
The new Magento easy tabs will help you to add the tabs directly through admin
Download Extension key from here.Note:It will override your catalog related files for example view.phtml file will be overwritten by the easy tabs catalogproductview.phtml so,make sure that you take the backup and then procced

 Hope this will help you

Magento Change admin URL

For security reason now it became useful to change the url of the admin

Follow the steps to change the url

Open app/etc/local.xml

Find the following

<admin>

<routers>

<adminhtml>

<args>

<frontName><![CDATA[admin]]></frontName>

</args>

</adminhtml>

</routers>

</admin>

Change

<frontName><![CDATA[admin]]></frontName>

to your name which u have think

 Like below:

<frontName><![CDATA[editname]]></frontName>

hope this will help you

Magento admin problem

Many times it happen developer can’t able to Login into the Admin even though they have entered the correct username and password
so here is the solution

1) Use 127.0.0.1 instead of localhost in your url, i.e. using
http://127.0.0.1/magento/index.php/admin instead of
http://localhost/magento/index.php/admin . we  think it will not solve our problem.
2) Running on Windows XP, I was suggested to open “host” file from
C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost
or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.
3) This solution finally helped us out of this problem. The solution was to modify the core
Magento code. Open
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the
lines 80 to 83. The line number may vary according to the Magento version. But these lines
are present somewhere near line 80. You have to comment the comma (,) in line: $this-
>getCookie()->getPath()//,
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
It will help you

No Browse Files or Upload Images Buttons

Sometimes Magento  not able to show Browse Files or Upload Images Buttons in the Product page
so developer spend lot of time to fix this
Here is the easy solution
Just click on  the following link and install the extension key in your magneto connect and clear the cache and check for the product page browser button will be there
Hope this well help you

Magento Date

As we known we are setting Magento date and time through admin which is  configured from the backend (System > Configuration > General > Locale Options > Timezone) for formatting/displaying date/time.We used in PHP
$currenttime = time()
echo $date = date(d-m-Y,$currenttime);
?>

We used for magento
$currenttime = Mage::getModel(‘core/date’)->timestamp();
echo $date = date(d-m-Y,$currenttime);
?>

Display ccurrent date
date(d-m-Y); ?>

Predefined date formatting
$date = ’12-12-2012′;
Mage::helper(‘core’)->formatDate($date,’medium’,fasle);?>

Note: Mage_Core_Helper_Data::format() has following arguments
public function formatDate($date=null, $format=’short’, $showTime=false)
{
….
}

Hope this will help you!

Short Rules of XML

If you’re not familiar with it, upon encountering Magento’s XML-based layout updates, you may have a question or two about the rules you must follow when modifying an XML file.
Only two set of rule need to remember with XML  is that when a tag opens, it must either be followed by a
closing tag (<xml_tag>) or
self-close tag (<xml_tag/>) exactly as (X)HTML file tags would.
Hope this help you

Creating CSS buttons vs Image buttons

Copy the image of proceed to checkout , or save the image in your PSD  your preferred file format, and save it in your magento directory skin/frontend/default/default/images

The HTML

Let’s take “Proceed to Checkout” image button in the shopping cart for the occasion (it can be found in app/design/frontend/default/default/template/checkout/onepage/link.phtml in the Magento folder structure)

<a href=”<?=$this->getCheckoutUrl()?>”><img src=”<?=$this->getSkinUrl(‘images/btn_proceed_to_checkout.gif’)?>” alt=”<?=__(‘Proceed to Checkout’)?>”/>

</a>

HTML for CSS button – change the style of the button with just a swap of the background

<a href=”<?php echo $this->getCheckoutUrl()?>”>

<span><?php echo Mage::helper(‘checkout’)->__(‘Proceed to Checkout’);?>

</span>

</a>

Swap out the ‘HTML for Image button’ code with the ‘HTML for CSS button’ code.

Note: The ‘img-btn’ class in the HTML just serves to unite all the CSS buttons in case you want to synchronize the font colors and sizes..etc.

The CSS

.btn-checkout {

display:block;

float:right;

background:transparent url(../images/btn_proceed_to_checkout_rad.gif) no-repeat 100% 0;

font-size:15px;

font-weight:bold;

padding-right:8px;

}

.btn-checkout, .btn-checkout:hover {

color:#fef5e5;

text-decoration:none;

}

.btn-checkout span {

display:block;

padding:0 17px 0 25px;

background:transparent url(../images/btn_proceed_to_checkout_bg.gif) no-repeat;

line-height:40px;

}

And there you have it! – An all CSS-powered button.

<a href=”<?php echo $this->getCheckoutUrl()?>”>

<span><?php echo $this->__(‘Proceed to Checkout’)?>

</span>

</a>

And then it worked well… 🙂

Apply on the Place Order button

copy the file app/design/frontend/default/default/template/checkout/onepage/review.phtml in your design path, and replace :

<input type=”image” src=”<?php echo $this->getSkinUrl(‘images/btn_place_order.gif’) ?>” onclick=”review.save();” value=”<?php echo $this->__(‘Place Order’) ?>” />

to :

<a href=”#” onclick=”review.save();”><span><?php echo $this->__(‘Place Order’) ;?></span></a>

The “Place Order” button is now css powered and can be translated easily!

just apply and check with your own button image

Hope this will help you

Speed up the Magento

One of the most important key factor in website is the speed performance.Some people think that with magento speed get slow
Here are some useful tips to speed up the magento and make it run fastEnable Caching
Caching is enabled by default. So just don’t turn it off, unless really necessary, i.e. for development purposes.

Use a PHP Accelerator such as APC
Using a PHP Accelerator is now a necessity. If you use Ubuntu, installing APC is very simple:
sudo aptitude install php5-apc

It will be enable automatically.
For Magento installation in your web hosting, make sure to enable APC in php.ini configuration file by adding:
extension = apc.so

Enable Magento Compiler
To use it:
Make sure you have about 100 MB additional space
Go to Tools -> Compilation
Click “Run Compilation Process”

Make sure Compiler status is “Enabled”.

Enable JavaScript and CSS Combining in the Magento Admin Panel

Install Fooman Speedster via Magento Connect (Free)

Note: After installing, your files should be minified instantly. Go ahead and check your combined scripts to see Fooman Speedster in action. After installing may be your website link  break or there may be problem with css and js
no need to worry after complete installation just go to Mage/app/etc/modules/Fooman_Speedster.xml
“edit “true” to “false” and then check it will work as you want

Optimize Your .htaccess File for Max Performance

Remove Unncessary JavaScript Files in Your Magento Layout XML Files
There’s a lot of JavaScript bloat in Magento. You can safely remove certain files and improve performance. Here’s a sample from Avalanche’s page.xml layout file:

Remove ETags
“Entity tags (ETags) are a mechanism web servers and the browser use to determine whether a component in the browser’s cache matches one on the origin server. Since ETags are typically constructed using attributes that make them unique to a specific server hosting a site, the tags will not match when a browser gets the original component from one server and later tries to validate that component on a different server.”

Hope this will help you

Magento Compilation

Many people are not aware of the Magento Compilation For Speeding up the Performance Magento Compilation tools is the best toolsThe System → Tools → Compilation option allows you to compile all files of a Magento installation in order to create a single include path to increase performance.
In order to use this tool, the directory includes and the file includes/config.php must both be writeable.

Note: As it is important tools for Speed up the Performance but Some times it will break your website. You will be unable to view the frontend of backend of your magento website. you will need to turn this off through the magento core files. To do this you will need to:

disable and comment out the following in includes/config.php

#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);

change to

#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
#define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);

it will fix Your issues

Hope this will help you

Magento uses Zend to prepare query

As Many people are confuse with the database query. Just have a look how the Magento uses zend to run the query
As you have notice that ResourceModel files in Magento doesnot uses the Plain my sql.They are using(prpearing) from the Zend_Db.This means that Magento is using Zend for handling requests.

$read = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);
echo get_class($read);

You will get the class as Varien_Db_Adapter_Pdo_Mysql which is an extension of Zend_Db_Adapter Abstract. You can create an instance of a Zend_Db_Select object using the select() method of a Zend_Db_Adapter_Abstract object. This can be used to build ‘SELECT’ queries. When building the query, you can add clauses of the query one by one. There is a separate method to add each clause to the Zend_Db_Select object. For example:

To Build this query:
“SELECT product_id, product_name, price FROM “products” WHERE price > 100.00″ //this is not a magento query

We can write:
$select = $read->select()->from(‘products’, array(‘product_id’, ‘product_name’, ‘price’))->where(‘price > 100.00′);

Hope this will help you