首页 > 未分类 > Magento顶部导航条显示、首页产品显示、最新产品显示、左侧分类显示

Magento顶部导航条显示、首页产品显示、最新产品显示、左侧分类显示

Tips: Magento 顶部导航条显示、首页产品显示、最新产品显示、左侧分类显示;
操作必须清除缓存才能见效。
顶部导航条显示
首先,要添加产品和分类,根分类下的次级分类将成为
导航条中的条目,第三级分类将会在二级分类的弹出菜单中显示; 添加产品时,产品的Qty值要大于0,需要有库存。
首页产品显示/

最新产品显示

cms->pages->HomePage
content中添加id为3的分类下的所有产品:
{{block type=”catalog/product_list” name=”home.catalog.product.list” alias=”products_homepage” category_id=”3″ template=”catalog/product/list.phtml”}}
design中添加,用以显示最新上传产品以及首页其它部分显示商品:
<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>
左侧显示分类菜单导航:
首先在后台设置好你要使用的模板;
设置完成后,找到文件:
D:wampwwwmagentoappdesignfrontenddefaultmodernlayoutcatalog.xml

<reference name=”left”>中添加:

<block type=”catalog/navigation” name=”catalog.leftnav” template=”catalog/navigation/left_nav.phtml” />
找到: D:wampwwwmagentoappdesignfrontenddefaultmoderntemplatecatalog 如果没有navigation文件夹则新建; 在navigation文件夹中新建: left_nav.phtml
left_nav.phtml中的代码如下:
<h2>Browse</h2>
<div>
<ul id=”nav_category”>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
</div>
<?php echo $this->getChildHtml(‘topLeftLinks’) ?>
进入二级分类页面,左侧将显示二级分类下所有分类,
进入最终级分类,左侧将不显示分类菜单导航;
Advertisements
分类:未分类
  1. 还没有评论。
  1. No trackbacks yet.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: