问题
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!
回答1:
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"}}
回答2:
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
回答3:
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"}}
回答4:
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"}}
回答5:
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
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
来源:https://stackoverflow.com/questions/4253389/magento-how-to-display-all-products-in-the-homepage