<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>常州SEO果冻</title>
	<atom:link href="http://www.vr188.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vr188.com</link>
	<description></description>
	<lastBuildDate>Tue, 14 Feb 2012 06:54:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Magento目录页设置布局及添加新布局的方法</title>
		<link>http://www.vr188.com/seo/magento%e7%9b%ae%e5%bd%95%e9%a1%b5%e8%ae%be%e7%bd%ae%e5%b8%83%e5%b1%80%e5%8f%8a%e6%b7%bb%e5%8a%a0%e6%96%b0%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95/</link>
		<comments>http://www.vr188.com/seo/magento%e7%9b%ae%e5%bd%95%e9%a1%b5%e8%ae%be%e7%bd%ae%e5%b8%83%e5%b1%80%e5%8f%8a%e6%b7%bb%e5%8a%a0%e6%96%b0%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 06:54:21 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=358</guid>
		<description><![CDATA[<strong>Magento目录页设置布局</strong> ：

在catalog.xml的&#60;default&#62;里添加
<blockquote>&#60;reference name="root"&#62;
&#60;action method="setTemplate"&#62;&#60;template&#62;page/2columns-left.phtml&#60;/template&#62;&#60;/action&#62;
&#60;action method="setIsHandle"&#62;&#60;applied&#62;1&#60;/applied&#62;&#60;/action&#62;
&#60;/reference&#62;</blockquote>
就把Magento的目录布局从3列设成带左侧的两列了。

<a href="http://sjolzy.cn/Magento-catalog-page-layout-and-add-a-new-layout-setting-method.html">Magento添加新布局</a> 方法：

在app/code/core/Mage/Page/etc/config.xml这个文件里的&#60;global&#62;&#60;page&#62;&#60;layouts&#62;里面添加
<blockquote>&#60;new_columns module="page" translate="label"&#62;
&#60;label&#62;new column&#60;/label&#62;
&#60;template&#62;page/new.phtml&#60;/template&#62;
&#60;layout_handle&#62;page_new_columns&#60;/layout_handle&#62;
&#60;/new_columns&#62;</blockquote>
在后台选择布局的时候就多了new column这个选项。或者通过上面代码选择这个新布局。]]></description>
			<content:encoded><![CDATA[<p><strong>Magento目录页设置布局</strong> ：</p>
<p>在catalog.xml的&lt;default&gt;里添加</p>
<blockquote><p>&lt;reference name=”root”&gt;<br />
&lt;action method=”setTemplate”&gt;&lt;template&gt;page/2columns-left.phtml&lt;/template&gt;&lt;/action&gt;<br />
&lt;action method=”setIsHandle”&gt;&lt;applied&gt;1&lt;/applied&gt;&lt;/action&gt;<br />
&lt;/reference&gt;</p></blockquote>
<p>就把Magento的目录布局从3列设成带左侧的两列了。</p>
<p><a href="http://sjolzy.cn/Magento-catalog-page-layout-and-add-a-new-layout-setting-method.html">Magento添加新布局</a> 方法：</p>
<p>在app/code/core/Mage/Page/etc/config.xml这个文件里的&lt;global&gt;&lt;page&gt;&lt;layouts&gt;里面添加</p>
<blockquote><p>&lt;new_columns module=”page” translate=”label”&gt;<br />
&lt;label&gt;new column&lt;/label&gt;<br />
&lt;template&gt;page/new.phtml&lt;/template&gt;<br />
&lt;layout_handle&gt;page_new_columns&lt;/layout_handle&gt;<br />
&lt;/new_columns&gt;</p></blockquote>
<p>在后台选择布局的时候就多了new column这个选项。或者通过上面代码选择这个新布局。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/zen-cart/zen-cart%e7%bd%91%e5%ba%97%e5%a6%82%e4%bd%95%e5%a2%9e%e5%8a%a0%e4%b8%80%e4%b8%aa%e5%8f%af%e4%b8%8b%e8%bd%bd%e7%9a%84%e5%95%86%e5%93%81/" title="zen cart网店如何增加一个可下载的商品">zen cart网店如何增加一个可下载的商品</a> (1)</li><li>2011 年 9 月 20 日 -- <a href="http://www.vr188.com/seo/%e6%96%b0%e7%ab%99%e6%8e%92%e5%90%8d%e4%b8%8d%e7%a8%b3%e5%ae%9a%e7%9a%84google%e5%b9%bd%e7%81%b5%e7%8e%b0%e8%b1%a1/" title="新站排名不稳定的Google幽灵现象">新站排名不稳定的Google幽灵现象</a> (0)</li><li>2011 年 8 月 22 日 -- <a href="http://www.vr188.com/seo/8%e4%b8%aaprestashop%e5%ae%89%e8%a3%85%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/" title="8个Prestashop安装常见问题及解决方法">8个Prestashop安装常见问题及解决方法</a> (0)</li><li>2012 年 1 月 11 日 -- <a href="http://www.vr188.com/seo/how-to-make-your-site-pr5-in-31-days/" title="How to make your site PR5 in 31 days">How to make your site PR5 in 31 days</a> (0)</li><li>2011 年 12 月 22 日 -- <a href="http://www.vr188.com/seo/magento%e5%bf%85%e5%a4%87%e6%8f%92%e4%bb%b6%e5%a4%a7%e6%94%be%e9%80%81/" title="magento必备插件大放送 ">magento必备插件大放送 </a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e7%9b%ae%e5%bd%95%e9%a1%b5%e8%ae%be%e7%bd%ae%e5%b8%83%e5%b1%80%e5%8f%8a%e6%b7%bb%e5%8a%a0%e6%96%b0%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento带分页添加新产品至CMS Page</title>
		<link>http://www.vr188.com/seo/magento%e5%b8%a6%e5%88%86%e9%a1%b5%e6%b7%bb%e5%8a%a0%e6%96%b0%e4%ba%a7%e5%93%81%e8%87%b3cms-page/</link>
		<comments>http://www.vr188.com/seo/magento%e5%b8%a6%e5%88%86%e9%a1%b5%e6%b7%bb%e5%8a%a0%e6%96%b0%e4%ba%a7%e5%93%81%e8%87%b3cms-page/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 07:29:11 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=355</guid>
		<description><![CDATA[在Magento我们经常有的做法是建立一个可以调用新产品的block，然后通过：
<pre>{{block type="catalog/product_new" column_count="6" products_count="100" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}</pre>
调用，这样就可以在Magento首页显示新到产品 或者其他位置调用，前提要有添加新产品并设置新产品期间了。

现在是要让Magento创建一个带分页功能的新到产品展示Page，自动展示有设置了“Set Product as New from Date - Set Product as New to Date”的新到产品。

话入正题。Magento在CMS Page添加带分页功能的新到产品页面步骤如下；

创建路径：app/code/local/Mage/Catalog/Block/Product

创建文件：app/code/local/Mage/Catalog/Block/Product/New.php

New.php将覆盖掉magento core里的New.php，所以如果原来New.php有在使用的话local的这个文件另外命名区分开。

添加以下内容到New.php
<pre>&#60;?php
//chen@sjolzy.cn
class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_List
{
   function get_prod_count()
   {
      //unset any saved limits
      Mage::getSingleton('catalog/session')-&#62;unsLimitPage();
      return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 12;
   }// get_prod_count

   function get_cur_page()
   {
      return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
   }// get_cur_page

   /**
    * Retrieve loaded category collection
    *
    * @return Mage_Eav_Model_Entity_Collection_Abstract
   **/
   protected function _getProductCollection()
   {
      $todayDate  = Mage::app()-&#62;getLocale()-&#62;date()-&#62;toString(Varien_Date::DATETIME_INTERNAL_FORMAT);

      $collection = Mage::getResourceModel('catalog/product_collection');
      $collection-&#62;setVisibility(Mage::getSingleton('catalog/product_visibility')-&#62;getVisibleInCatalogIds());

      $collection = $this-&#62;_addProductAttributesAndPrices($collection)
         -&#62;addStoreFilter()
         -&#62;addAttributeToFilter('news_from_date', array('date' =&#62; true, 'to' =&#62; $todayDate))
         -&#62;addAttributeToFilter('news_to_date', array('or'=&#62; array(
            0 =&#62; array('date' =&#62; true, 'from' =&#62; $todayDate),
            1 =&#62; array('is' =&#62; new Zend_Db_Expr('null')))
         ), 'left')
         -&#62;addAttributeToSort('news_from_date', 'desc')
         -&#62;setPageSize($this-&#62;get_prod_count())
         -&#62;setCurPage($this-&#62;get_cur_page());

      $this-&#62;setProductCollection($collection);

      return $collection;
   }// _getProductCollection
}// Mage_Catalog_Block_Product_New
?&#62;</pre>
保存后，创建CMS里的新到产品列表Page。添加后，设置Design的内容为以下内容：
<pre>&#60;reference name="content"&#62;
   &#60;block type="catalog/product_new" name="product_new" template="catalog/product/list.phtml"&#62;
      &#60;action method="setCategoryId"&#62;&#60;category_id&#62;10&#60;/category_id&#62;&#60;/action&#62;
      &#60;action method="setColumnCount"&#62;&#60;column_count&#62;6&#60;/column_count&#62;&#60;/action&#62;
      &#60;action method="setProductsCount"&#62;&#60;count&#62;0&#60;/count&#62;&#60;/action&#62;
      &#60;block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"&#62;
         &#60;block type="page/html_pager" name="product_list_toolbar_pager" /&#62;
         &#60;action method="setDefaultGridPerPage"&#62;&#60;limit&#62;12&#60;/limit&#62;&#60;/action&#62;
         &#60;action method="addPagerLimit"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;12&#60;/limit&#62;&#60;/action&#62;
         &#60;action method="addPagerLimit"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;24&#60;/limit&#62;&#60;/action&#62;
         &#60;action method="addPagerLimit"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;36&#60;/limit&#62;&#60;/action&#62;
         &#60;action method="addPagerLimit"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;48&#60;/limit&#62;&#60;/action&#62;
         &#60;action method="addPagerLimit" translate="label"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;all&#60;/limit&#62;&#60;label&#62;All&#60;/label&#62;&#60;/action&#62;
      &#60;/block&#62;
      &#60;action method="addColumnCountLayoutDepend"&#62;&#60;layout&#62;one_column&#60;/layout&#62;&#60;count&#62;6&#60;/count&#62;&#60;/action&#62;
      &#60;action method="setToolbarBlockName"&#62;&#60;name&#62;product_list_toolbar&#60;/name&#62;&#60;/action&#62;
   &#60;/block&#62;
&#60;/reference&#62;</pre>
这样就可以保存查看效果了。以下简要备记几点说明：
<pre>&#60;block type="catalog/product_new" name="product_new" template="catalog/product/list.phtml"&#62;</pre>
设置块的类型和使用的模版文件，这个文件也是产品列表页用的。“catalog/product_new” 这个就是更换了的New.php。
<pre>&#60;action method="setCategoryId"&#62;&#60;category_id&#62;10&#60;/category_id&#62;&#60;/action&#62;</pre>
setCategoryId 设置目录ID，可以是网站的根目录ID，或者某目录。
<pre>&#60;action method="setColumnCount"&#62;&#60;column_count&#62;6&#60;/column_count&#62;&#60;/action&#62;</pre>
setColumnCount 新到产品的Page产品每页产品数为6
<pre>&#60;action method="setProductsCount"&#62;&#60;count&#62;0&#60;/count&#62;&#60;/action&#62;</pre>
setProductsCount 设为0的话就是该指定目录的所有产品，否者按限定数
<pre>&#60;block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"&#62;
&#60;block type="page/html_pager" name="product_list_toolbar_pager" /&#62;</pre>
为新到产品列表页面添加目录页的工具条和分页
<pre>&#60;action method="setDefaultGridPerPage"&#62;&#60;limit&#62;12&#60;/limit&#62;&#60;/action&#62;</pre>
setDefaultGridPerPage 配置工具栏的产品显示数
<pre>&#60;action method="addPagerLimit"&#62;&#60;mode&#62;grid&#60;/mode&#62;&#60;limit&#62;12&#60;/limit&#62;&#60;/action&#62;</pre>
配置分页的产品数
<pre>&#60;action method="addColumnCountLayoutDepend"&#62;&#60;layout&#62;one_column&#60;/layout&#62;&#60;count&#62;6&#60;/count&#62;&#60;/action&#62;</pre>
one_column 布局定为6列
<pre>&#60;action method="setToolbarBlockName"&#62;&#60;name&#62;product_list_toolbar&#60;/name&#62;&#60;/action&#62;</pre>
工具条的命名

Page的Design部分设置好后，Content部分随便设下，保存，就能查看效果了。

这篇Magento添加新产品在CMS Page 是翻译<a href="http://www.dnawebagency.com/displaying-new-products-in-magento-with-pagination" target="_blank">老外</a>的，经实际操作完全可行。]]></description>
			<content:encoded><![CDATA[<p>在Magento我们经常有的做法是建立一个可以调用新产品的block，然后通过：</p>
<pre>{{block type="catalog/product_new" column_count="6" products_count="100" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}</pre>
<p>调用，这样就可以在Magento首页显示新到产品 或者其他位置调用，前提要有添加新产品并设置新产品期间了。</p>
<p>现在是要让Magento创建一个带分页功能的新到产品展示Page，自动展示有设置了“Set Product as New from Date &#8211; Set Product as New to Date”的新到产品。</p>
<p>话入正题。Magento在CMS Page添加带分页功能的新到产品页面步骤如下；</p>
<p>创建路径：app/code/local/Mage/Catalog/Block/Product</p>
<p>创建文件：app/code/local/Mage/Catalog/Block/Product/New.php</p>
<p>New.php将覆盖掉magento core里的New.php，所以如果原来New.php有在使用的话local的这个文件另外命名区分开。</p>
<p>添加以下内容到New.php</p>
<pre>&lt;?php
//chen@sjolzy.cn
class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_List
{
   function get_prod_count()
   {
      //unset any saved limits
      Mage::getSingleton('catalog/session')-&gt;unsLimitPage();
      return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 12;
   }// get_prod_count

   function get_cur_page()
   {
      return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
   }// get_cur_page

   /**
    * Retrieve loaded category collection
    *
    * @return Mage_Eav_Model_Entity_Collection_Abstract
   **/
   protected function _getProductCollection()
   {
      $todayDate  = Mage::app()-&gt;getLocale()-&gt;date()-&gt;toString(Varien_Date::DATETIME_INTERNAL_FORMAT);

      $collection = Mage::getResourceModel('catalog/product_collection');
      $collection-&gt;setVisibility(Mage::getSingleton('catalog/product_visibility')-&gt;getVisibleInCatalogIds());

      $collection = $this-&gt;_addProductAttributesAndPrices($collection)
         -&gt;addStoreFilter()
         -&gt;addAttributeToFilter('news_from_date', array('date' =&gt; true, 'to' =&gt; $todayDate))
         -&gt;addAttributeToFilter('news_to_date', array('or'=&gt; array(
            0 =&gt; array('date' =&gt; true, 'from' =&gt; $todayDate),
            1 =&gt; array('is' =&gt; new Zend_Db_Expr('null')))
         ), 'left')
         -&gt;addAttributeToSort('news_from_date', 'desc')
         -&gt;setPageSize($this-&gt;get_prod_count())
         -&gt;setCurPage($this-&gt;get_cur_page());

      $this-&gt;setProductCollection($collection);

      return $collection;
   }// _getProductCollection
}// Mage_Catalog_Block_Product_New
?&gt;</pre>
<p>保存后，创建CMS里的新到产品列表Page。添加后，设置Design的内容为以下内容：</p>
<pre>&lt;reference name="content"&gt;
   &lt;block type="catalog/product_new" name="product_new" template="catalog/product/list.phtml"&gt;
      &lt;action method="setCategoryId"&gt;&lt;category_id&gt;10&lt;/category_id&gt;&lt;/action&gt;
      &lt;action method="setColumnCount"&gt;&lt;column_count&gt;6&lt;/column_count&gt;&lt;/action&gt;
      &lt;action method="setProductsCount"&gt;&lt;count&gt;0&lt;/count&gt;&lt;/action&gt;
      &lt;block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"&gt;
         &lt;block type="page/html_pager" name="product_list_toolbar_pager" /&gt;
         &lt;action method="setDefaultGridPerPage"&gt;&lt;limit&gt;12&lt;/limit&gt;&lt;/action&gt;
         &lt;action method="addPagerLimit"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;12&lt;/limit&gt;&lt;/action&gt;
         &lt;action method="addPagerLimit"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;24&lt;/limit&gt;&lt;/action&gt;
         &lt;action method="addPagerLimit"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;36&lt;/limit&gt;&lt;/action&gt;
         &lt;action method="addPagerLimit"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;48&lt;/limit&gt;&lt;/action&gt;
         &lt;action method="addPagerLimit" translate="label"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;all&lt;/limit&gt;&lt;label&gt;All&lt;/label&gt;&lt;/action&gt;
      &lt;/block&gt;
      &lt;action method="addColumnCountLayoutDepend"&gt;&lt;layout&gt;one_column&lt;/layout&gt;&lt;count&gt;6&lt;/count&gt;&lt;/action&gt;
      &lt;action method="setToolbarBlockName"&gt;&lt;name&gt;product_list_toolbar&lt;/name&gt;&lt;/action&gt;
   &lt;/block&gt;
&lt;/reference&gt;</pre>
<p>这样就可以保存查看效果了。以下简要备记几点说明：</p>
<pre>&lt;block type="catalog/product_new" name="product_new" template="catalog/product/list.phtml"&gt;</pre>
<p>设置块的类型和使用的模版文件，这个文件也是产品列表页用的。“catalog/product_new” 这个就是更换了的New.php。</p>
<pre>&lt;action method="setCategoryId"&gt;&lt;category_id&gt;10&lt;/category_id&gt;&lt;/action&gt;</pre>
<p>setCategoryId 设置目录ID，可以是网站的根目录ID，或者某目录。</p>
<pre>&lt;action method="setColumnCount"&gt;&lt;column_count&gt;6&lt;/column_count&gt;&lt;/action&gt;</pre>
<p>setColumnCount 新到产品的Page产品每页产品数为6</p>
<pre>&lt;action method="setProductsCount"&gt;&lt;count&gt;0&lt;/count&gt;&lt;/action&gt;</pre>
<p>setProductsCount 设为0的话就是该指定目录的所有产品，否者按限定数</p>
<pre>&lt;block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"&gt;
&lt;block type="page/html_pager" name="product_list_toolbar_pager" /&gt;</pre>
<p>为新到产品列表页面添加目录页的工具条和分页</p>
<pre>&lt;action method="setDefaultGridPerPage"&gt;&lt;limit&gt;12&lt;/limit&gt;&lt;/action&gt;</pre>
<p>setDefaultGridPerPage 配置工具栏的产品显示数</p>
<pre>&lt;action method="addPagerLimit"&gt;&lt;mode&gt;grid&lt;/mode&gt;&lt;limit&gt;12&lt;/limit&gt;&lt;/action&gt;</pre>
<p>配置分页的产品数</p>
<pre>&lt;action method="addColumnCountLayoutDepend"&gt;&lt;layout&gt;one_column&lt;/layout&gt;&lt;count&gt;6&lt;/count&gt;&lt;/action&gt;</pre>
<p>one_column 布局定为6列</p>
<pre>&lt;action method="setToolbarBlockName"&gt;&lt;name&gt;product_list_toolbar&lt;/name&gt;&lt;/action&gt;</pre>
<p>工具条的命名</p>
<p>Page的Design部分设置好后，Content部分随便设下，保存，就能查看效果了。</p>
<p>这篇Magento添加新产品在CMS Page 是翻译<a href="http://www.dnawebagency.com/displaying-new-products-in-magento-with-pagination" target="_blank">老外</a>的，经实际操作完全可行。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2012 年 1 月 9 日 -- <a href="http://www.vr188.com/seo/%e5%a6%82%e4%bd%95%e5%9c%a8magento%e9%a1%b5%e9%9d%a2%e5%b7%a6%e8%be%b9%e5%a2%9e%e5%8a%a0%e5%88%86%e7%b1%bb%e8%8f%9c%e5%8d%95/" title="如何在Magento页面左边增加分类菜单">如何在Magento页面左边增加分类菜单</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/zen-cart/zen-cart%ef%bc%8czen-cart%e5%a6%82%e4%bd%95%e6%89%b9%e9%87%8f%e8%ae%be%e7%bd%ae%e4%ba%a7%e5%93%81%e9%a1%b5%e7%9a%84meta%e7%ad%89%e4%bf%a1%e6%81%af/" title="zen-cart，zen cart如何批量设置产品页的META等信息">zen-cart，zen cart如何批量设置产品页的META等信息</a> (2)</li><li>2011 年 8 月 11 日 -- <a href="http://www.vr188.com/zen-cart/zencart_meta_tag_seo/" title="Zencart程序之Meta标签优化">Zencart程序之Meta标签优化</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/share/%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8google-adwords%e5%85%b3%e9%94%ae%e8%af%8d%e5%b7%a5%e5%85%b7%e5%af%bb%e6%89%be%e9%ab%98%e5%95%86%e4%b8%9a%e4%bb%b7%e5%80%bc%e7%9a%84%e9%95%bf%e5%b0%be%e8%af%8d/" title="如何利用Google Adwords关键词工具寻找高商业价值的长尾词?">如何利用Google Adwords关键词工具寻找高商业价值的长尾词?</a> (0)</li><li>2011 年 9 月 17 日 -- <a href="http://www.vr188.com/seo/10%e4%b8%aa%e5%9b%bd%e5%a4%96%e5%b8%b8%e7%94%a8%e7%9a%84seo%e4%bc%98%e5%8c%96%e5%b7%a5%e5%85%b7/" title="10个国外常用的SEO优化工具">10个国外常用的SEO优化工具</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e5%b8%a6%e5%88%86%e9%a1%b5%e6%b7%bb%e5%8a%a0%e6%96%b0%e4%ba%a7%e5%93%81%e8%87%b3cms-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento修改列表页每行商品显示数量</title>
		<link>http://www.vr188.com/seo/magento%e4%bf%ae%e6%94%b9%e5%88%97%e8%a1%a8%e9%a1%b5%e6%af%8f%e8%a1%8c%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e6%95%b0%e9%87%8f/</link>
		<comments>http://www.vr188.com/seo/magento%e4%bf%ae%e6%94%b9%e5%88%97%e8%a1%a8%e9%a1%b5%e6%af%8f%e8%a1%8c%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e6%95%b0%e9%87%8f/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 04:02:06 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=352</guid>
		<description><![CDATA[其实很简单，找到模板文件下list.phtml文件app\design\frontend\base\default\template\catalog\product
<pre> $_columnCount =  $this-&#62;getColumnCount();</pre>
将 $this-&#62;getColumnCount()改为你想每行显示的商品数就行了，当然这里改过后，还要配合css才行，有的人会问，这个 $this-&#62;getColumnCount()在哪来的，模板文件中都指出来了，看模板文件首部
<pre>/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */</pre>
路径就是Mage/Catalog/Block/Product/,这里可以搜下，呵呵，最简单的方法，在Abstract.php找到了public function getColumnCount(){…}大概了解，就是个判断，$this-&#62;setData(‘column_count’, $this-&#62;_defaultColumnCount);这句大概就是赋值吧，搜索下$this-&#62;_defaultColumnCount，果然 protected $_defaultColumnCount = 3;这里的3就是你要的行商品数，改你想要吧。]]></description>
			<content:encoded><![CDATA[<p>其实很简单，找到模板文件下list.phtml文件app\design\frontend\base\default\template\catalog\product</p>
<pre> $_columnCount =  $this-&gt;getColumnCount();</pre>
<p>将 $this-&gt;getColumnCount()改为你想每行显示的商品数就行了，当然这里改过后，还要配合css才行，有的人会问，这个 $this-&gt;getColumnCount()在哪来的，模板文件中都指出来了，看模板文件首部</p>
<pre>/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */</pre>
<p>路径就是Mage/Catalog/Block/Product/,这里可以搜下，呵呵，最简单的方法，在Abstract.php找到了public function getColumnCount(){…}大概了解，就是个判断，$this-&gt;setData(‘column_count’, $this-&gt;_defaultColumnCount);这句大概就是赋值吧，搜索下$this-&gt;_defaultColumnCount，果然 protected $_defaultColumnCount = 3;这里的3就是你要的行商品数，改你想要吧。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2012 年 2 月 8 日 -- <a href="http://www.vr188.com/seo/%e8%ae%be%e7%bd%aemagento%e5%88%97%e8%a1%a8%e9%a1%b5%e4%ba%a7%e5%93%81%e6%95%b0%e9%87%8f/" title="设置magento列表页产品数量">设置magento列表页产品数量</a> (0)</li><li>2011 年 8 月 14 日 -- <a href="http://www.vr188.com/digital/zen-cart_caiji/" title="采集各类Zencart购物网站商品数据，产品图片！">采集各类Zencart购物网站商品数据，产品图片！</a> (0)</li><li>2011 年 8 月 27 日 -- <a href="http://www.vr188.com/seo/%e6%b5%b7%e8%b4%b8%e4%bc%9a%e7%bb%8f%e5%85%b8%e9%9b%86%e7%b2%b9%ef%bc%88%e4%ba%8c%ef%bc%89/" title="海贸会经典集粹（二）">海贸会经典集粹（二）</a> (3)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/zen-cart/%e7%ac%ac%e4%b8%89%e4%bf%ae%e6%94%b9zen-cart%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b/" title="第三修改zen-cart二次开发教程">第三修改zen-cart二次开发教程</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/digital/%e7%81%ab%e8%bd%a6%e5%a4%b4%e9%87%87%e9%9b%86%e5%99%a8%e6%95%99%e7%a8%8b%e4%b9%8b%e5%ae%9e%e6%88%98%e6%bc%94%e7%bb%83%ef%bc%88%e4%b8%80%ef%bc%89%e2%80%94%e2%80%94cms%e9%87%87%e9%9b%86%e8%a7%84/" title="火车头采集器教程之实战演练（一）——CMS采集规则编写 ">火车头采集器教程之实战演练（一）——CMS采集规则编写 </a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e4%bf%ae%e6%94%b9%e5%88%97%e8%a1%a8%e9%a1%b5%e6%af%8f%e8%a1%8c%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e6%95%b0%e9%87%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>设置magento列表页产品数量</title>
		<link>http://www.vr188.com/seo/%e8%ae%be%e7%bd%aemagento%e5%88%97%e8%a1%a8%e9%a1%b5%e4%ba%a7%e5%93%81%e6%95%b0%e9%87%8f/</link>
		<comments>http://www.vr188.com/seo/%e8%ae%be%e7%bd%aemagento%e5%88%97%e8%a1%a8%e9%a1%b5%e4%ba%a7%e5%93%81%e6%95%b0%e9%87%8f/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 08:17:16 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=349</guid>
		<description><![CDATA[&#160;
<div>
<div id="attachment_1402"><img title="magento产品显示数量" src="http://www.hellokeykey.com/wp-content/uploads/2011/02/magento-show-per-page.png" alt="magento产品显示数量" width="600" height="215" />magento产品显示数量

</div>
由于使用不同的模板，magento产品列表页每页显示产品的数量总是变化的，我经常需要改动它。今天在改动产品显示数量的时候结果发现不起作用， 我的缓存是关闭的，我查下数据库的core_congfig表，设置有存到数据库中。我想不应该是XML文件在控制吧，因为我之前接触的所有模板都是后台 设置下就可以了，这个模板不会这么点背吧。结果后来发现还真是magento模板的XML文件在控制产品列表页的显示数量。我介绍下magento后台和 在模板的XML文件中如何设置产品的显示数量，在XML中设置优先级高于后台设置，但是如果magento后台设置起作用，就不要去修改文件。

1.magento后台设置产品列表页产品数量

&#160;

进入magento后台 system -&#62; configuration -&#62; catalog -&#62; frontend ，如下图
<div id="attachment_1401"><img title="magento设置产品页产品显示数量" src="http://www.hellokeykey.com/wp-content/uploads/2011/02/set-product-number-600x346.png" alt="magento设置产品页产品显示数量" width="600" height="346" />magento设置产品页产品显示数量

</div>
分别设置Grid（表格）和List列表页产品显示数量，以及是否允许在一页显示全部产品。如果你的一个magento分类有几百件产品，几千件产品，就不要设置在一页显示全部产品了。

2.在xml中控制产品页显示数量

文件路径 app\design\frontend\default\blank（我使用的是blank模板文件，你换成你的模板文件路径）\layout\catalog.xml 文件
<div>
<div id="highlighter_17773">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div></td>
<td>
<div>
<div><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list_toolbar"</code> <code>name</code><code>=</code><code>"product_list_toolbar"</code> <code>template</code><code>=</code><code>"catalog/product/list/toolbar.phtml"</code><code>&#62;</code></div>
<div><code>    </code><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"page/html_pager"</code> <code>name</code><code>=</code><code>"product_list_toolbar_pager"</code><code>/&#62;</code></div>
<div><code>    </code><code>&#60;!-- The following code shows how to set your own pager increments --&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"setDefaultListPerPage"</code><code>&#62;&#60;</code><code>limit</code><code>&#62;10&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"setDefaultGridPerPage"</code><code>&#62;&#60;</code><code>limit</code><code>&#62;8&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;list&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;10&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;list&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;20&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;list&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;30&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code> <code>translate</code><code>=</code><code>"label"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;list&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;all&#60;/</code><code>limit</code><code>&#62;&#60;</code><code>label</code><code>&#62;All&#60;/</code><code>label</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;grid&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;8&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;grid&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;16&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;grid&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;24&#60;/</code><code>limit</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>        </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code> <code>translate</code><code>=</code><code>"label"</code><code>&#62;&#60;</code><code>mode</code><code>&#62;grid&#60;/</code><code>mode</code><code>&#62;&#60;</code><code>limit</code><code>&#62;all&#60;/</code><code>limit</code><code>&#62;&#60;</code><code>label</code><code>&#62;All&#60;/</code><code>label</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></div>
<div><code>&#60;/</code><code>block</code><code>&#62;</code></div>
</div></td>
</tr>
</tbody>
</table>
</div>
</div>
找到如上代码，是在xml文件中控制产品列表页产品的显示数量选项。观察下，改下试下就知道了。一般来说，magento后台设置就起作用了，如果 不可以试下在文件中修改。后来发现，这段设置每页显示数量的代码一般都是注释掉的，我这个模板是没有注释掉，注释掉这段代码，在magento后台设置就 起作用了。

注意：本例使用magento1.5版本进行讲解，注意不同版本是否有区别。

转载表明出处：www.hellokeykey.com

</div>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<div>
<div id="attachment_1402"><img title="magento产品显示数量" src="http://www.hellokeykey.com/wp-content/uploads/2011/02/magento-show-per-page.png" alt="magento show per page 设置magento列表页产品数量" width="600" height="215" />magento产品显示数量</p>
</div>
<p>由于使用不同的模板，magento产品列表页每页显示产品的数量总是变化的，我经常需要改动它。今天在改动产品显示数量的时候结果发现不起作用， 我的缓存是关闭的，我查下数据库的core_congfig表，设置有存到数据库中。我想不应该是XML文件在控制吧，因为我之前接触的所有模板都是后台 设置下就可以了，这个模板不会这么点背吧。结果后来发现还真是magento模板的XML文件在控制产品列表页的显示数量。我介绍下magento后台和 在模板的XML文件中如何设置产品的显示数量，在XML中设置优先级高于后台设置，但是如果magento后台设置起作用，就不要去修改文件。</p>
<p>1.magento后台设置产品列表页产品数量</p>
<p>&nbsp;</p>
<p>进入magento后台 system -&gt; configuration -&gt; catalog -&gt; frontend ，如下图</p>
<div id="attachment_1401"><img title="magento设置产品页产品显示数量" src="http://www.hellokeykey.com/wp-content/uploads/2011/02/set-product-number-600x346.png" alt="set product number 600x346 设置magento列表页产品数量" width="600" height="346" />magento设置产品页产品显示数量</p>
</div>
<p>分别设置Grid（表格）和List列表页产品显示数量，以及是否允许在一页显示全部产品。如果你的一个magento分类有几百件产品，几千件产品，就不要设置在一页显示全部产品了。</p>
<p>2.在xml中控制产品页显示数量</p>
<p>文件路径 app\design\frontend\default\blank（我使用的是blank模板文件，你换成你的模板文件路径）\layout\catalog.xml 文件</p>
<div>
<div id="highlighter_17773">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
</td>
<td>
<div>
<div><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list_toolbar"</code> <code>name</code><code>=</code><code>"product_list_toolbar"</code> <code>template</code><code>=</code><code>"catalog/product/list/toolbar.phtml"</code><code>&gt;</code></div>
<div><code>    </code><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"page/html_pager"</code> <code>name</code><code>=</code><code>"product_list_toolbar_pager"</code><code>/&gt;</code></div>
<div><code>    </code><code>&lt;!-- The following code shows how to set your own pager increments --&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"setDefaultListPerPage"</code><code>&gt;&lt;</code><code>limit</code><code>&gt;10&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"setDefaultGridPerPage"</code><code>&gt;&lt;</code><code>limit</code><code>&gt;8&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;list&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;10&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;list&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;20&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;list&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;30&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code> <code>translate</code><code>=</code><code>"label"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;list&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;all&lt;/</code><code>limit</code><code>&gt;&lt;</code><code>label</code><code>&gt;All&lt;/</code><code>label</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;grid&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;8&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;grid&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;16&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;grid&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;24&lt;/</code><code>limit</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>        </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"addPagerLimit"</code> <code>translate</code><code>=</code><code>"label"</code><code>&gt;&lt;</code><code>mode</code><code>&gt;grid&lt;/</code><code>mode</code><code>&gt;&lt;</code><code>limit</code><code>&gt;all&lt;/</code><code>limit</code><code>&gt;&lt;</code><code>label</code><code>&gt;All&lt;/</code><code>label</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></div>
<div><code>&lt;/</code><code>block</code><code>&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>找到如上代码，是在xml文件中控制产品列表页产品的显示数量选项。观察下，改下试下就知道了。一般来说，magento后台设置就起作用了，如果 不可以试下在文件中修改。后来发现，这段设置每页显示数量的代码一般都是注释掉的，我这个模板是没有注释掉，注释掉这段代码，在magento后台设置就 起作用了。</p>
<p>注意：本例使用magento1.5版本进行讲解，注意不同版本是否有区别。</p>
<p>转载表明出处：www.hellokeykey.com</p>
</div>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2012 年 1 月 9 日 -- <a href="http://www.vr188.com/seo/%e5%9c%a8magento%e4%ba%a7%e5%93%81%e5%88%86%e7%b1%bb%e9%a1%b5%e9%9d%a2%e5%88%9b%e5%bb%ba%e6%8e%a8%e8%8d%90%e4%ba%a7%e5%93%81%ef%bc%88featured-products%ef%bc%89/" title="在Magento产品分类页面创建推荐产品（Featured Products）">在Magento产品分类页面创建推荐产品（Featured Products）</a> (0)</li><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/replica/%e4%bb%bf%e7%89%8c%e5%a4%96%e8%b4%b8%e4%b9%8bseo%e6%96%b0%e6%89%8b%e5%85%a5%e9%97%a8%e5%b8%b8%e8%af%86/" title="仿牌外贸之seo新手入门常识">仿牌外贸之seo新手入门常识</a> (0)</li><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/seo/%e5%85%b3%e9%94%ae%e8%af%8d%e5%9f%9f%e5%90%8d%e4%b8%8egoogle%e6%8e%92%e5%90%8d%e5%85%b3%e7%b3%bb%e6%96%b0%e5%8a%a8%e5%90%91/" title="关键词域名与google排名关系新动向">关键词域名与google排名关系新动向</a> (1)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/replica/seo%e9%9c%80%e8%a6%81%e6%8e%8c%e6%8f%a1%e4%bb%80%e4%b9%88/" title="SEO需要掌握什么 ">SEO需要掌握什么 </a> (1)</li><li>2012 年 1 月 18 日 -- <a href="http://www.vr188.com/seo/linux-vps%e5%ae%89%e8%a3%85virtualminwebmin%e9%9d%a2%e6%9d%bf/" title="linux vps安装Virtualmin/Webmin面板">linux vps安装Virtualmin/Webmin面板</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/%e8%ae%be%e7%bd%aemagento%e5%88%97%e8%a1%a8%e9%a1%b5%e4%ba%a7%e5%93%81%e6%95%b0%e9%87%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento首页显示新产品、控制每排个数</title>
		<link>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e3%80%81%e6%8e%a7%e5%88%b6%e6%af%8f%e6%8e%92%e4%b8%aa%e6%95%b0/</link>
		<comments>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e3%80%81%e6%8e%a7%e5%88%b6%e6%af%8f%e6%8e%92%e4%b8%aa%e6%95%b0/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 08:06:10 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=347</guid>
		<description><![CDATA[在magento首页显示你的新产品可以通过下面几个简单步骤来实现：

step 1：登陆后台，打开 cms -&#62; Manage Pages --&#62; Home Page ---&#62; General Information ----&#62; content

step 2：在content中添加

{{block type="catalog/product_new"name="home.catalog.product.new"alias="product_homepage"template="catalog/product/new.phtml"}}

or

{{widget type="catalog/product_widget_new" products_count="6" template="catalog/product/widget/new/content/new_grid.phtml"}}

products_count //控制产品个数；

new_grid  / new_list 排列显示不同

注：新增产品并不知自动 显示在新产品列表。你必须录入一些产品并在后台产品General 页明确设置 ‘Set Product as New from Date’ 和‘Set Product as New to Date’ 才能生效。

首页新产品换行设置：

修改文件：app\design\frontend\default\default\template\catalog\product \new.phtml

&#60;?php if (($_products = $this-&#62;getProductCollection()) &#38;&#38; $_products-&#62;getSize()): ?&#62;

&#60;h3&#62;&#60;?php echo $this-&#62;__('New Products') ?&#62;&#60;/h3&#62;
&#60;table cellspacing="0" style="width:100%; float:left;"&#62;

&#60;?php $i=0; foreach ($_products-&#62;getItems() as $_product): ?&#62; &#60;!-- 读取新产品，显示数量由new.php设置 --&#62;

&#60;?php if ($i%4==0): ?&#62; &#60;!--以下三行控制增加&#60;tr&#62;，刚开始就要添加第一个&#60;tr&#62;--&#62;
&#60;tr&#62;
&#60;?php endif ?&#62;
&#60;td style="width:25%; float:left; padding:10px;"&#62;
&#60;div&#62;
&#60;a href="/getProductUrl() ?&#62;" title="htmlEscape($_product-&#62;getName()) ?&#62;"&#62;
&#60;img src="/getSmallImageUrl() ?&#62;" width="120" height="120" alt="htmlEscape($_product-&#62;getName()) ?&#62;" /&#62;
&#60;/a&#62;
&#60;/div&#62;
&#60;p&#62;&#60;a href="/getProductUrl() ?&#62;" title="htmlEscape($_product-&#62;getName()) ?&#62;)"&#62;&#60;?php echo $this-&#62;htmlEscape($_product-&#62;getName()) ?&#62;&#60;/a&#62;&#60;/p&#62;
&#60;?php echo $this-&#62;helper('review/product')-&#62;getSummaryHtml($_product, 'short') ?&#62;
&#60;?php echo $this-&#62;helper('catalog/product')-&#62;getPriceHtml($_product) ?&#62;
&#60;?php if($_product-&#62;isSaleable()): ?&#62;
&#60;button onclick="setLocation('getAddToCartUrl($_product) ?&#62;')"&#62;&#60;span&#62;&#60;?php echo $this-&#62;__('Add to Cart') ?&#62;&#60;/span&#62;&#60;/button&#62;
&#60;?php else: ?&#62;
&#60;div&#62;&#60;?php echo $this-&#62;__('Out of stock') ?&#62;&#60;/div&#62;
&#60;?php endif; ?&#62;
&#60;div&#62;&#60;/div&#62;
&#60;p&#62;
&#60;?php if ($this-&#62;helper('wishlist')-&#62;isAllow()) : ?&#62;
&#60;a href="/getAddToWishlistUrl($_product) ?&#62;"&#62;&#60;?php echo $this-&#62;__('Add to Wishlist') ?&#62;&#60;/a&#62;
&#60;?php endif; ?&#62;
&#60;?php if($_compareUrl=$this-&#62;getAddToCompareUrl($_product)): ?&#62;&#60;br /&#62;
&#60;a href="/"&#62;&#60;?php echo $this-&#62;__('Add to Compare') ?&#62;&#60;/a&#62;
&#60;?php endif; ?&#62;
&#60;/p&#62;
&#60;/td&#62;

&#60;?php if ($i%4==3): ?&#62; &#60;!--以下三行控制增加&#60;/tr&#62;，结束时要添加最后一个&#60;/tr&#62;--&#62;
&#60;/tr&#62;
&#60;?php endif ?&#62;
&#60;?php $i++; endforeach; ?&#62;
&#60;/table&#62;
&#60;?php endif; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>在magento首页显示你的新产品可以通过下面几个简单步骤来实现：</p>
<p>step 1：登陆后台，打开 cms -&gt; Manage Pages &#8211;&gt; Home Page &#8212;&gt; General Information &#8212;-&gt; content</p>
<p>step 2：在content中添加</p>
<p>{{block type=”catalog/product_new”name=”home.catalog.product.new”alias=”product_homepage”template=”catalog/product/new.phtml”}}</p>
<p>or</p>
<p>{{widget type=”catalog/product_widget_new” products_count=”6&#8243; template=”catalog/product/widget/new/content/new_grid.phtml”}}</p>
<p>products_count //控制产品个数；</p>
<p>new_grid  / new_list 排列显示不同</p>
<p>注：新增产品并不知自动 显示在新产品列表。你必须录入一些产品并在后台产品General 页明确设置 ‘Set Product as New from Date’ 和‘Set Product as New to Date’ 才能生效。</p>
<p>首页新产品换行设置：</p>
<p>修改文件：app\design\frontend\default\default\template\catalog\product \new.phtml</p>
<p>&lt;?php if (($_products = $this-&gt;getProductCollection()) &amp;&amp; $_products-&gt;getSize()): ?&gt;</p>
<p>&lt;h3&gt;&lt;?php echo $this-&gt;__(&#8216;New Products&#8217;) ?&gt;&lt;/h3&gt;<br />
&lt;table cellspacing=”0&#8243; style=”width:100%; float:left;”&gt;</p>
<p>&lt;?php $i=0; foreach ($_products-&gt;getItems() as $_product): ?&gt; &lt;!&#8211; 读取新产品，显示数量由new.php设置 &#8211;&gt;</p>
<p>&lt;?php if ($i%4==0): ?&gt; &lt;!&#8211;以下三行控制增加&lt;tr&gt;，刚开始就要添加第一个&lt;tr&gt;&#8211;&gt;<br />
&lt;tr&gt;<br />
&lt;?php endif ?&gt;<br />
&lt;td style=”width:25%; float:left; padding:10px;”&gt;<br />
&lt;div&gt;<br />
&lt;a href=”/getProductUrl() ?&gt;” title=”htmlEscape($_product-&gt;getName()) ?&gt;”&gt;<br />
&lt;img src=”/getSmallImageUrl() ?&gt;” width=”120&#8243; height=”120&#8243; alt=”htmlEscape($_product-&gt;getName()) ?&gt;” /&gt;<br />
&lt;/a&gt;<br />
&lt;/div&gt;<br />
&lt;p&gt;&lt;a href=”/getProductUrl() ?&gt;” title=”htmlEscape($_product-&gt;getName()) ?&gt;)”&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/p&gt;<br />
&lt;?php echo $this-&gt;helper(&#8216;review/product&#8217;)-&gt;getSummaryHtml($_product, &#8216;short&#8217;) ?&gt;<br />
&lt;?php echo $this-&gt;helper(&#8216;catalog/product&#8217;)-&gt;getPriceHtml($_product) ?&gt;<br />
&lt;?php if($_product-&gt;isSaleable()): ?&gt;<br />
&lt;button onclick=”setLocation(&#8216;getAddToCartUrl($_product) ?&gt;&#8217;)”&gt;&lt;span&gt;&lt;?php echo $this-&gt;__(&#8216;Add to Cart&#8217;) ?&gt;&lt;/span&gt;&lt;/button&gt;<br />
&lt;?php else: ?&gt;<br />
&lt;div&gt;&lt;?php echo $this-&gt;__(&#8216;Out of stock&#8217;) ?&gt;&lt;/div&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;div&gt;&lt;/div&gt;<br />
&lt;p&gt;<br />
&lt;?php if ($this-&gt;helper(&#8216;wishlist&#8217;)-&gt;isAllow()) : ?&gt;<br />
&lt;a href=”/getAddToWishlistUrl($_product) ?&gt;”&gt;&lt;?php echo $this-&gt;__(&#8216;Add to Wishlist&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;?php if($_compareUrl=$this-&gt;getAddToCompareUrl($_product)): ?&gt;&lt;br /&gt;<br />
&lt;a href=”/”&gt;&lt;?php echo $this-&gt;__(&#8216;Add to Compare&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/p&gt;<br />
&lt;/td&gt;</p>
<p>&lt;?php if ($i%4==3): ?&gt; &lt;!&#8211;以下三行控制增加&lt;/tr&gt;，结束时要添加最后一个&lt;/tr&gt;&#8211;&gt;<br />
&lt;/tr&gt;<br />
&lt;?php endif ?&gt;<br />
&lt;?php $i++; endforeach; ?&gt;<br />
&lt;/table&gt;<br />
&lt;?php endif; ?&gt;</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 18 日 -- <a href="http://www.vr188.com/replica/prestashop%e7%bd%91%e7%ab%99%e8%bd%ac%e7%a7%bb%e7%a9%ba%e9%97%b4%e7%bb%8f%e5%b8%b8%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/" title="PrestaShop网站转移空间经常遇到的问题及解决方法">PrestaShop网站转移空间经常遇到的问题及解决方法</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/share/%e6%8f%90%e7%bb%99%e5%88%9a%e5%88%9a%e6%af%95%e4%b8%9a%e6%89%be%e5%b7%a5%e4%bd%9c%e7%9a%84%e6%9c%8b%e5%8f%8b%e4%bb%ac%e7%9a%84%e4%b8%80%e4%ba%9b%e5%bb%ba%e8%ae%ae-%e5%b7%a5%e4%bd%9c%e7%9a%84%e4%b8%80/" title="提给刚刚毕业找工作的朋友们的一些建议 工作的一些原则">提给刚刚毕业找工作的朋友们的一些建议 工作的一些原则</a> (1)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/share/%e5%bd%b1%e5%93%8d%e8%b0%b7%e6%ad%8c%e6%8e%92%e5%90%8d%e7%9a%84%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%9b%a0%e7%b4%a0/" title="影响谷歌排名的单页面因素">影响谷歌排名的单页面因素</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/zen-cart/%e7%ac%ac%e5%9b%9b%e4%bf%ae%e6%94%b9zen-cart%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b/" title="第四修改zen-cart二次开发教程">第四修改zen-cart二次开发教程</a> (0)</li><li>2011 年 8 月 11 日 -- <a href="http://www.vr188.com/zen-cart/zencart_meta_tag_seo/" title="Zencart程序之Meta标签优化">Zencart程序之Meta标签优化</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e3%80%81%e6%8e%a7%e5%88%b6%e6%af%8f%e6%8e%92%e4%b8%aa%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>更改Magento产品列表中，每行显示的产品个数</title>
		<link>http://www.vr188.com/seo/%e6%9b%b4%e6%94%b9magento%e4%ba%a7%e5%93%81%e5%88%97%e8%a1%a8%e4%b8%ad%ef%bc%8c%e6%af%8f%e8%a1%8c%e6%98%be%e7%a4%ba%e7%9a%84%e4%ba%a7%e5%93%81%e4%b8%aa%e6%95%b0/</link>
		<comments>http://www.vr188.com/seo/%e6%9b%b4%e6%94%b9magento%e4%ba%a7%e5%93%81%e5%88%97%e8%a1%a8%e4%b8%ad%ef%bc%8c%e6%af%8f%e8%a1%8c%e6%98%be%e7%a4%ba%e7%9a%84%e4%ba%a7%e5%93%81%e4%b8%aa%e6%95%b0/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 08:05:45 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=345</guid>
		<description><![CDATA[Magento产品列表显示，默认是每行3个产品。如何更改这个值呢？

我曾看到过一篇文章，他是通过修改template/catalog/product/list.phtml模板文件来实现的。其实没这样复杂，Magento早就为我们提供了一个机关，就暗藏在layout（布局）xml文件中。

一，设置产品列表，一行显示4个产品。修改模板的layout/catalog.xml文件：
<div id="highlighter_562380">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>reference</code> <code>name</code><code>=</code><code>"content"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>   </code><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/category_view"</code> <code>name</code><code>=</code><code>"category.products"</code> <code>template</code><code>=</code><code>"catalog/category/view.phtml"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>      </code><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list"</code> <code>name</code><code>=</code><code>"product_list"</code> <code>template</code><code>=</code><code>"catalog/product/list.phtml"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>         </code><code>&#60;!-- 增加下面这行指令 --&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>         </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&#62;&#60;</code><code>count</code><code>&#62;4&#60;/</code><code>count</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&#60;/</code><code>block</code><code>&#62;&#60;/</code><code>block</code><code>&#62;&#60;/</code><code>reference</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
注意，上面的机关：
<div id="highlighter_117035">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&#62;&#60;</code><code>count</code><code>&#62;4&#60;/</code><code>count</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
虽然类别页面中的产品类别已经设置了，但不要忘了，还有个搜索结果页面，也需要进行同样的设置。

二，设置搜索结果页面中，一行显示的产品个数，这个要到模板的layout/catalogsearch.xml中来修改：
<div id="highlighter_561958">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>reference</code> <code>name</code><code>=</code><code>"content"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>   </code><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"catalogsearch/result"</code> <code>name</code><code>=</code><code>"search.result"</code> <code>template</code><code>=</code><code>"catalogsearch/result.phtml"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>      </code><code>&#60;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list"</code> <code>name</code><code>=</code><code>"search_result_list"</code> <code>template</code><code>=</code><code>"catalog/product/list.phtml"</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>         </code><code>&#60;!-- 增加下面这行指令 --&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>         </code><code>&#60;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&#62;&#60;</code><code>columns</code><code>&#62;4&#60;/</code><code>columns</code><code>&#62;&#60;/</code><code>action</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&#60;/</code><code>block</code><code>&#62;&#60;/</code><code>block</code><code>&#62;&#60;/</code><code>reference</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
细心的你，可能已经注意到了，这里的是：
<div id="highlighter_844277">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>columns</code><code>&#62;4&#60;/</code><code>columns</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
而不是先前的：
<div id="highlighter_265052">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>count</code><code>&#62;4&#60;/</code><code>count</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
我测试过了，你即使改成：
<div id="highlighter_415202">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&#60;</code><code>sqlstudy.com</code><code>&#62;4&#60;/</code><code>sqlstudy.com</code><code>&#62;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
也是可以的：）]]></description>
			<content:encoded><![CDATA[<p>Magento产品列表显示，默认是每行3个产品。如何更改这个值呢？</p>
<p>我曾看到过一篇文章，他是通过修改template/catalog/product/list.phtml模板文件来实现的。其实没这样复杂，Magento早就为我们提供了一个机关，就暗藏在layout（布局）xml文件中。</p>
<p>一，设置产品列表，一行显示4个产品。修改模板的layout/catalog.xml文件：</p>
<div id="highlighter_562380">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>reference</code> <code>name</code><code>=</code><code>"content"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>   </code><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/category_view"</code> <code>name</code><code>=</code><code>"category.products"</code> <code>template</code><code>=</code><code>"catalog/category/view.phtml"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>      </code><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list"</code> <code>name</code><code>=</code><code>"product_list"</code> <code>template</code><code>=</code><code>"catalog/product/list.phtml"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>         </code><code>&lt;!-- 增加下面这行指令 --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>         </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&gt;&lt;</code><code>count</code><code>&gt;4&lt;/</code><code>count</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&lt;/</code><code>block</code><code>&gt;&lt;/</code><code>block</code><code>&gt;&lt;/</code><code>reference</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>注意，上面的机关：</p>
<div id="highlighter_117035">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&gt;&lt;</code><code>count</code><code>&gt;4&lt;/</code><code>count</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>虽然类别页面中的产品类别已经设置了，但不要忘了，还有个搜索结果页面，也需要进行同样的设置。</p>
<p>二，设置搜索结果页面中，一行显示的产品个数，这个要到模板的layout/catalogsearch.xml中来修改：</p>
<div id="highlighter_561958">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>reference</code> <code>name</code><code>=</code><code>"content"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>   </code><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"catalogsearch/result"</code> <code>name</code><code>=</code><code>"search.result"</code> <code>template</code><code>=</code><code>"catalogsearch/result.phtml"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>      </code><code>&lt;</code><code>block</code> <code>type</code><code>=</code><code>"catalog/product_list"</code> <code>name</code><code>=</code><code>"search_result_list"</code> <code>template</code><code>=</code><code>"catalog/product/list.phtml"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>         </code><code>&lt;!-- 增加下面这行指令 --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>         </code><code>&lt;</code><code>action</code> <code>method</code><code>=</code><code>"setColumnCount"</code><code>&gt;&lt;</code><code>columns</code><code>&gt;4&lt;/</code><code>columns</code><code>&gt;&lt;/</code><code>action</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&lt;/</code><code>block</code><code>&gt;&lt;/</code><code>block</code><code>&gt;&lt;/</code><code>reference</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>细心的你，可能已经注意到了，这里的是：</p>
<div id="highlighter_844277">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>columns</code><code>&gt;4&lt;/</code><code>columns</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>而不是先前的：</p>
<div id="highlighter_265052">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>count</code><code>&gt;4&lt;/</code><code>count</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>我测试过了，你即使改成：</p>
<div id="highlighter_415202">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>sqlstudy.com</code><code>&gt;4&lt;/</code><code>sqlstudy.com</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>也是可以的：）</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/zen-cart/zen-cart%e7%bd%91%e5%ba%97%e5%a6%82%e4%bd%95%e5%a2%9e%e5%8a%a0%e4%b8%80%e4%b8%aa%e5%8f%af%e4%b8%8b%e8%bd%bd%e7%9a%84%e5%95%86%e5%93%81/" title="zen cart网店如何增加一个可下载的商品">zen cart网店如何增加一个可下载的商品</a> (1)</li><li>2011 年 12 月 31 日 -- <a href="http://www.vr188.com/seo/import-product-with-multiple-images-reorganize-previous-posts/" title="Import Product with Multiple Images: Reorganize previous posts">Import Product with Multiple Images: Reorganize previous posts</a> (0)</li><li>2011 年 12 月 22 日 -- <a href="http://www.vr188.com/seo/magento-%e4%bf%ae%e6%94%b9%e6%89%80%e6%9c%89%e5%95%86%e5%93%81%e7%9a%84%e4%bb%b7%e6%a0%bc%e4%b8%ba%e5%8e%9f%e6%9d%a5%e7%9a%841-2%e5%80%8d%e7%a4%ba%e4%be%8b/" title="magento &#8212; 修改所有商品的价格为原来的1.2倍示例">magento &#8212; 修改所有商品的价格为原来的1.2倍示例</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/zen-cart/zen-cart%ef%bc%8czen-cart%e5%a6%82%e4%bd%95%e6%89%b9%e9%87%8f%e8%ae%be%e7%bd%ae%e4%ba%a7%e5%93%81%e9%a1%b5%e7%9a%84meta%e7%ad%89%e4%bf%a1%e6%81%af/" title="zen-cart，zen cart如何批量设置产品页的META等信息">zen-cart，zen cart如何批量设置产品页的META等信息</a> (2)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/seo/%e5%b8%b8%e7%94%a8css%e5%85%83%e7%b4%a0/" title="常用CSS元素">常用CSS元素</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/%e6%9b%b4%e6%94%b9magento%e4%ba%a7%e5%93%81%e5%88%97%e8%a1%a8%e4%b8%ad%ef%bc%8c%e6%af%8f%e8%a1%8c%e6%98%be%e7%a4%ba%e7%9a%84%e4%ba%a7%e5%93%81%e4%b8%aa%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento首页左边侧栏显示商品分类目录的方法</title>
		<link>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e5%b7%a6%e8%be%b9%e4%be%a7%e6%a0%8f%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%88%86%e7%b1%bb%e7%9b%ae%e5%bd%95%e7%9a%84%e6%96%b9%e6%b3%95/</link>
		<comments>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e5%b7%a6%e8%be%b9%e4%be%a7%e6%a0%8f%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%88%86%e7%b1%bb%e7%9b%ae%e5%bd%95%e7%9a%84%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 07:58:00 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=343</guid>
		<description><![CDATA[在此给出其中一种办法，实现网站首页左边侧栏显示商品分类目录（网站主菜单和商品菜单依旧在网站上方导航栏上）。

注：（此文Magento版本为1.4.1.0，所选用模板为modern）

1、打开app\design\frontend\default\modern\layout\catalog.xml，在适当位置加入以下代码：

&#60;reference name="left"&#62;
&#60;block type="catalog/navigation" name="cms_catalog" template="catalog/catalog.phtml"/&#62;
&#60;/reference&#62;

2、在 app\design\frontend\default\modern\template\catalog 下新建 catalog.phtml 文件，其内容为以下代码：
&#60;?php $current_cat = $this-&#62;getCurrentCategory();?&#62;
&#60;?php $current_cat = (is_object($current_cat) ? $current_cat-&#62;getName() : '');?&#62;

&#60;div&#62;
&#60;div&#62;&#60;strong&#62;Products Category&#60;/strong&#62;&#60;/div&#62;
&#60;div&#62;
&#60;?php $collection = $this-&#62;getStoreCategories();?&#62;

&#60;?php foreach ($collection as $_category):?&#62;
&#60;?php if ($_category-&#62;getName() == $current_cat) {?&#62;
&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_category)?&#62;"&#62;&#60;?php echo $_category-&#62;getName()?&#62;&#60;br/&#62;
&#60;?php }else{ ?&#62;
&#60;div id="Subcategory"&#62;&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_category)?&#62;"&#62; &#60;?php echo $_category-&#62;getName()?&#62;&#60;/a&#62;&#60;/div&#62;
&#60;?php }?&#62;

&#60;?php foreach($_category-&#62;getChildren() as $_childCategory):?&#62;
&#60;?php if ($_childCategory-&#62;getName() == $current_cat) {?&#62;
&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_childCategory)?&#62;"&#62;&#60;?php echo $_childCategory-&#62;getName()?&#62;&#60;/a&#62;&#60;br/&#62;
&#60;?php }else{ ?&#62;
&#60;div id="ChildCategory"&#62;&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_childCategory)?&#62;"&#62;&#60;?php echo $_childCategory-&#62;getName()?&#62;&#60;/a&#62;&#60;/div&#62;
&#60;?php }?&#62;

&#60;?php foreach($_childCategory-&#62;getChildren() as $_cchildCategory):?&#62;
&#60;?php if ($_cchildCategory-&#62;getName() == $current_cat) {?&#62;
&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_cchildCategory)?&#62;"&#62;&#60;?php echo $_cchildCategory-&#62;getName()?&#62;&#60;/a&#62;&#60;br/&#62;
&#60;?php }else{ ?&#62;
&#60;h6 style="margin-left:10px;"&#62;&#60;a href="&#60;?php echo $this-&#62;getCategoryUrl($_cchildCategory)?&#62;"&#62;&#60;?php echo $_cchildCategory-&#62;getName()?&#62;&#60;/a&#62;&#60;/h6&#62;
&#60;?php }?&#62;

&#60;?php endforeach?&#62;
&#60;?php endforeach?&#62;
&#60;?php endforeach?&#62;
&#60;/div&#62;
&#60;/div&#62;

进入前台，发现网站左侧产品分类目录效果已经显现。

你还可以在/skin/frontend/default/modern/css/styles.css中添加ID #Subcategory、#ChildCategory并对其属性进行设置。]]></description>
			<content:encoded><![CDATA[<p>在此给出其中一种办法，实现网站首页左边侧栏显示商品分类目录（网站主菜单和商品菜单依旧在网站上方导航栏上）。</p>
<p>注：（此文Magento版本为1.4.1.0，所选用模板为modern）</p>
<p>1、打开app\design\frontend\default\modern\layout\catalog.xml，在适当位置加入以下代码：</p>
<p>&lt;reference name=”left”&gt;<br />
&lt;block type=”catalog/navigation” name=”cms_catalog” template=”catalog/catalog.phtml”/&gt;<br />
&lt;/reference&gt;</p>
<p>2、在 app\design\frontend\default\modern\template\catalog 下新建 catalog.phtml 文件，其内容为以下代码：<br />
&lt;?php $current_cat = $this-&gt;getCurrentCategory();?&gt;<br />
&lt;?php $current_cat = (is_object($current_cat) ? $current_cat-&gt;getName() : ”);?&gt;</p>
<p>&lt;div&gt;<br />
&lt;div&gt;&lt;strong&gt;Products Category&lt;/strong&gt;&lt;/div&gt;<br />
&lt;div&gt;<br />
&lt;?php $collection = $this-&gt;getStoreCategories();?&gt;</p>
<p>&lt;?php foreach ($collection as $_category):?&gt;<br />
&lt;?php if ($_category-&gt;getName() == $current_cat) {?&gt;<br />
&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_category)?&gt;”&gt;&lt;?php echo $_category-&gt;getName()?&gt;&lt;br/&gt;<br />
&lt;?php }else{ ?&gt;<br />
&lt;div id=”Subcategory”&gt;&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_category)?&gt;”&gt; &lt;?php echo $_category-&gt;getName()?&gt;&lt;/a&gt;&lt;/div&gt;<br />
&lt;?php }?&gt;</p>
<p>&lt;?php foreach($_category-&gt;getChildren() as $_childCategory):?&gt;<br />
&lt;?php if ($_childCategory-&gt;getName() == $current_cat) {?&gt;<br />
&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_childCategory)?&gt;”&gt;&lt;?php echo $_childCategory-&gt;getName()?&gt;&lt;/a&gt;&lt;br/&gt;<br />
&lt;?php }else{ ?&gt;<br />
&lt;div id=”ChildCategory”&gt;&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_childCategory)?&gt;”&gt;&lt;?php echo $_childCategory-&gt;getName()?&gt;&lt;/a&gt;&lt;/div&gt;<br />
&lt;?php }?&gt;</p>
<p>&lt;?php foreach($_childCategory-&gt;getChildren() as $_cchildCategory):?&gt;<br />
&lt;?php if ($_cchildCategory-&gt;getName() == $current_cat) {?&gt;<br />
&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_cchildCategory)?&gt;”&gt;&lt;?php echo $_cchildCategory-&gt;getName()?&gt;&lt;/a&gt;&lt;br/&gt;<br />
&lt;?php }else{ ?&gt;<br />
&lt;h6 style=”margin-left:10px;”&gt;&lt;a href=”&lt;?php echo $this-&gt;getCategoryUrl($_cchildCategory)?&gt;”&gt;&lt;?php echo $_cchildCategory-&gt;getName()?&gt;&lt;/a&gt;&lt;/h6&gt;<br />
&lt;?php }?&gt;</p>
<p>&lt;?php endforeach?&gt;<br />
&lt;?php endforeach?&gt;<br />
&lt;?php endforeach?&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>进入前台，发现网站左侧产品分类目录效果已经显现。</p>
<p>你还可以在/skin/frontend/default/modern/css/styles.css中添加ID #Subcategory、#ChildCategory并对其属性进行设置。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/seo/%e8%ae%ba%e5%9d%9b%e5%a4%96%e9%93%be%e6%9f%a5%e6%89%be%e5%8f%8a%e9%ab%98%e7%ba%a7%e8%af%ad%e6%b3%95%e7%9a%84%e5%ba%94%e7%94%a8/" title="论坛外链查找及高级语法的应用">论坛外链查找及高级语法的应用</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/digital/%e7%81%ab%e8%bd%a6%e5%a4%b4%e6%a8%a1%e5%9d%97%e5%88%b6%e4%bd%9c%e6%95%99%e7%a8%8b%e5%82%bb%e7%93%9c%e6%95%99%e7%a8%8b%e7%89%8880%e5%88%86%e9%92%9f%e8%a7%86%e9%a2%91/" title="火车头模块制作教程傻瓜教程版[80分钟视频]">火车头模块制作教程傻瓜教程版[80分钟视频]</a> (0)</li><li>2012 年 1 月 9 日 -- <a href="http://www.vr188.com/seo/%e5%a6%82%e4%bd%95%e5%9c%a8magento%e9%a1%b5%e9%9d%a2%e5%b7%a6%e8%be%b9%e5%a2%9e%e5%8a%a0%e5%88%86%e7%b1%bb%e8%8f%9c%e5%8d%95/" title="如何在Magento页面左边增加分类菜单">如何在Magento页面左边增加分类菜单</a> (0)</li><li>2011 年 12 月 31 日 -- <a href="http://www.vr188.com/seo/import-product-with-multiple-images-reorganize-previous-posts/" title="Import Product with Multiple Images: Reorganize previous posts">Import Product with Multiple Images: Reorganize previous posts</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/zen-cart/%e6%ad%a3%e7%a1%ae%e5%9c%b0%e5%ae%9a%e5%88%b6%e6%82%a8%e7%9a%84%e7%bd%91%e7%ab%99-%e6%96%87%e4%bb%b6%e6%9b%bf%e4%bb%a3%e6%9c%ba%e5%88%b6/" title="正确地定制您的网站 &#8211; 文件替代机制">正确地定制您的网站 &#8211; 文件替代机制</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e9%a6%96%e9%a1%b5%e5%b7%a6%e8%be%b9%e4%be%a7%e6%a0%8f%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%88%86%e7%b1%bb%e7%9b%ae%e5%bd%95%e7%9a%84%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento添加Home到导航上</title>
		<link>http://www.vr188.com/seo/magento%e6%b7%bb%e5%8a%a0home%e5%88%b0%e5%af%bc%e8%88%aa%e4%b8%8a/</link>
		<comments>http://www.vr188.com/seo/magento%e6%b7%bb%e5%8a%a0home%e5%88%b0%e5%af%bc%e8%88%aa%e4%b8%8a/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 07:35:43 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=340</guid>
		<description><![CDATA[<strong>添加"主页"链接功能active state菜单栏</strong>(付:active state指的是动态效果,因为很多朋友在自己添加"主页"的时候.都是使用的静态代码)

把文件：app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml修改为：

&#60;div&#62;
&#60;div&#62;
&#60;h4&#62;&#60;?php echo $this-&#62;__('Category Navigation:') ?&#62;&#60;/h4&#62;
&#60;ul id="nav"&#62;
&#60;!-- ALTERNATIVE HOME BUTTON HACK 注意看这里. --&#62;
&#60;li&#62;&#60;a href="&#60;?php echo $this-&#62;getUrl('')?&#62;"&#62;&#60;?php echo $this-&#62;__('Home') ?&#62;&#60;/a&#62;&#60;/li&#62;
&#60;!-- ALTERNATIVE HOME BUTTON HACK /注意看这里 --&#62;
&#60;?php foreach ($this-&#62;getStoreCategories() as $_category):?&#62;
&#60;?php echo $this-&#62;drawItem($_category) ?&#62;
&#60;?php endforeach ?&#62;
&#60;/ul&#62;
&#60;/div&#62;
&#60;?php echo $this-&#62;getChildHtml('topLeftLinks') ?&#62;
&#60;/div&#62;


<strong>添加"主页"链接到菜单栏
</strong>把文件：app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml修改为：

&#60;div&#62;
&#60;div&#62;
&#60;h4&#62;&#60;?php echo $this-&#62;__('Category Navigation:') ?&#62;&#60;/h4&#62;
&#60;ul id="nav"&#62;
&#60;!-- HOME BUTTON HACK 看这里 --&#62;
&#60;?php $_anyActive = false; foreach ($this-&#62;getStoreCategories() as $_category) { $_anyActive = $_anyActive &#124;&#124; $this-&#62;isCategoryActive($_category); } ?&#62;
&#60;li&#62;&#60;a href="&#60;?php echo $this-&#62;getUrl('')?&#62;"&#62;&#60;?php echo $this-&#62;__('Home') ?&#62;&#60;/a&#62;&#60;/li&#62;
&#60;!-- HOME BUTTON HACK /看这里 --&#62;
&#60;?php foreach ($this-&#62;getStoreCategories(10) as $_category):?&#62;
&#60;?php echo $this-&#62;drawItem($_category) ?&#62;
&#60;?php endforeach ?&#62;
&#60;/ul&#62;
&#60;/div&#62;
&#60;?php echo $this-&#62;getChildHtml('topLeftLinks') ?&#62;
&#60;/div&#62;

<strong>添加主页链接到顶部链接

</strong>这将允许您添加一个主页链接顶部链接（我的帐户&#124;我的心愿&#124;等）在"我的帐户"前面。

找到文件:app/design/frontend/default/default/template/page/template/links.phtml,更改为：

&#60;?php $_links = $this-&#62;getLinks(); ?&#62;
&#60;?php if(count($_links)&#62;0): ?&#62;
&#60;div&#62;
&#60;ul&#60;?php if($this-&#62;getName()): ?&#62;):?&#62; id="&#60;?php echo $this-&#62;getName() ?&#62;"&#60;?php endif;?&#62;&#62;
&#60;!-- HOME BUTTON HACK --&#62;
&#60;li&#62;&#60;a href="&#60;?php echo $this-&#62;getUrl('')?&#62;"&#62;&#60;?php echo $this-&#62;__('Home') ?&#62;&#60;/a&#62;&#60;/li&#62;
&#60;!-- HOME BUTTON HACK --&#62;
&#60;?php foreach($_links as $_link): ?&#62;
&#60;li &#60;?php if($_link-&#62;getIsLast()): ?&#62; &#60;?php endif; ?&#62;&#60;?php echo $_link-&#62;getLiParams() ?&#62;&#62;&#60;?php echo $_link-&#62;getBeforeText() ?&#62;&#60;a href="&#60;?php echo $_link-&#62;getUrl() ?&#62;" title="&#60;?php echo $_link-&#62;getTitle() ?&#62;" &#60;?php echo $_link-&#62;getAParams() ?&#62;&#62;&#60;?php echo $_link-&#62;getLabel() ?&#62;&#60;/a&#62;&#60;?php echo $_link-&#62;getAfterText() ?&#62;&#60;/li&#62;
&#60;?php endforeach; ?&#62;
&#60;/ul&#62;
&#60;/div&#62;
&#60;?php endif; ?&#62;

注意：如果在发言中foreach循环发生了变化，因为“家”将永远是第一，它没有必要。.还注意到， &#60;li&#62;的“主页”链接自动获得“第一” 。

这将在首页&#124;我的帐户之间留出一个空格]]></description>
			<content:encoded><![CDATA[<p><strong>添加”主页”链接功能active state菜单栏</strong>(付:active state指的是动态效果,因为很多朋友在自己添加”主页”的时候.都是使用的静态代码)</p>
<p>把文件：app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml修改为：</p>
<p>&lt;div&gt;<br />
&lt;div&gt;<br />
&lt;h4&gt;&lt;?php echo $this-&gt;__(&#8216;Category Navigation:&#8217;) ?&gt;&lt;/h4&gt;<br />
&lt;ul id=”nav”&gt;<br />
&lt;!&#8211; ALTERNATIVE HOME BUTTON HACK 注意看这里. &#8211;&gt;<br />
&lt;li&gt;&lt;a href=”&lt;?php echo $this-&gt;getUrl(”)?&gt;”&gt;&lt;?php echo $this-&gt;__(&#8216;Home&#8217;) ?&gt;&lt;/a&gt;&lt;/li&gt;<br />
&lt;!&#8211; ALTERNATIVE HOME BUTTON HACK /注意看这里 &#8211;&gt;<br />
&lt;?php foreach ($this-&gt;getStoreCategories() as $_category):?&gt;<br />
&lt;?php echo $this-&gt;drawItem($_category) ?&gt;<br />
&lt;?php endforeach ?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;?php echo $this-&gt;getChildHtml(&#8216;topLeftLinks&#8217;) ?&gt;<br />
&lt;/div&gt;</p>
<p><strong>添加”主页”链接到菜单栏<br />
</strong>把文件：app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml修改为：</p>
<p>&lt;div&gt;<br />
&lt;div&gt;<br />
&lt;h4&gt;&lt;?php echo $this-&gt;__(&#8216;Category Navigation:&#8217;) ?&gt;&lt;/h4&gt;<br />
&lt;ul id=”nav”&gt;<br />
&lt;!&#8211; HOME BUTTON HACK 看这里 &#8211;&gt;<br />
&lt;?php $_anyActive = false; foreach ($this-&gt;getStoreCategories() as $_category) { $_anyActive = $_anyActive || $this-&gt;isCategoryActive($_category); } ?&gt;<br />
&lt;li&gt;&lt;a href=”&lt;?php echo $this-&gt;getUrl(”)?&gt;”&gt;&lt;?php echo $this-&gt;__(&#8216;Home&#8217;) ?&gt;&lt;/a&gt;&lt;/li&gt;<br />
&lt;!&#8211; HOME BUTTON HACK /看这里 &#8211;&gt;<br />
&lt;?php foreach ($this-&gt;getStoreCategories(10) as $_category):?&gt;<br />
&lt;?php echo $this-&gt;drawItem($_category) ?&gt;<br />
&lt;?php endforeach ?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;?php echo $this-&gt;getChildHtml(&#8216;topLeftLinks&#8217;) ?&gt;<br />
&lt;/div&gt;</p>
<p><strong>添加主页链接到顶部链接</p>
<p></strong>这将允许您添加一个主页链接顶部链接（我的帐户|我的心愿|等）在”我的帐户”前面。</p>
<p>找到文件:app/design/frontend/default/default/template/page/template/links.phtml,更改为：</p>
<p>&lt;?php $_links = $this-&gt;getLinks(); ?&gt;<br />
&lt;?php if(count($_links)&gt;0): ?&gt;<br />
&lt;div&gt;<br />
&lt;ul&lt;?php if($this-&gt;getName()): ?&gt;):?&gt; id=”&lt;?php echo $this-&gt;getName() ?&gt;”&lt;?php endif;?&gt;&gt;<br />
&lt;!&#8211; HOME BUTTON HACK &#8211;&gt;<br />
&lt;li&gt;&lt;a href=”&lt;?php echo $this-&gt;getUrl(”)?&gt;”&gt;&lt;?php echo $this-&gt;__(&#8216;Home&#8217;) ?&gt;&lt;/a&gt;&lt;/li&gt;<br />
&lt;!&#8211; HOME BUTTON HACK &#8211;&gt;<br />
&lt;?php foreach($_links as $_link): ?&gt;<br />
&lt;li &lt;?php if($_link-&gt;getIsLast()): ?&gt; &lt;?php endif; ?&gt;&lt;?php echo $_link-&gt;getLiParams() ?&gt;&gt;&lt;?php echo $_link-&gt;getBeforeText() ?&gt;&lt;a href=”&lt;?php echo $_link-&gt;getUrl() ?&gt;” title=”&lt;?php echo $_link-&gt;getTitle() ?&gt;” &lt;?php echo $_link-&gt;getAParams() ?&gt;&gt;&lt;?php echo $_link-&gt;getLabel() ?&gt;&lt;/a&gt;&lt;?php echo $_link-&gt;getAfterText() ?&gt;&lt;/li&gt;<br />
&lt;?php endforeach; ?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;?php endif; ?&gt;</p>
<p>注意：如果在发言中foreach循环发生了变化，因为“家”将永远是第一，它没有必要。.还注意到， &lt;li&gt;的“主页”链接自动获得“第一” 。</p>
<p>这将在首页|我的帐户之间留出一个空格</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 22 日 -- <a href="http://www.vr188.com/seo/8%e4%b8%aaprestashop%e5%ae%89%e8%a3%85%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/" title="8个Prestashop安装常见问题及解决方法">8个Prestashop安装常见问题及解决方法</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/zen-cart/zen-cart%ef%bc%8czen-cart%e5%a6%82%e4%bd%95%e6%89%b9%e9%87%8f%e8%ae%be%e7%bd%ae%e4%ba%a7%e5%93%81%e9%a1%b5%e7%9a%84meta%e7%ad%89%e4%bf%a1%e6%81%af/" title="zen-cart，zen cart如何批量设置产品页的META等信息">zen-cart，zen cart如何批量设置产品页的META等信息</a> (2)</li><li>2011 年 8 月 18 日 -- <a href="http://www.vr188.com/replica/prestashop%e7%bd%91%e7%ab%99%e8%bd%ac%e7%a7%bb%e7%a9%ba%e9%97%b4%e7%bb%8f%e5%b8%b8%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/" title="PrestaShop网站转移空间经常遇到的问题及解决方法">PrestaShop网站转移空间经常遇到的问题及解决方法</a> (0)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/seo/%e5%a4%96%e8%b4%b8seo%e5%b7%a5%e5%85%b7senuke-x%e4%b8%ad%e6%96%87%e7%89%88%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b-%e4%b8%80%e8%b5%b7%e5%ad%a6%e4%b9%a0senukex/" title="外贸seo工具senuke x中文版图文教程 一起学习SenukeX">外贸seo工具senuke x中文版图文教程 一起学习SenukeX</a> (0)</li><li>2011 年 9 月 20 日 -- <a href="http://www.vr188.com/seo/%e6%96%b0%e7%ab%99%e6%8e%92%e5%90%8d%e4%b8%8d%e7%a8%b3%e5%ae%9a%e7%9a%84google%e5%b9%bd%e7%81%b5%e7%8e%b0%e8%b1%a1/" title="新站排名不稳定的Google幽灵现象">新站排名不稳定的Google幽灵现象</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/magento%e6%b7%bb%e5%8a%a0home%e5%88%b0%e5%af%bc%e8%88%aa%e4%b8%8a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>怎样在magento首页显示新产品和推荐产品</title>
		<link>http://www.vr188.com/seo/%e6%80%8e%e6%a0%b7%e5%9c%a8magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e5%92%8c%e6%8e%a8%e8%8d%90%e4%ba%a7%e5%93%81/</link>
		<comments>http://www.vr188.com/seo/%e6%80%8e%e6%a0%b7%e5%9c%a8magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e5%92%8c%e6%8e%a8%e8%8d%90%e4%ba%a7%e5%93%81/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 05:23:04 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=337</guid>
		<description><![CDATA[用了magento才真知道什么叫做上手难，比如对一个网店来说很基本的问题—首页产品显示—就困扰了许多新手用户。不管用中文还是英文搜索，这样 的问题都一大堆，皮蛋家这篇博客就针对这个问题说一说，主要解决首页几种类型产品的显示问题。magento解决这类问题的方法很多，本文提供了只是其中 一种,也是我认为最简单的方法。

<a href="http://www.pidanjia.com/magento/222#feature">1.在magento首页显示推荐产品，英文里叫featured products.</a>

<a href="http://www.pidanjia.com/magento/222#new">2.在magento首页显示新产品，也就是new product.</a>

<a name="feature"></a><strong>首页显示推荐产品</strong>

以下要说的方法思路和实现方法都很简单，就是创建一个分类，把这个分类的状态设置为不活动（is active:no), 这样该分类在前台的任何分类导航里就看不到了。然后添加产品的时候选择该分类，最后用代码调出。具体操作步骤是这样的：

S1. 在Default category下创建一个新分类，命名不一定是featured products，可以是任何你喜欢的名字，名称不重要，重要的是：创建之后点击它，你会看到它的分类id显示在分类名称后，就像这样 Home page products (ID: 3)，记住这个数字，开始下一步；

S2. 进入后台CMS-Pages-Home Page，在content一栏里填写下列代码（切换到代码编辑状态）：

<code>{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="这里是第一步得到的那个分类ID"}}</code>

S3. 保存页面，刷新缓存，到首页查看一下。

总结：其实该方法就是调用magento的一个分类产品列表，你不仅可以用它来做推荐产品展示，更可以用它的基本功能去展示你网店的主打分类产品，简单易行，magento 1.6版本里测试过可以使用。

<a name="new"></a><strong>magento首页显示新产品</strong>

早先刚用magento的时候，在这个问题上我花了很多时间，解决了之后写了一篇博客提供了两种解决办法。这篇博客在网络上很多转载，但是我的原文 却因为皮蛋家改版弄丢了。那两种方法还有没有用我不清楚，但在magento1.6版本里，有一种简单快捷的办法，就是利用1.4版本才引入的 widget功能。具体方法如下：<img title="magento首页新产品设置" src="http://www.pidanjia.com/wp-content/uploads/2011/10/QQ%E6%88%AA%E5%9B%BE%E6%9C%AA%E5%91%BD%E5%90%8D.jpg" alt="" width="367" height="203" />

直接进后台CMS-Pages-Home Page，切换到content一栏，点击编辑框上的Show/Hide Editor隐藏编辑器，这时你会看到这个按钮后面多出了三个按钮，分别是插入widget,插入图片，插入变量。点击插入widget,在弹出页面的 Widget Type 下拉框里选择Catalog New Products List，在下面设置需要显示的产品数量，然后保存就行了。

首页设置完之后，在上传新产品的时候记得在Set Product as New from Date和Set Product as New from Date设置新产品显示的起始日期，因为magento的新产品概念不是按照上传的先后顺序，需要自己设置。虽然这样不太方便，但是逻辑上更合理。]]></description>
			<content:encoded><![CDATA[<p>用了magento才真知道什么叫做上手难，比如对一个网店来说很基本的问题—首页产品显示—就困扰了许多新手用户。不管用中文还是英文搜索，这样 的问题都一大堆，皮蛋家这篇博客就针对这个问题说一说，主要解决首页几种类型产品的显示问题。magento解决这类问题的方法很多，本文提供了只是其中 一种,也是我认为最简单的方法。</p>
<p><a href="http://www.pidanjia.com/magento/222#feature">1.在magento首页显示推荐产品，英文里叫featured products.</a></p>
<p><a href="http://www.pidanjia.com/magento/222#new">2.在magento首页显示新产品，也就是new product.</a></p>
<p><a name="feature"></a><strong>首页显示推荐产品</strong></p>
<p>以下要说的方法思路和实现方法都很简单，就是创建一个分类，把这个分类的状态设置为不活动（is active:no), 这样该分类在前台的任何分类导航里就看不到了。然后添加产品的时候选择该分类，最后用代码调出。具体操作步骤是这样的：</p>
<p>S1. 在Default category下创建一个新分类，命名不一定是featured products，可以是任何你喜欢的名字，名称不重要，重要的是：创建之后点击它，你会看到它的分类id显示在分类名称后，就像这样 Home page products (ID: 3)，记住这个数字，开始下一步；</p>
<p>S2. 进入后台CMS-Pages-Home Page，在content一栏里填写下列代码（切换到代码编辑状态）：</p>
<p><code>{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="这里是第一步得到的那个分类ID"}}</code></p>
<p>S3. 保存页面，刷新缓存，到首页查看一下。</p>
<p>总结：其实该方法就是调用magento的一个分类产品列表，你不仅可以用它来做推荐产品展示，更可以用它的基本功能去展示你网店的主打分类产品，简单易行，magento 1.6版本里测试过可以使用。</p>
<p><a name="new"></a><strong>magento首页显示新产品</strong></p>
<p>早先刚用magento的时候，在这个问题上我花了很多时间，解决了之后写了一篇博客提供了两种解决办法。这篇博客在网络上很多转载，但是我的原文 却因为皮蛋家改版弄丢了。那两种方法还有没有用我不清楚，但在magento1.6版本里，有一种简单快捷的办法，就是利用1.4版本才引入的 widget功能。具体方法如下：<img title="magento首页新产品设置" src="http://www.pidanjia.com/wp-content/uploads/2011/10/QQ%E6%88%AA%E5%9B%BE%E6%9C%AA%E5%91%BD%E5%90%8D.jpg" alt="QQ%E6%88%AA%E5%9B%BE%E6%9C%AA%E5%91%BD%E5%90%8D 怎样在magento首页显示新产品和推荐产品 " width="367" height="203" /></p>
<p>直接进后台CMS-Pages-Home Page，切换到content一栏，点击编辑框上的Show/Hide Editor隐藏编辑器，这时你会看到这个按钮后面多出了三个按钮，分别是插入widget,插入图片，插入变量。点击插入widget,在弹出页面的 Widget Type 下拉框里选择Catalog New Products List，在下面设置需要显示的产品数量，然后保存就行了。</p>
<p>首页设置完之后，在上传新产品的时候记得在Set Product as New from Date和Set Product as New from Date设置新产品显示的起始日期，因为magento的新产品概念不是按照上传的先后顺序，需要自己设置。虽然这样不太方便，但是逻辑上更合理。</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 11 日 -- <a href="http://www.vr188.com/share/hello-world/" title="如何调试、排错zen cart网店（出现空白页面）？">如何调试、排错zen cart网店（出现空白页面）？</a> (1)</li><li>2011 年 8 月 19 日 -- <a href="http://www.vr188.com/share/%e6%8f%90%e7%bb%99%e5%88%9a%e5%88%9a%e6%af%95%e4%b8%9a%e6%89%be%e5%b7%a5%e4%bd%9c%e7%9a%84%e6%9c%8b%e5%8f%8b%e4%bb%ac%e7%9a%84%e4%b8%80%e4%ba%9b%e5%bb%ba%e8%ae%ae-%e5%b7%a5%e4%bd%9c%e7%9a%84%e4%b8%80/" title="提给刚刚毕业找工作的朋友们的一些建议 工作的一些原则">提给刚刚毕业找工作的朋友们的一些建议 工作的一些原则</a> (1)</li><li>2011 年 8 月 22 日 -- <a href="http://www.vr188.com/seo/8%e4%b8%aaprestashop%e5%ae%89%e8%a3%85%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/" title="8个Prestashop安装常见问题及解决方法">8个Prestashop安装常见问题及解决方法</a> (0)</li><li>2012 年 2 月 10 日 -- <a href="http://www.vr188.com/seo/magento%e4%bf%ae%e6%94%b9%e5%88%97%e8%a1%a8%e9%a1%b5%e6%af%8f%e8%a1%8c%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e6%95%b0%e9%87%8f/" title="magento修改列表页每行商品显示数量">magento修改列表页每行商品显示数量</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/zen-cart/%e7%ac%ac%e5%9b%9b%e4%bf%ae%e6%94%b9zen-cart%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b/" title="第四修改zen-cart二次开发教程">第四修改zen-cart二次开发教程</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/%e6%80%8e%e6%a0%b7%e5%9c%a8magento%e9%a6%96%e9%a1%b5%e6%98%be%e7%a4%ba%e6%96%b0%e4%ba%a7%e5%93%81%e5%92%8c%e6%8e%a8%e8%8d%90%e4%ba%a7%e5%93%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zencart 在商品详细页，随机显示一定数量的同类产品</title>
		<link>http://www.vr188.com/seo/zencart-%e5%9c%a8%e5%95%86%e5%93%81%e8%af%a6%e7%bb%86%e9%a1%b5%ef%bc%8c%e9%9a%8f%e6%9c%ba%e6%98%be%e7%a4%ba%e4%b8%80%e5%ae%9a%e6%95%b0%e9%87%8f%e7%9a%84%e5%90%8c%e7%b1%bb%e4%ba%a7%e5%93%81/</link>
		<comments>http://www.vr188.com/seo/zencart-%e5%9c%a8%e5%95%86%e5%93%81%e8%af%a6%e7%bb%86%e9%a1%b5%ef%bc%8c%e9%9a%8f%e6%9c%ba%e6%98%be%e7%a4%ba%e4%b8%80%e5%ae%9a%e6%95%b0%e9%87%8f%e7%9a%84%e5%90%8c%e7%b1%bb%e4%ba%a7%e5%93%81/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 07:15:37 +0000</pubDate>
		<dc:creator>常州SEO</dc:creator>
				<category><![CDATA[SEO探讨]]></category>

		<guid isPermaLink="false">http://www.vr188.com/?p=334</guid>
		<description><![CDATA[此模块取自lightinthebox

1, 创建一个新文件 随意命名 没重复就行 例如：tpl_product_info_similar.php
复制该文件到includes\templates\你的模板\templates\目录下
打开该文件，把以下代码复制进去并保存

&#60;div id="similar_product"&#62;
&#60;h2&#62;Related Products&#60;/h2&#62;
&#60;ul&#62;
&#60;?php

$products_id = (int)$_GET['products_id'];

$flash_page_id_con = array();
$flash_page_images_con = array();
$flash_page_price_con = array();
$flash_page_name_con = array();
$flash_page_query = "select p.products_id,p.products_image,pd.products_name from " . TABLE_PRODUCTS ." p, ". TABLE_PRODUCTS_DESCRIPTION . " pd where p.`products_id`=pd.`products_id` AND p.`products_status`='1'  AND pd.`language_id` = '" . (int)$_SESSION['languages_id'] . "' AND p.`master_categories_id` = " . zen_get_products_category_id($products_id) . " ORDER BY rand() limit 12";
$flash_page = $db-&#62;Execute($flash_page_query);
while(!$flash_page-&#62;EOF){
$flash_page_items[] = $flash_page-&#62;fields;
$flash_page_id_con[]    = $flash_page-&#62;fields['products_id'];
$flash_page_images_src = is_int(strpos($flash_page-&#62;fields['products_image'],','))? substr($flash_page-&#62;fields['products_image'],0,strpos($flash_page-&#62;fields['products_image'],',')):$flash_page-&#62;fields['products_image'];
$flash_page_images_con[]    = '"'.(zen_not_null($flash_page-&#62;fields['products_image']) ? $flash_page_images_src : PRODUCTS_IMAGE_NO_IMAGE ).'"';
$flash_page_price_con[]    = '"'.$currencies-&#62;display_price(zen_get_products_base_price($flash_page-&#62;fields['products_id']),zen_get_tax_rate($product_check-&#62;fields['products_tax_class_id'])).'"';
$flash_page_name_con[]    = '"'.zen_output_string(zen_get_products_name($flash_page-&#62;fields['products_id'])).'"';
$flash_page-&#62;MoveNext();
}

$flash_page_id = implode(",", $flash_page_id_con);
$flash_page_images = implode(",", $flash_page_images_con);
$flash_page_price = implode(",", $flash_page_price_con);
$flash_page_name = implode(",", $flash_page_name_con);
$flash_page_display_num    = $flash_page-&#62;RecordCount();
?&#62;

&#60;?php for($i = 0; $i&#60; $flash_page_display_num ; $i++){?&#62;
&#60;li id="li&#60;?php echo $i;?&#62;" style="display:block;float:left;padding-left:10px;width:22%;"&#62;
&#60;a href="&#60;?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']);?&#62;"&#62;&#60;?php echo zen_image(DIR_WS_IMAGES . $flash_page_items[$i]['products_image'], $flash_page_items[$i]['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT); ?&#62;&#60;/a&#62;&#60;p style="text-align:center;"&#62;&#60;a href="&#60;?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']);?&#62;"&#62;&#60;?php echo $flash_page_items[$i]['products_name']; ?&#62;&#60;/a&#62;&#60;br /&#62;&#60;strong id="cell_price&#60;?php echo $i?&#62;" class="red"&#62;&#60;?php echo $currencies-&#62;display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check-&#62;fields['products_tax_class_id'])); ?&#62;&#60;/strong&#62;&#60;/p&#62;
&#60;/li&#62;
&#60;?php
//print_r($flash_page_items[$i]);
}
?&#62;
&#60;/ul&#62;
&#60;/div&#62;

&#160;

&#160;

2，找到includes\templates\你的模板\templates\tpl_product_info_display.php文件
在相应的位置加上以下代码：
&#60;?php require($template-&#62;get_template_dir('你创建的文件 tpl_product_info_similar.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/你创建的文件tpl_product_info_similar.php'); ?&#62;

一般可以加到&#60;?php require($template-&#62;get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?&#62;

&#160;

整相关产品显示的数量:ORDER BY rand() limit 12 找到这段 12就是显示的个数

&#160;

IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH 图的宽度 自己随便设好了 ZENCART都是按比例的
IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT 图的高度

&#60;li id="li&#60;?php echo $i;?&#62;" style="display:block;float:left;padding-left:10px;width:22%;"&#62;
width:22%; 每行大概显示4个
显示2个就 50% 最好设49% 一般少一个百分点 因为考虑到IE的兼容性
显示3个 就 33%
显示5个 19% 咯
自己调试

&#160;

&#160;

这个模块可以显示商品的一般价格，我想也显示商品的折扣价，请问该怎么改呢？效果如：
Price:$500 $450

&#60;?php echo $currencies-&#62;display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check-&#62;fields['products_tax_class_id'])); ?&#62;
修改为
&#60;?php echo zen_get_products_display_price($flash_page_items[$i]['products_id']); ?&#62;

就显示Price:$500 $450了

&#160;

&#160;

&#60;?php
if($mn%3 == 0){
echo "&#60;/tr&#62;";$mn=0;
}
}
if($mn&#60;3){
$cols = 3-$mn;
echo "&#60;td colspan='".$cols."'&#62;&#60;td&#62;&#60;/tr&#62;";
}
?&#62;

3就是每行显示3个。

&#160;

&#160;

要怎样才能截取显示标题的前50个字符呢

&#60;?php echo substr($flash_page_items[$i]['products_name'],0,34); ?&#62;]]></description>
			<content:encoded><![CDATA[<p>此模块取自lightinthebox</p>
<p>1, 创建一个新文件 随意命名 没重复就行 例如：tpl_product_info_similar.php<br />
复制该文件到includes\templates\你的模板\templates\目录下<br />
打开该文件，把以下代码复制进去并保存</p>
<p>&lt;div id=”similar_product”&gt;<br />
&lt;h2&gt;Related Products&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php</p>
<p>$products_id = (int)$_GET['products_id'];</p>
<p>$flash_page_id_con = array();<br />
$flash_page_images_con = array();<br />
$flash_page_price_con = array();<br />
$flash_page_name_con = array();<br />
$flash_page_query = “select p.products_id,p.products_image,pd.products_name from ” . TABLE_PRODUCTS .” p, “. TABLE_PRODUCTS_DESCRIPTION . ” pd where p.`products_id`=pd.`products_id` AND p.`products_status`=&#8217;1&#8242;  AND pd.`language_id` = &#8216;” . (int)$_SESSION['languages_id'] . “&#8216; AND p.`master_categories_id` = ” . zen_get_products_category_id($products_id) . ” ORDER BY rand() limit 12&#8243;;<br />
$flash_page = $db-&gt;Execute($flash_page_query);<br />
while(!$flash_page-&gt;EOF){<br />
$flash_page_items[] = $flash_page-&gt;fields;<br />
$flash_page_id_con[]    = $flash_page-&gt;fields['products_id'];<br />
$flash_page_images_src = is_int(strpos($flash_page-&gt;fields['products_image'],&#8217;,'))? substr($flash_page-&gt;fields['products_image'],0,strpos($flash_page-&gt;fields['products_image'],&#8217;,')):$flash_page-&gt;fields['products_image'];<br />
$flash_page_images_con[]    = &#8216;”&#8216;.(zen_not_null($flash_page-&gt;fields['products_image']) ? $flash_page_images_src : PRODUCTS_IMAGE_NO_IMAGE ).&#8217;”&#8216;;<br />
$flash_page_price_con[]    = &#8216;”&#8216;.$currencies-&gt;display_price(zen_get_products_base_price($flash_page-&gt;fields['products_id']),zen_get_tax_rate($product_check-&gt;fields['products_tax_class_id'])).&#8217;”&#8216;;<br />
$flash_page_name_con[]    = &#8216;”&#8216;.zen_output_string(zen_get_products_name($flash_page-&gt;fields['products_id'])).&#8217;”&#8216;;<br />
$flash_page-&gt;MoveNext();<br />
}</p>
<p>$flash_page_id = implode(“,”, $flash_page_id_con);<br />
$flash_page_images = implode(“,”, $flash_page_images_con);<br />
$flash_page_price = implode(“,”, $flash_page_price_con);<br />
$flash_page_name = implode(“,”, $flash_page_name_con);<br />
$flash_page_display_num    = $flash_page-&gt;RecordCount();<br />
?&gt;</p>
<p>&lt;?php for($i = 0; $i&lt; $flash_page_display_num ; $i++){?&gt;<br />
&lt;li id=”li&lt;?php echo $i;?&gt;” style=”display:block;float:left;padding-left:10px;width:22%;”&gt;<br />
&lt;a href=”&lt;?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), &#8216;products_id=&#8217; . $flash_page_items[$i]['products_id']);?&gt;”&gt;&lt;?php echo zen_image(DIR_WS_IMAGES . $flash_page_items[$i]['products_image'], $flash_page_items[$i]['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT); ?&gt;&lt;/a&gt;&lt;p style=”text-align:center;”&gt;&lt;a href=”&lt;?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), &#8216;products_id=&#8217; . $flash_page_items[$i]['products_id']);?&gt;”&gt;&lt;?php echo $flash_page_items[$i]['products_name']; ?&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong id=”cell_price&lt;?php echo $i?&gt;” class=”red”&gt;&lt;?php echo $currencies-&gt;display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check-&gt;fields['products_tax_class_id'])); ?&gt;&lt;/strong&gt;&lt;/p&gt;<br />
&lt;/li&gt;<br />
&lt;?php<br />
//print_r($flash_page_items[$i]);<br />
}<br />
?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2，找到includes\templates\你的模板\templates\tpl_product_info_display.php文件<br />
在相应的位置加上以下代码：<br />
&lt;?php require($template-&gt;get_template_dir(&#8216;你创建的文件 tpl_product_info_similar.php&#8217;,DIR_WS_TEMPLATE, $current_page_base,&#8217;templates&#8217;). &#8216;/你创建的文件tpl_product_info_similar.php&#8217;); ?&gt;</p>
<p>一般可以加到&lt;?php require($template-&gt;get_template_dir(&#8216;tpl_modules_also_purchased_products.php&#8217;, DIR_WS_TEMPLATE, $current_page_base,&#8217;templates&#8217;). &#8216;/&#8217; . &#8216;tpl_modules_also_purchased_products.php&#8217;);?&gt;</p>
<p>&nbsp;</p>
<p>整相关产品显示的数量:ORDER BY rand() limit 12 找到这段 12就是显示的个数</p>
<p>&nbsp;</p>
<p>IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH 图的宽度 自己随便设好了 ZENCART都是按比例的<br />
IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT 图的高度</p>
<p>&lt;li id=”li&lt;?php echo $i;?&gt;” style=”display:block;float:left;padding-left:10px;width:22%;”&gt;<br />
width:22%; 每行大概显示4个<br />
显示2个就 50% 最好设49% 一般少一个百分点 因为考虑到IE的兼容性<br />
显示3个 就 33%<br />
显示5个 19% 咯<br />
自己调试</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>这个模块可以显示商品的一般价格，我想也显示商品的折扣价，请问该怎么改呢？效果如：<br />
Price:$500 $450</p>
<p>&lt;?php echo $currencies-&gt;display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check-&gt;fields['products_tax_class_id'])); ?&gt;<br />
修改为<br />
&lt;?php echo zen_get_products_display_price($flash_page_items[$i]['products_id']); ?&gt;</p>
<p>就显示Price:$500 $450了</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&lt;?php<br />
if($mn%3 == 0){<br />
echo “&lt;/tr&gt;”;$mn=0;<br />
}<br />
}<br />
if($mn&lt;3){<br />
$cols = 3-$mn;<br />
echo “&lt;td colspan=&#8217;”.$cols.”&#8216;&gt;&lt;td&gt;&lt;/tr&gt;”;<br />
}<br />
?&gt;</p>
<p>3就是每行显示3个。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>要怎样才能截取显示标题的前50个字符呢</p>
<p>&lt;?php echo substr($flash_page_items[$i]['products_name'],0,34); ?&gt;</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2011 年 8 月 13 日 -- <a href="http://www.vr188.com/zen-cart/zencart_zhannei_seo/" title="zencart网站的站内优化">zencart网站的站内优化</a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/share/google%e6%83%a9%e7%bd%9agoogle-penalty-checker10%e6%ad%a5%e5%88%86%e6%9e%90/" title="google惩罚(Google Penalty Checker)10步分析">google惩罚(Google Penalty Checker)10步分析</a> (0)</li><li>2011 年 8 月 11 日 -- <a href="http://www.vr188.com/zen-cart/zencart_meta_tag_seo/" title="Zencart程序之Meta标签优化">Zencart程序之Meta标签优化</a> (0)</li><li>2012 年 2 月 14 日 -- <a href="http://www.vr188.com/seo/magento%e7%9b%ae%e5%bd%95%e9%a1%b5%e8%ae%be%e7%bd%ae%e5%b8%83%e5%b1%80%e5%8f%8a%e6%b7%bb%e5%8a%a0%e6%96%b0%e5%b8%83%e5%b1%80%e7%9a%84%e6%96%b9%e6%b3%95/" title="Magento目录页设置布局及添加新布局的方法 ">Magento目录页设置布局及添加新布局的方法 </a> (0)</li><li>2011 年 8 月 16 日 -- <a href="http://www.vr188.com/zen-cart/%e7%ac%ac%e5%9b%9b%e4%bf%ae%e6%94%b9zen-cart%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b/" title="第四修改zen-cart二次开发教程">第四修改zen-cart二次开发教程</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.vr188.com/seo/zencart-%e5%9c%a8%e5%95%86%e5%93%81%e8%af%a6%e7%bb%86%e9%a1%b5%ef%bc%8c%e9%9a%8f%e6%9c%ba%e6%98%be%e7%a4%ba%e4%b8%80%e5%ae%9a%e6%95%b0%e9%87%8f%e7%9a%84%e5%90%8c%e7%b1%bb%e4%ba%a7%e5%93%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

