Wednesday, August 29, 2012

How to reset Magento admin password

If you need to change your magento admin password, go to 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';


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

Execute the query and your password will be changed.

Tuesday, August 28, 2012

Enable Search Engine Friendly URLs in Magento

To enable Search Engine Friendly URLs in Magento, you have to log in to the Magento admin area and click on the Configurations button. Under the System navigation menu, go to Web page from the sub-navigation panel on the left.

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.

Saturday, August 25, 2012

Remove Estimate Shipping and Tax box

If you need to remove the Estimate Shipping and Tax from shopping cart page on magento, follow these instructions:

Open /app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/cart.phtml file

Find the line that mentions shipping

Delete it and save file.

Clear cache and refresh page to see result.

Friday, August 24, 2012

Magento Print Collection Query

There come several situations where you need to print the collection query in magento and here is the way how to print collection query:

Print Collection Query

$collection->printLogQuery(true);


Sunday, August 19, 2012

Moving magento from subdirectory to root directory

Moving magento from sub directory to root directory require following steps:

  1. Move all files from sub-directory to root directory
  2. Change .htaccess file code:
    Find RewriteBase /subdirectory/ to RewriteBase /
    where subdirectory is the name of your subdirectory e.g. magento
  3. Open phpMyAdmin and run these queries:
    update core_config_data set value='your new store url' where path = 'web/unsecure/base_url';
    update core_config_data set value='your new store url' where path = 'web/secure/base_url';
Note: your new store url must be a url i.e. http://google.com/ with trailing slash.

Friday, August 10, 2012

All products from a category

Here is the way to show all products from a specific magento category to home page.


{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="4" template="catalog/product/list.phtml"}}

Show All Products on Home Page

This is very common now a days to show all products on magento home page. Here is the code to achieve this:

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

Thursday, August 9, 2012

Magento Display New Products on Home Page

There are many ways to show new products on home page but this is the simple way to display new products on home page.

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

Monday, August 6, 2012

URL is not accessible - Unable to read response, or response is empty

Sometimes during magento installation an error occurs saying "URL is not accessible - Unable to read response, or response is empty"

The simplest solution is to Click on "Skip Base URL Validation" and that test is ommitted at that point and it will work fine.