通过布局更新在magento主页上获取最新或新产品 [英] Get latest or new products on home page in magento with layout update

查看:60
本文介绍了通过布局更新在magento主页上获取最新或新产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Magento中创建新主题,并希望在首页上显示最新或新产品的分页和显示产品的数量.我将catalog/product/list.phtml从其核心文件复制到了模板中,以便可以对其进行自定义.

I create new theme in Magento and want to show latest or new products on home page with pagination and number of show product. I copied catalog/product/list.phtml from it's cored file to my template so that i can customize it.

以下是主页中布局更新中的代码:

Below is code in layout update in homepage:

<reference name="content">
   <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
      <action method="setCategoryId"><category_id>3</category_id></action>
      <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
      <block type="page/html_pager" name="product_list_toolbar_pager"/></block>
      <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
   </block>
</reference>

它与代码配合使用,但仅与我在布局更新中设置的类别配合使用.

It work well with is code, but only with category I set in layout update.

<action method="setCategoryId"><category_id>3</category_id></action>

我想要的是从所有类别中获取所有最新或新产品.

What I want is get all latest or new product from all category.

问题:如何通过所有类别或多个类别的布局更新来获取最新或新产品?

Question: how can I get latest or new products with layout update with all category or multiple category?

推荐答案

最好的方法是使用Magento窗口小部件.

The best way to do that is by using Magento Widget.

从CMS主页上,转到所见即所得菜单中的第二项内容和内容:插入小部件.

From your CMS homepage, go to content and clic on the second item in wysiwyg menu: Insert widget.

然后,弹出窗口出现,在小部件类型中选择:目录新产品列表.

Then, a popin appear, choose in Widget Type: Catalog New Products List.

插入插入小部件的操作完成.

这篇关于通过布局更新在magento主页上获取最新或新产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆