【问题标题】:How to show all products at home page in magento如何在magento的主页上显示所有产品
【发布时间】:2015-12-17 07:33:51
【问题描述】:

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

在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

【问题讨论】:

  • {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}} 这应该给你产品列表,评论代码正在获取最近的产品,这就是它向你显示最近的产品的原因。
  • {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}} 在这些代码中为什么没有在首页显示所有产品?

标签: magento magento-1.9


【解决方案1】:

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

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

并使类别“是锚”是

【讨论】:

  • 没有不在前端显示产品。什么是 type mean catalog/product_list ?它表示控制器和视图?
  • 您是否使用类别 ID 并让您成为所有类别 Is Anchor yes 吗?
  • yes add category id ana all category Anchor yes only
  • 这对我有用 {{block type="catalog/product_list" category_id="2" name="home.catalog.product.list" template="catalog/product/list.phtml "}}
  • type="catalog/product_list" 请告诉我 catelog 表示什么,product_list 表示什么?谢谢您的回复
【解决方案2】:
{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

如果您希望它在 Magento 1.9.2.2(以及 1.9.2.3 和 1.9.2.4)及更高版本上工作,您需要将块目录/产品列表添加到系统 > 权限 > 块并将允许设置为是。

【讨论】:

    猜你喜欢
    • 2011-05-14
    • 1970-01-01
    • 1970-01-01
    • 2014-12-26
    • 2013-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-28
    相关资源
    最近更新 更多