Call Static Blocks From Any PHTML File in Magento

Wednesday, December 14, 2011
In this article i am going to show you...How to call a static block from any template(.phtml) file in Magento.You can easily call any static block from template (phtml) file. At first, you have to create a static block from admin, CMS->Static Blocks .
Let us suppose, you created a static block with the identifier footer_links.
Now, you can call the static block from any phtml file with the help of following code:
<?php echo $this->getLayout()->createBlock('cms/block')
->setBlockId('footer_links')->toHTML();?>

Use any SMTP to send mail in Magento

Sunday, December 11, 2011
This article will explain how to create an extension to send all the emails through gmail or other servers.I have created an module to set up an email account from admin.
I have made use of "Zend_Mail_Transport_Smtp" class to make it possible.

Magento Files and Folders Structure

Friday, December 9, 2011
This part of the Magento tutorial will provide detailed information regarding the Magento's default files and folders structure.
You will learn more about the functions of main files and folders included in the Magento package.
The files and folders included in the main directory are as follows:
• .htaccess - contains mod_rewrite rules, which are essential for the Search Engine Friendly URLs. There you can also find standard web server and php directives that can improve your web site performance.
• .htaccess.sample - this is a backup of the .htaccess file. If you modify .htaccess it can be used in order to get the default settings.
• 404 (directory) - The folder stores the default 404 template and skin for Magento.
• app (directory) - This folder contains the modules, themes, configuration and translation files. Also there are the template files for the default administration
theme and the installation.

Common issues with importing/exporting

You can import/export data by using megento inbuilt import/export feature.
Go to System->Import/Export->Dataflow-Profiles. However, during the import and the export procedures different issues can occur.
The most common ones are as follows:
• Incorrect CSV file formatting - A bad formatting of a CSV file can cause a failed data import or missing rows after the import. The issue occurs more often with CSV files that with MS Excel since CSV is more prone to data failures due to a bad formatting.

Magento Transfer From One Server To Another

This tutorial provides detailed information how to move a Magento store from one host to another (or to a different hosting account).
MySQL database backup:-
PhpMyAdmin included by default in cPanel for your account. In other cases you will have to use the same tool or a similar one that is capable of exporting your MySQL database. Detailed information how to perform a MySQL backup you can find in MySQL Tutorial.
Alternatively if you don’t have phpMyAdmin installed but you have shell access you can use mysqldump tool. The syntax is as follow
mysqldump -h HOST -u USER -p DATABASENAME > FILENAME.sql
Where:
HOST is the database server hostname or it can be omitted if you are running the MySQL server locally.
USER - a user with full privileges to the Magento database.
DATABASENAME - is the full name of the database which Magento is running.
FILENAME - can be anything you find suitable for the backup file.
Also if you have Plesk, DirectAdmin or any other web hosting management tool- you can look at the available options. Many panels allow you to dump the database with just a few clicks. For example cPanel does have an option for this.

Magento Google Analytics

Google Analytics is a free Google service which allows the webmasters and web site administrators to monitor their web sites' traffic and conversion ratio.
Magento supports two types of tracking:
Page View Tracking: Lists the origin from which your web store visitors linked to your store.
E-commerce Tracking: Lists the customers that make purchases and what they buy.
First you need to sign up at http://www.google.com/analytics/sign_up.html. You will receive a Google Analytics account number. Write it down since you will need it for the Magento configuration.

How to manage order emails

As I have mentioned in the Magento order options section, Magento has a very nice built-in email functionality called Sales Emails which allows you to manage the emails you send to your customers when an order is processed. Before you configure your emails, you might want to add new email templates. You can do this from the admin area > System > Transactional Emails.
Now let's take a closer look at each of the options in Sales Emails:

Magento Features

Thursday, December 8, 2011
The large array of the Magento features is one of the main benefits of Magento. Through them you can easily develop and manage a successful online store. Magento features like different payment engines and shipping options along with the international support and high security using a private SSL certificate will make your shop an attractive place for e-commerce.

Magento main features include:

Manual Installation of Magento

The steps which you must follow in order to complete the Magento manual installation are:
Step 1: Download the latest stable Magento package from:
http://www.magentocommerce.com/download.

Step 2: Upload the package on your hosting account through your cPanel -> File Manager or using an FTP client.

There are 2 options where you can place the Magento download file:

How to set a custom group of users

You can add a new group from the Magento admin area > Customers > Customer Groups > Add New Customer Group.

Once a customer registers, you can change the group he/she belongs to from the Magento admin area > Customers > Manage Customers. Click on the Edit link next to the customer and change the group from the Account Information > Customer Group. Click Save Customer.

Set the discount from Promotions > Catalog Price Rules > Add New Rule.

How to add a Contact Us form in Magento

Magento includes contact form functionality by default. A link to a contact form can usually be found in the footer of your Magento installation.

Of course, you can add a contact form on any page. All you need to do is:

Log in to the administrator area.
Go to CMS > Pages.

How to set up a blog in Magento

It is not difficult to set up a blog in Magento. However, note that functionality is not included by default and you will have to use a custom extension to add it.

How to redirect Magento to open through www

For SEO and usability purposes you may want to redirect your visitors to open your site only through www (http://www.yourdomain.com).

To do this in Magento, you should open the .htaccess file in the folder where your Magento is installed. In it locate the RewriteEngine on line and right after it add the following lines:

How to speed up Magento

Many Magento issues are caused by slow performance. The recommended way to speed up Magento's performance is to enable its Compilation function. The performance increase is between 25%-50% on page loads.

You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.

How to enable Search Engine Friendly URLs in Magento

To enable Search Engine Friendly URLs in Magento, you have to log in to the Magento's administration area and click on the Configuration button. Under the System navigation menu, switch to Web page from the sub-navigation panel on the left.

When the page loads, you will see blue lines which represent closed options tablets. Click on the Search Engines Optimization tab and turn on the Use Web Server Rewrites (mark as Yes). Click on the Save Config button and your Magento SEF URLs will be enabled.

How to reset Magento Admin Password

To change your Magento admin password, go to your cPanel > phpMyAdmin, select your Magento database, click the SQL tab and paste this query:

UPDATE admin_user SET password=CONCAT(MD5('sGnewpass'), ':sG') WHERE username='AdminUsername';


Note: You have to change newpass in the MD5('sGnewpass') with your new password, and change *AdminUsername* to your Magento admin username.

Execute the query by clicking the Go buttong and your password will be changed.

How to configure Magento to work with a new domain

There are two things you should do in order to configure Magento to work with a new domain:

Edit the Magento database
Go to your cPanel > phpMyAdmin. Select your Magento database from the left menu, find the table called core_config_data and click on it.

Click the Browse tab and edit the first two fields:

web/unsecure/base_url
web/secure/base_url



by clicking the pen icon in front of each of them. Replace your old domain name with your new one and click the Go button to save the change.

Clear the Magento cache.
The Magento cache folder is located in your Magento installation directory > /var/cache. To clear the cache, simply delete the folder.

Many Magento issues can be fixed just by deleting the cache.