Magento Themes and Magento Extensions

Ajax Registration form in magento

Posted on September 19th, 2011 | Posted by admin

In this article we are going to create a custom registration form in magento with Ajax functionality. The default magento registration form does the email verification of the user in the server side i.e After form submission. We are going to make it interactive.

Step 1: After creating the basic module,we need to override the default register.phtml and include our own template file. Magento has a built in prototype java script library support i.e prototype.js. In this example we are going to use Ajax with built in prototype.js library. The same result can also be achieved using jQuery but it requires a few more steps and also we need to write jQuery code to avoid conflicting with prototype library.

Step 2: We need a controller action for processing the client request through Ajax, it fetches the email address entered by user and it passes to the controller action. The controller action will check the email with the database and returns a message depending upon the condition.

Step 3: We need a place holder to display the result returned from the controller. Add your event in the email address field, once the email address is typed the email verification result has to be shown immediately to the user.

How to show products with toolbar and pagination in magento static block

Posted on September 16th, 2011 | Posted by admin

It is common in all Magento sites to show the product list in Home page using CMS feature in admin. Recently i had a requirement to display special products in clearance category. I need to create a static block which calls the custom product list block with special product filtering and include it in a category called clearance.

But in the latest version of Magneto 1.4 we can’t use XML Layout for static blocks, of course we can use XML Layout in CMS Pages which will include the toolbar and pagination. After doing lot of trial and error i found out a way to show products in static block with toolbar and pagination. The below method will show the product listing with pagination and toolbar in static block.

We can pass the arguments in the block call as shown below.

{{block type=”yourmodule/blockname” name=”product_list” category_id=”6″ column_count=”3″ count=”6″ limit=”4″ mode=”grid” toolbar_block_name=”product_list_toolbar” template=”catalog/product/list.phtml”}}

By Including the above block in StaticBlock we can even set category id, column count, count(product count), product limit per page (limit) and even the mode (Grid mode or list mode) etc.

Hope this will be useful for anyone who wants to show the products in static block.

Magento cron job issue solution

Posted on September 16th, 2011 | Posted by admin

Recently While developing a custom module with cron job i faced an issue, my cron job was not executed successfully. When i inspected the cron_schedule table in database it shows the status as error and the below message was found in messages field.
‘Mage_Core_Exception’ with message ‘Invalid callback: mymodel/observer::observermethod doesn’t exist
My model class is not recognized. But i have my observer class in the Model directory. I have my config.xml as below

<cron_expr>*/5 * * * *</cron_expr>

Since iam using only the observer class in my model directory and not using any other model class i didnt
add any entry for model class in the config.xml. But Magento is looking for model class name. In case if your magento cron job is not working the solution is to add a model class configuration entry in config.xml above the crontab tag.

How to remove .html from Magento

Posted on September 13th, 2011 | Posted by admin

There is an easy way to improve the SEO of your Magento store by removing the .html extension from the url


We have a category called Shoes

And we want to have an URL like this:

Now go to your Admin Panel. System -> Configuration. Then go to Catalog and expand the Search Engine Optimization tab.

Remove the “.html” text from both the input fields. Product URL Suffix and Category URL Suffix.

Finally the page will look like this screenshot:

Displaying New Products in Magento with Pagination

Posted on September 13th, 2011 | Posted by admin

Just recently we ran into an issue where we wanted to display all new products added to a specific category in our Magento site with pagination. To make things more complicated, we wanted to display this by using a CMS page. The default functionality that Magento provides for new products just didn’t cut it in our case. We had to come up with something different and I am documenting it here for everyone’s benefit. This method will allow you to add new products to a Magento CMS page and pull up new products for any category you choose, or for the entire site. Whether you want to add new products to your CMS page by category or for the entire site, it’s up to you.

Adding New Products with Built in Magento Tools

First, let’s set the record straight. It is possible to display a list of new products in Magento using a default block. You can do this without any coding changes or modifications to Magento itself. This code will allow you to bring up a list of new products on one of your CMS pages. It is also possible to use this to bring new products up within a template file or on your homepage, though we are not covering that here.

1 {{block type="catalog/product_new" column_count="6" products_count="400" name="" alias="product_homepage" template="catalog/product/new.phtml"}}

The above code will bring up your 400 newest products in 6 columns. You can change thecolumn_count and products_count variable so that any number of columns or products is shown. You can display all of your newest products by changing the products_count variable to zero. OK, so this is all good, but it’s not what we want. We want to display an entire page of our new products with the pagination toolbar, and we want to display the products with a Magento CMS page. It’s quite simple to accomplish this, and here is how you can do it.