How to display products on magento shop home page nicely
Ranked #686 in Internet, #34,126 overall | Donates to Squidoo Charity Fund
Magento is a great eCommerce tool which becomes more and more popular each day.
It is very flexible and therefore it is quite hard to customize it, you need to know a lot in order to do all correct.
If you have never heard of magento - you can find their site here.
In the article below you will find out of couple of tricks regarding magento customization
If you have never heard of magento - you can find their site here.
In the article below you will find out of couple of tricks regarding magento customization
Here is a short step-by-step guide for adding products to home page.
First of all here is a small explanation.
We can add magento blocks via special code through magento admin.
For example, this command:
{{block type="catalog/product_list" template="catalog/product/list.phtml" category_id="9"}}
That means we are taking class "catalog" with function "product_list" it takes parameter "category_id" = 9 and displays the results using template "catalog/product/list.phtml". This is absolutely awesome! First time I knew this trick I thought that I don't need to go coding magento anymore and can do everything from admin side.
So if we just put this code in the home page content block - we must see products from category with id=9 using regular template "catalog/product/list.phtml" (this template is common for product displaying in magento).
Here is the short to do list:
We can add magento blocks via special code through magento admin.
For example, this command:
{{block type="catalog/product_list" template="catalog/product/list.phtml" category_id="9"}}
That means we are taking class "catalog" with function "product_list" it takes parameter "category_id" = 9 and displays the results using template "catalog/product/list.phtml". This is absolutely awesome! First time I knew this trick I thought that I don't need to go coding magento anymore and can do everything from admin side.
So if we just put this code in the home page content block - we must see products from category with id=9 using regular template "catalog/product/list.phtml" (this template is common for product displaying in magento).
Here is the short to do list:
- 1. Creating a category for home page products, making it hidden just not to show it as a regular category.
- 2. Remembering the id of this category (you can see this id while editing category) {img of category edit}
- 3. Adding products to our home page category.
- 4. Adding code in home page content block
{{block type="catalog/product_list" template="catalog/product/list.phtml" category_id="YOUR_CATEGORY_ID"}} - 5. Seeing the result!
Please leave a review to this part.
Loading poll. Please Wait...
There is one more thing here to improve the home page view
Mostly home page products should be displayed differently, i.e. we do not need paging, sorting, etc. Just 3-6 products. That is all.
What to do?
We need to make a template. Remember? "catalog/product/list.phtml" we will add new one!
If you are a webmaster and know php a little - you can do it for yourself. Just go to
/app/design/frontend/yourwebsite/yourtheme/template/catalog/product/list.phtml
Copy it to some other file (for example home.phtml) in the same dir and do with it whatever you want to.
If you are not a webmaster - you can download my home.phtml. it will generate something like this view on your home page - home page with products.
Here is another short list for advanced view:
Take a look at this: another example of the home page with products. But it has completely different html and requires it's own css.
What to do?
We need to make a template. Remember? "catalog/product/list.phtml" we will add new one!
If you are a webmaster and know php a little - you can do it for yourself. Just go to
/app/design/frontend/yourwebsite/yourtheme/template/catalog/product/list.phtml
Copy it to some other file (for example home.phtml) in the same dir and do with it whatever you want to.
If you are not a webmaster - you can download my home.phtml. it will generate something like this view on your home page - home page with products.
Here is another short list for advanced view:
- 1. Make every step from the first to do list if you still didn't.
- 2. Create a file "home.phtml" in the category /app/design/frontend/yourwebsite/yourtheme/template/catalog/product/ If you are a webmaster - you can make it for yourself, otherwise you can download my version.
- 3. Change the code in the home page content block in admin to
{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="YOUR_CATEGORY_ID"}} - 4. Seeing the result!
Take a look at this: another example of the home page with products. But it has completely different html and requires it's own css.
if you need a professional magento theme for your site - please take a look at this. For sale!
Please answer this question
Do you want to know about other features of magento?
Ex:
How to add brands list?
How to customize color drop down?
Loading poll. Please Wait...
If you have any comments
about this article or magento themes which are shown here - please!
-
-
magento-templates Apr 3, 2011 @ 6:06 am | delete
- Great article! very detailed instructions, excellent job!
-
-
-
vsvnmurthy
Oct 7, 2010 @ 8:18 am | delete
- Can you guide how to display related products for each product in cart of magento.
-
Some related links
There are many ways to do the same thing in magento!
- pictured tutorial - how to get products from a selected category to show up on your home page
- very detailed, but for the basic display with list.phtml template
- Hosting tips about magento
- Describes different hosting solutions from shop owner point of view.
by Ernazar
Magento templates? Yes!
- 1 featured lens
- Winner of 3 trophies!
- Top lens » How to display products on magento shop home page nicely
Feeling creative?
Create a Lens!
Explore related pages
- Free vs. Hosted Shopping Cart Comparison Guide Free vs. Hosted Shopping Cart Comparison Guide
- Core Commerce Review and Comparison Guide Core Commerce Review and Comparison Guide
- Magento-only Hosting Magento-only Hosting
- Ecommerce Software Revolution: Groupon vs. Google Ecommerce Software Revolution: Groupon vs. Google
- Starting a Successful Ecommerce Business: Royal Mini-Case Study Starting a Successful Ecommerce Business: Royal Mini-Case Study
- Top 5 Benefits Of An Ecommerce Solution Top 5 Benefits Of An Ecommerce Solution