Magento首页显示产品
Magento首页显示产品
不过没有针对 具体使用过程中遇到的情况进行修正
这边只做一个备忘吧 (细节问题 按个别情况进行修改即可)
New products
Go to “CMS - Manage Pages” and select “Home Page” from the list of pages.
Use this code snippet to show products labeled as “new” on your front page:
- {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
(Note that you must have some new products in your catalogue for anything to show when you do this. In this context new doesn’t mean that you’ve recently added them; only products explicitly marked as new using ‘Set Product as New from Date’ and ‘Set Product as New to Date’ options in the ‘General’ product information page in the admin tool will be shown.)
All Products |
Go to “CMS - Manage Pages” and select “Home Page” from the list of pages.
Use this code snippet to show all products in your catalog on your front page:
- {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}
All Products from one Category |
Go to “CMS - Manage Pages” and select “Home Page” from the list of pages.
Use this code snippet to show one category on your front page:
- {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="4" template="catalog/product/list.phtml"}}
The category ID can be found when you go to “manage category” and then select the category you want. The ID is written in the header.
Examples is outdated, dosent work in magento 1.4.1
Layout Update XML for magento 1.4 |
Because in 1.4 version Layout update is different than in 1.3 version, you can use this example:
- <reference name="content">
- <block type="catalog/product_list" name="featured" template="catalog/product/list.phtml">
- <action method="setCategoryId"><category_id>[category id here]</category_id></action>
- </block>
- </reference>
New products - Layout Update XML for magento 1.4 |
To display new product / latest product, you can use this following XML code in layout xml file or layout display in backend. You can use also the widgets to display the products. The code below has been inspired by the widget.
diglin
- <reference name="content">
- <block type="catalog/product_new" template="catalog/product/new.phtml">
- <action method="setProductsCount">5</action>
- <actionmethod="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
- <actionmethod="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
- <actionmethod="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
- <actionmethod="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
- <actionmethod="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
- </block>
- </reference>
Magento首页显示产品的更多相关文章
- magento如何在首页显示产品
1.首先现在magento后台创建一个新的分类,记下这个分类的 ID 号码.使用这个新建的分类来管理你的首页产品,这个分类设置为前台不可见.这样就不会显示在你的分类菜单中了,但使用代码调用的时候却会显 ...
- Magento给新产品页面添加分页
本文介绍如何让magento创建一个带分页功能的新到产品页面,方便我们在首页或者其它CMS Page调用和展示新到产品. 在Magento我们经常有的做法是建立一个可以调用新产品的block,然后通过 ...
- 搬家后Magento前台只有产品的缩略图不显示
第一种可能:缓存不足 http://blog.csdn.net/ddjohn/article/details/6648199 最近发现一个怪异的现象,Magento前台只有产品的缩略图不显示.我检查了 ...
- Magento后台订单显示产品图片的修改方法
Magento后台订单原来是没有显示产品图片,客服业务还得到网站前台查找这个产品的图片提供给发货部,这样是很不方便的.为提高工作效率,应客服业务要求,现对Magento后台订单进行修改,使订单页面就显 ...
- 如何更改/删除magento首页产品/广告图片等模块信息
如何更改/删除magento首页产品/广告图片等模块信息,如果只是修改一些简单的地方,例如已经存在 的左右栏目里面的图片内容等,是很简单的,直接在后台就可以修改的,具体如下: 如何删除magento首 ...
- SSH电力项目九--运行监控首页显示
需求:在首页显示出设备运行情况,并去掉<br>换行符,每隔十分钟刷新一次页面. ElecMenuAction.java 首先注入运行监控service public class ElecM ...
- 在SAP UI中使用纯JavaScript显示产品主数据的3D模型视图
在Jerry写这篇文章时,通过Google才知道,SAP其实是有自己的3D模型视图显示解决方案的. 故事要从Right Hemisphere说起,这是一家专业的企业级2D/3D模型浏览及转换的软件供应 ...
- HTML基础——网站首页显示页面
1.表格标签: border设置边框,align设置位置(居中等),bgcolor设置背景颜色,cellspacing设置边框之间的空隙,cellpadding设置边框与里面内容的间距. table表 ...
- zencart分类页每页显示产品数量自定义选择的方法
zencart默认分类页每页显示产品数量是固定的,如何让顾客可以选择每页显示的产品的数量呢?效果图 方式一:全部展示 方式二:下拉菜单 修改方法 1.导入sql INSERT INTO configu ...
随机推荐
- 关于oracle数据库(3)
show user ; 查看当前用户的名称 select * from tab; 查看当前用户有哪些表 删除用户 drop user jky cascade; //cascade; 意思是级联操作 ...
- HDU 5775 Bubble Sort
对于一个数,可以记录3个位置:初始位置,终点位置,最右边的位置. 初始位置和终点位置容易计算.最多边的位置即为初始状态下该数的位置+该数之后还有多少数比该数小. 三个位置中的min即为leftpos, ...
- linux时间同步,ntpd、ntpdate
linux时间同步,ntpd.ntpdate 在Windwos中,系统时间的设置很简单,界面操作,通俗易懂.而且设置后,重启,关机都没关系.系统时间会自动保存在Bios的时钟里面,启动计算机的时候,系 ...
- 第二十节,基本数据类型,集合set、综合应用新数据更新老数据
基本数据类型,集合set.综合应用新数据更新老数据 创建两个字典新数据,更新原始数据,a为原始数据,b为新数据 1,分别获取到a字典和b字典的key(键),将两个字典的键分别转换成两个集合 2,找出a ...
- 第7章 一个java源文件中只能有一个public类
一个Java源文件中最多只能有一个public类, 1)当有一个public类时,源文件名必须与之一致,否则无法编译, 2)如果源文件中没有一个public类,则文件名与类中没有一致性要求. 至于ma ...
- 运行出第一个程序Hello World、第二个程序网页浏览器
很长时间没有发博客记录我的奋斗历程了,原因不外乎遇到了对我而言“巨大的”困难. 经历了长期的找不到合适的教材.找不到Xcode资源.运行不出例程的痛苦以后,近日终于走上正轨. 现在补发一个过去2个月来 ...
- Qt之QTextCodec乱谈
何处开始呢? 一旦在Qt程序中出现latin1字符集以外的字符,几乎大家无一例外的会用到 QTextCodec. 而不少网友不分青红皂白,一旦用到中文,就同时使用下面3条指令(其中textc 取为 g ...
- pci 相关资料
1.http://www.cnblogs.com/image-eye/archive/2012/02/15/2352699.html
- android平台编译IW
不知道怎么编译IW,所以就搜索网络上的博客http://blog.csdn.net/jksl007/article/details/16862435 首先,iw依赖于libnl库,而目前android ...
- asp.net如何删除文件夹及文件内容操作
static void DeleteDirectory(string dir) { && Directory.GetFiles(dir).Length == ) { Directory ...