Magento redirect functions

/* Redirect to certain url */
_redirectUrl($url)

/* Redirect to certain path */
_redirect($path, $arguments=array())

/* Redirect to success page */
_redirectSuccess($defaultUrl)

/* Redirect to error page */
_redirectError($defaultUrl)

/* Set referer url for redirect in response */
_redirectReferer($defaultUrl=null)

/* Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param) */
_getRefererUrl()

/* Check url to be used as internal */
_isUrlInternal($url)

Magento urls and paths

Below are the ways to access magento urls and paths :

URLS:

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)

http://www.domain.com/index.php/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)

http://www.domain.com/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)

http://www.domain.com/skin/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS )

http://www.domain.com/js/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)

http://www.domain.com/media/

Paths :

base Mage::getBaseDir()
Mage::getBaseDir(‘base’) /var/www/magento/
app Mage::getBaseDir(‘app’) /var/www/magento/app/
code Mage::getBaseDir(‘code’) /var/www/magento/app/code
design Mage::getBaseDir(‘design’) /var/www/magento/app/design/
etc Mage::getBaseDir(‘etc’) /var/www/magento/app/etc
lib Mage::getBaseDir(‘lib’) /var/www/magento/lib
locale Mage::getBaseDir(‘locale’) /var/www/magento/app/locale
media Mage::getBaseDir(‘media’) /var/www/magento/media/
skin Mage::getBaseDir(‘skin’) /var/www/magento/skin/
var Mage::getBaseDir(‘var’) /var/www/magento/var/
tmp Mage::getBaseDir(‘tmp’) /var/www/magento/var/tmp
cache Mage::getBaseDir(‘cache’) /var/www/magento/var/cache
log Mage::getBaseDir(‘log’) /var/www/magento/var/log
session Mage::getBaseDir(‘session’) /var/www/magento/var/session
upload Mage::getBaseDir(‘upload’) /var/www/magento/media/upload
export Mage::getBaseDir(‘export’) /var/www/magento/var/export

EBS Payment module for Magento

As E-Billing Solutions (EBS) Payment gateway is one of the latest payment methodology used in India now days  as it provides a consultative approach to Indian Merchants for facilitating suitable online payment solutions and benefit from the exponential growth witnessed in E-commerce. Magento is one of the most popular E-commerce open source and its capturing the Indian Market as well . It help us to have the development faster and with advance features .We can provide as an extension also.

If you need the  E-Billing Solutions (EBS) Payment Module for Magento site I can provide you.
If you have any queries please contact me at my
Email address : surjan.negi@treewalker.in
Skype: treewalker.technologies
Gtalk: treewalker.technologies@gmail.com
Phone: 080-65832315
Mobile: +91-9916024769

customers in admin taking too much time to load

In magento if you have many customers and trying to load the products in admin under customers > manage customers , it takes too long to load or in some case it hangs the system .

I faced this problem in on of the project and after debugging the issue , i found that the issue is caused because of the  sql query created to load the customers in grid . In the sql query if you remove the “order by” clause then it loads the products without any problem

To make it work I just comment one line  at this path “app\code\core\Mage\Adminhtml\Block\Customer”

From the below code comment this line “$this->setDefaultSort(‘entity_id’);”

public function __construct()
{
parent::__construct();
$this->setId(‘customerGrid’);
$this->setUseAjax(true);
//$this->setDefaultSort(‘entity_id’);
$this->setSaveParametersInSession(true);
}

Try this ,i think it would help

Skip import row, is not valid value “” for field “type”

While trying the magento bulk import , we come across some of the issues . One of the issue which come across while updating the product which existing sku is as follow :

” Skip import row, is not valid value “” for field “type” ”

The reason for this is that the data which you are trying to update using the sku , does not exist, so magento display this error.

I hope this will help ..

Skip Import Row, Required Field “sku” Not Defined

While importing the bulk import of products in magento  we usually face this issue.

“Skipping import row, required field “sku” is not defined.”

The reason for this is that if the csv is not saved in UTF-8 format and you are using some special characters in the csv like some other language names . To avoid this you must save the csv using UTF-8 format .

To create a csv in UTF -8 format you just download the Open Office Org and when you are on the save screen, tick the “Edit filter settings” box and then once you click save you will be given the option of choosing the encoding format.

Hope this will fix the problem

Search Engine Optimization Tutorials StepByStep

Hi Everyone,

My name is Sushant dass, I am Business Developer @ treewalker  and i am going to introduce basic of SEO with step by step instructions.
SEO Definition:

SEO Stands for Search Engine Optimization.
SEO is all about optimizing a web site for Search Engines.
SEO is the process of designing and developing a web site to rank well in search engine results.
SEO is to improve the volume and quality of traffic to a web site from search engines.
SEO is a subset of search engine marketing.
SEO is the art of ranking in the search engines.
SEO is marketing by understanding how search algorithms work and what human visitors might search.

This is the best thing i found to describe the SEO if you want a other way around here it is:

SEO is a technique which helps search engines find and rank your site higher than the millions of other sites in response to a search query. SEO thus helps you get traffic from search engines.

Various way a Search Engine Works:

Search engines perform several activities in order to deliver search results

    Crawling
    Indexing
    Processing
    Calculating Relevancy
    Retrieving Results

Each of these activities perform by a search engine effects the ranking of a site we will carry on these in detail as we move forward

White Hat and Black Hat SEO:


There always remain a Good and a Bad Side of every thing in this World.Same Goes for SEO as Well.It’s a quiet a time from SEO existence there are people who are got the first hand on SEO for there personal benefits, Hence the Laws has been forged by Development Community and Webmasters are developed for placing and development of rules and standards for Search Engine Optimization,The terms are Coined White hat and Black hat SEO.White Hat follows the Guideline Provided by the Webmaster for Successive SEO of a webpage and Black hat do exactly opposite to conquer the top position in a search .

White Hat SEO:

• If it conforms to the search engine’s guidelines.
• If it does not involves any deception.
• It ensures that the content a search engine indexes and subsequently ranks is the same content a user will see.
• It ensures that a Web Page content should have been created for the users and not just for the search engines.
• It ensures the good quality of the web pages
• It ensures the useful content available on the web pages

Black Hat SEO :

• Try to improve rankings that are disapproved of by the search engines and/or involve deception.
• Redirecting users from a page that is built for search engines to one that is more human friendly.
• Redirecting users to a page that was different from the page the search engined ranked.
• Serving one version of a page to search engine spiders/bots and another version to human visitors. This is called Cloaking SEO tactic.
• Using Hidden or invisible text or with the page background color, using a tiny font size or hiding them within the HTML code such as “no frame” sections.
• Repeating keywords in the Meta tags, and using keywords that are unrelated to the site’s content. This is called Meta tag stuffing.
• Calculated placement of keywords within a page to raise the keyword count, variety, and density of the page. This is called Keyword stuffing .
• Creating low-quality web pages that contain very little content but are instead stuffed with very similar key words and phrases. These pages are called Doorway or Gateway Pages
• Mirror web sites by hosting multiple web sites all with conceptually similar content but using different URLs.
• Creating a rogue copy of a popular web site which shows contents similar to the original to a web crawler, but redirects web surfers to unrelated or malicious web sites. This is called Page hijacking.

Importance’s of Web Domain:

While choosing a domain name you should consider the followings:

  • Who would be your target audience.
  • What you intend to sell to them. Is it a tangible item or just text content.
  • What will make your business idea unique or different than everything else that is already on the market.

File Naming Convention for SEO:

  • The filename should preferably be short and descriptive. Its always good to use same keywords in file name as well as in page title.
  • Don’t use file names like service.htm or job.htm. But use actual service name in your file name like computer-repairing.htm
  • Don’t use more than 3-4 words in file name and separate them with hyphens rather than underscores. Try to use 2 keywords if possible.

upgrade magento to 1.5 or latest version

To upgrade the magento from 1.3.x ,1.4.x to 1.5.x or 1.6.x:
Take the backup of the site and database
Download the magento
$ wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz
Extract it
$ tar xvfz magento-1.5.1.0.tar.gz
Flush Cache
$ rm -rf var/cache/*
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
Remove the ‘downloader’ and ‘app/design/frontend/base’ directory
$ rm -rf downloader
$ rm -rf app/design/frontend/base

Copy ‘downloader’ and ‘app/design/frontend/base’ folder from magento-1.5.1.0
$ cp -a magento/downloader .
$ cp -a magento/app/design/frontend/base/ app/design/frontend/

$ cp magento/mage .
$ chmod 550 ./mage

Upgrade now :
$ ./mage mage-setup .
$ ./mage sync –force
$ ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest –force
$ rm -rf var/cache/* var/session/*
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
$ chmod 755 mage
$ php shell/indexer.php reindexall
$ ./mage upgrade-all –force
( NOTE: you may skip this ‘upgrade-all’ step if you just went ahead and did the following:

$ yes | cp -Rf magento/* . #this copies over all the magento files you extracted over your current installation

-----
To know more about the upgrade , follow this link:
Upgrade magento

Reindexing in Magento using command line

When running Magento is dealing with the indexes that it relies on. Usually you can do this from the admin panel by going to System -> Index Management.

When indexing fails from the admin panel you get a message saying that it failed with no reason why it failed. Now in most cases you cannot ignore this.