English 中文(简体)
Magento - How to display ALL PRODUCTS in the homepage?
原标题:

Display all products in the homepage? Anyone who have had done this?

Note: This can be done in the CMS pages by adding manually each and every category id.. I don t want to do that.. Too much hassle if I have hundreds of categories..

I think this can be coded but I don t know where to start? Thanks and more power!

最佳回答

Go to the homepage in the CMS -> Manage pages and add the following code snippet into the WYSIWYG

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

This should then list all of the products in your shop on that page.

You could also use the same code to drill down into a specific category, by adding the category variable, e.g.

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="9" template="catalog/product/list.phtml"}}
问题回答

This is the code for all products

{{widget type="catalog/product_widget_new" display_type="all_products" products_count="10" template="catalog/product/widget/new/content/new_grid.phtml"}}

Put it under >

Go to CMS > Manage pages > Edit Home page

Navigate to content TAB > Click on Show Hide Editor

Put this above script

Or

Recently Viewd Products

{{widget type="reports/product_widget_viewed" page_size="5" template="reports/widget/viewed/content/viewed_grid.phtml"}}

Recently Compared Products

{{widget type="reports/product_widget_compared" page_size="5" template="reports/widget/compared/content/compared_grid.phtml"}}

Orders and returns

{{widget type="sales/widget_guest_form" template="sales/widget/guest/form.phtml"}}

Must be working for you tested till Magento 1.9

Go to the homepage in the CMS -> pages and select Your Home page, and in content box paste this code:

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

Step 1: Go to: Magento Admin CMS > Pages > Home Page

Step 2: Go to: Content Tab from left

Step 3: Add following snippet in the WYSIWYG

Note : Tick the root category when create a product on the assign categories tab.

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

I succeeded to display all products on my Magento home page using the following reference: https://magentoexplorer.com/how-to-add-and-display-all-products-on-homepage-in-magento

enter image description here To display all products on Magento homepage

In Magento backend, go to CMS -> Manage pages > Homepage and add this code

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

To Display products from a specific category to homepage

Go to CMS -> Pages > Homepage and add the follow code to HTML editor of Homepage

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

Replace category_id="3" with your desired category ID

Hope this helps





相关问题
How far do you go with YAGNI? [closed]

I am developing a new revolutionary web application for the enterprise market. Sure, many before me thought that their web app would be revolutionary only to find out it isn t. (Or it is, but the ...

Magento from 1.3 to 1.4

I`m using Magento 1.3 and I want to test the new 1.4, but is there a way of exporting the products and categories form 1.3 to 1.4? Thanks

"Points to Consider" before releasing a .NET Product Beta

I am planning to release a .NET product as Beta in the next couple of weeks. I want to know what points should be considered before releasing a product. I think the following needs to be taken care of:...

Get product link from Magento API

I am new to Magento and using their API. I need to be able to get the product url from the API call. I see that I can access the url_key and url_path, but unfortunately that s not necessarily what ...

Refactor or Rewrite UI Layer from Scratch

In most cases it is better to refactor than rewrite a full codebase. We have quite interesting situation. In our application business layer is pretty good. With unit tests, separation of concerns, etc....

热门标签