如何在magento的主页上显示所有产品

时间:2015-12-17 07:33:52

标签: magento magento-1.9

如何在主页上显示所有产品详情(价格,描述,图片......),

在Cms中使用以下编码 - >主页 - >内容,

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

它在前端没有显示任何产品?

检查cms主页设计,

<\!--<reference name="content">
    <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
    <block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
    <block type="reports/product_compared" name="home.reports.product.compared" template="reports/home_product_compared.phtml" after="product_viewed">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
    </block>
</reference>
<reference name="right">
    <action method="unsetChild"><alias>right.reports.product.viewed</alias></action>
    <action method="unsetChild"><alias>right.reports.product.compared</alias></action>
</reference>-->

其编码在html标签中注释并删除它将显示产品的html标签,但它显示产品图像如下,产品显示一旦用户查看了它将显示的产品,为什么它显示最近用户查看的产品,我想显示所有产品。

Home Page image

2 个答案:

答案 0 :(得分:0)

将此代码与根类别ID一起使用,因为没有类别ID,它不能是列表产品。

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

并制作类别'Is Anchor'是

答案 1 :(得分:0)

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

If you want this to work on Magento 1.9.2.2 (also 1.9.2.3 and 1.9.2.4) and higher you'll need to add block catalog/product_list to System > Permissions > Blocks and set Allowed to Yes.