<?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>Magento中文项目组 &#187; key</title>
	<atom:link href="http://www.magentochinese.org/author/key/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.magentochinese.org</link>
	<description>专注于Magento中文包,插件,文章教程汉化翻译.</description>
	<lastBuildDate>Thu, 12 Apr 2012 14:18:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Magento组商品显示商品属性</title>
		<link>http://www.magentochinese.org/magento%e7%bb%84%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%b1%9e%e6%80%a7/</link>
		<comments>http://www.magentochinese.org/magento%e7%bb%84%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%b1%9e%e6%80%a7/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 00:59:34 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>
		<category><![CDATA[Magento开发]]></category>
		<category><![CDATA[magento教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1925</guid>
		<description><![CDATA[Magento组商品（Magento grouped product），是用来对属于一个系列或者一个组合的商品进行销售。如上图，为默认情况下的Magento组商品，此例子是对于一个沙发组合进行销售。组商品的特点就是你可以根据自己需要，每件可以购买不同的数量。 在某些时候，我们可能需要更加详细的内容显示，如下图，为销售一些五金商品，那么购买者可能需要更多的参数信息。 我们可以看到，这就是对组商品进行扩展，让其显示更多的属性值。 这个是怎样做到的呢？ 首先，我们要对Magento的属性组和属性非常熟悉，见我博客商品的Magento中文视频中有详细的教程。我们给组商品建立一个属性组，属性组中就有如上图中的，Diameter inch和Diameter mm等属性，然后在模板文件中将这些属性输出出来。下图，为名字为‘type1’的属性组，红色部分为添加的属性。 我们可能有很多类组商品，并且每一类组商品的表都不一样，那么就需要为每一类组商品创建一个属性组。 然后，当我们的属性组与属性设置好后，添加一个组商品，好看下我们设置的是否正确。因为我们还没有修改模板文件，前台的现实结果还和以前一样。 下面我们就去修改模板文件，模板文件路径为：app/design/frontend/default/你的模板文件夹/template/catalog/product/view/type /grouped.phtml 代码实例如下 &#60;!-- type1 --&#62; &#60;?php if($_product-&#62;getAttributeSetId() == 11): ?&#62; &#60;table class="data-table grouped-items-table" id="super-product-table"&#62; &#60;tr&#62; &#60;td rowspan="2"&#62;&#60;?php echo $this-&#62;__('Item number') ?&#62;&#60;/td&#62; &#60;td colspan="2"&#62;&#60;?php echo $this-&#62;__('Diameter') ?&#62;&#60;/td&#62; &#60;td &#62;&#60;?php echo $this-&#62;__('Hole diameter') ?&#62;&#60;/td&#62; &#60;td colspan="3"&#62;&#60;?php echo $this-&#62;__('Segment dimension mm') ?&#62;&#60;/td&#62; &#60;td rowspan="2"&#62;&#60;?php echo $this-&#62;__('Number [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1926" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product.png"><img class="size-large wp-image-1926" title="magento组商品显示商品属性表格" src="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product-600x418.png" alt="magento组商品显示商品属性表格" width="600" height="418" /></a><p class="wp-caption-text">magento组商品显示商品属性表格</p></div>
<p>Magento组商品（Magento grouped product），是用来对属于一个系列或者一个组合的商品进行销售。如上图，为默认情况下的Magento组商品，此例子是对于一个沙发组合进行销售。组商品的特点就是你可以根据自己需要，每件可以购买不同的数量。</p>
<p>在某些时候，我们可能需要更加详细的内容显示，如下图，为销售一些五金商品，那么购买者可能需要更多的参数信息。</p>
<div id="attachment_1927" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product-2.png"><img class="size-large wp-image-1927" title="magento组商品显示每件商品属性" src="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product-2-600x641.png" alt="magento组商品显示每件商品属性" width="600" height="641" /></a><p class="wp-caption-text">magento组商品显示每件商品属性</p></div>
<p>我们可以看到，这就是对组商品进行扩展，让其显示更多的属性值。</p>
<p>这个是怎样做到的呢？</p>
<p><span id="more-1925"></span></p>
<p>首先，我们要对Magento的属性组和属性非常熟悉，见我博客商品的Magento中文视频中有详细的教程。我们给组商品建立一个属性组，属性组中就有如上图中的，Diameter inch和Diameter mm等属性，然后在模板文件中将这些属性输出出来。下图，为名字为‘type1’的属性组，红色部分为添加的属性。</p>
<div id="attachment_1928" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product-3.png"><img class="size-large wp-image-1928" title="magento组商品的属性组" src="http://www.hellokeykey.com/wp-content/uploads/2011/07/magento-grouped-product-3-600x476.png" alt="magento组商品的属性组" width="600" height="476" /></a><p class="wp-caption-text">magento组商品的属性组</p></div>
<p>我们可能有很多类组商品，并且每一类组商品的表都不一样，那么就需要为每一类组商品创建一个属性组。</p>
<p>然后，当我们的属性组与属性设置好后，添加一个组商品，好看下我们设置的是否正确。因为我们还没有修改模板文件，前台的现实结果还和以前一样。</p>
<p>下面我们就去修改模板文件，模板文件路径为：app/design/frontend/default/你的模板文件夹/template/catalog/product/view/type /grouped.phtml 代码实例如下</p>
<pre class="brush:php">&lt;!-- type1 --&gt;
&lt;?php if($_product-&gt;getAttributeSetId() == 11): ?&gt;

	&lt;table class="data-table grouped-items-table" id="super-product-table"&gt;
	&lt;tr&gt;
		&lt;td rowspan="2"&gt;&lt;?php echo $this-&gt;__('Item number') ?&gt;&lt;/td&gt;
		&lt;td colspan="2"&gt;&lt;?php echo $this-&gt;__('Diameter') ?&gt;&lt;/td&gt;
		&lt;td &gt;&lt;?php echo $this-&gt;__('Hole diameter') ?&gt;&lt;/td&gt;
		&lt;td colspan="3"&gt;&lt;?php echo $this-&gt;__('Segment dimension mm') ?&gt;&lt;/td&gt;
		&lt;td rowspan="2"&gt;&lt;?php echo $this-&gt;__('Number of segments') ?&gt;&lt;/td&gt;
		&lt;td rowspan="2"&gt;&lt;?php echo $this-&gt;__('Price') ?&gt;&lt;/td&gt;
		&lt;td rowspan="2"&gt;&lt;?php echo $this-&gt;__('Qty') ?&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr  class="tr-title"&gt;
		&lt;td &gt;&lt;?php echo $this-&gt;__('inch') ?&gt;&lt;/td&gt;
		&lt;td &gt;&lt;?php echo $this-&gt;__('mm') ?&gt;&lt;/td&gt;
		&lt;td &gt;&lt;?php echo $this-&gt;__('mm') ?&gt;&lt;/td&gt;
		&lt;th&gt;&lt;?php echo $this-&gt;__('height') ?&gt;&lt;/th&gt;
		&lt;th&gt;&lt;?php echo $this-&gt;__('thickness') ?&gt;&lt;/th&gt;
		&lt;th&gt;&lt;?php echo $this-&gt;__('length') ?&gt;&lt;/th&gt;
	&lt;/tr&gt;

	&lt;?php if ($_hasAssociatedProducts): ?&gt;
		&lt;?php foreach ($_associatedProducts as $_item): ?&gt;
			&lt;?php $_finalPriceInclTax = $this-&gt;helper('tax')-&gt;getPrice($_item, $_item-&gt;getFinalPrice(), true) ?&gt;
			&lt;tr&gt;

				&lt;td&gt;&lt;?php echo $this-&gt;htmlEscape($_item-&gt;getSku()) ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('diameter_inch'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('diameter_mm'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('hole_diameter_mm'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('segment_dimension_height'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('segment_dimension_thickness'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('segment_dimension_length'); ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $_item-&gt;getData('number_of_segments'); ?&gt;&lt;/td&gt;
				&lt;?php if ($this-&gt;getCanShowProductPrice($_product)): ?&gt;
				&lt;td class="a-right"&gt;
					&lt;?php if ($this-&gt;getCanShowProductPrice($_item)): ?&gt;
					&lt;?php echo $this-&gt;getPriceHtml($_item, true) ?&gt;
					&lt;?php echo $this-&gt;getTierPriceHtml($_item) ?&gt;
					&lt;?php endif; ?&gt;
				&lt;/td&gt;
				&lt;?php endif; ?&gt;
				&lt;?php if ($_product-&gt;isSaleable()): ?&gt;
				&lt;td class="a-center"&gt;
				&lt;?php if ($_item-&gt;isSaleable()) : ?&gt;
					&lt;input type="text" name="super_group[&lt;?php echo $_item-&gt;getId() ?&gt;]" maxlength="12" value="&lt;?php echo $_item-&gt;getQty()*1 ?&gt;" title="&lt;?php echo $this-&gt;__('Qty') ?&gt;" class="input-text qty" /&gt;
				&lt;?php else: ?&gt;
					&lt;p class="availability out-of-stock"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
				&lt;?php endif; ?&gt;
				&lt;/td&gt;
				&lt;?php endif; ?&gt;
			&lt;/tr&gt;
		&lt;?php endforeach; ?&gt;
		&lt;?php else: ?&gt;
		   &lt;tr&gt;
			   &lt;td colspan="&lt;?php if ($_product-&gt;isSaleable()): ?&gt;4&lt;?php else : ?&gt;3&lt;?php endif; ?&gt;"&gt;&lt;?php echo $this-&gt;__('No options of this product are available.') ?&gt;&lt;/td&gt;
		   &lt;/tr&gt;
	&lt;?php endif; ?&gt;
	&lt;/table&gt;
&lt;?php endif; ?&gt;
&lt;!-- type1 end --&gt;</pre>
<p>分析代码：</p>
<p>此代码是应对网站中有多种组商品的。由于每一个组商品我们都制定一个只属于它自己的属性组，所以我可以先通过判断属性组，知道有是哪个组商品，有哪些属性，如何显示表格。判断当前商品是哪个属性组的语句如下。</p>
<pre class="brush:php">&lt;?php if($_product-&gt;getAttributeSetId() == 12): ?&gt;</pre>
<p>每个属性组都有唯一的ID（后台创建完属性组，即可查），我们通过ID判断。</p>
<p>对当前的属性组获取其属性输出的语句示例如下</p>
<pre class="brush:php">&lt;?php echo $_item-&gt;getData('diameter_mm'); ?&gt;</pre>
<p>如上，‘diameter_mm’就是在后台添加的属性名字，通过属性名字获得其值。</p>
<p>通过html语言的组织，我们用table将页面弄的美观些，就有如上面第二张图的效果了。</p>
<p>&nbsp;</p>
<p>本例代码使用magento1.5版本进行讲解，其它版本可能稍有不同。适合有一定magento开发经验的人学习参考。</p>
<p>&nbsp;</p>
<p>转载表明出处:www.hellokeykey.com</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e7%bb%84%e5%95%86%e5%93%81%e6%98%be%e7%a4%ba%e5%95%86%e5%93%81%e5%b1%9e%e6%80%a7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento没有订单提交按钮</title>
		<link>http://www.magentochinese.org/magento%e6%b2%a1%e6%9c%89%e8%ae%a2%e5%8d%95%e6%8f%90%e4%ba%a4%e6%8c%89%e9%92%ae/</link>
		<comments>http://www.magentochinese.org/magento%e6%b2%a1%e6%9c%89%e8%ae%a2%e5%8d%95%e6%8f%90%e4%ba%a4%e6%8c%89%e9%92%ae/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 10:34:29 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>
		<category><![CDATA[magento中文教程]]></category>
		<category><![CDATA[magento教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1916</guid>
		<description><![CDATA[最近用Magento兰亭2011模板的人们向我反映，在订单提交页面没有提交按钮，我来说下如何解决此问题。 先来简单说说此兰亭模板。 Magento兰亭2001真是个很不错的模板，本人很佩服制作此模板的人，因为此模板首先是很好的仿了兰亭，其次是功能上也很丰富，很少有模板有如此丰富的功能。并且比我自己写的兰亭模板强多了，自惭形秽，又崇拜。此模板官网地址是：http://www.bestmagento.com/ 希望大家支持正版。此模板的缺点可能是因为功能太丰富，一般的新手无法应付。 我看了其模板.phtml文件，并没有什么明显的问题。我觉得应该是XML文件的问题，可能由于版本问题，XML有错误的地方，不出所料。 app\design\frontend\default\se101\layout\checkout.xml  此文件中约380行位置，如下代码 &#60;!-- One page checkout order review block --&#62; &#60;checkout_onepage_review translate="label"&#62; &#60;label&#62;One Page Checkout Overview&#60;/label&#62; &#60;!-- Mage_Checkout --&#62; &#60;remove name="right"/&#62; &#60;remove name="left"/&#62; &#60;block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml"&#62; &#60;action method="addItemRender"&#62;&#60;type&#62;default&#60;/type&#62;&#60;block&#62;checkout/cart_item_renderer&#60;/block&#62;&#60;template&#62;checkout/onepage/review/item.phtml&#60;/template&#62;&#60;/action&#62; &#60;action method="addItemRender"&#62;&#60;type&#62;grouped&#60;/type&#62;&#60;block&#62;checkout/cart_item_renderer_grouped&#60;/block&#62;&#60;template&#62;checkout/onepage/review/item.phtml&#60;/template&#62;&#60;/action&#62; &#60;action method="addItemRender"&#62;&#60;type&#62;configurable&#60;/type&#62;&#60;block&#62;checkout/cart_item_renderer_configurable&#60;/block&#62;&#60;template&#62;checkout/onepage/review/item.phtml&#60;/template&#62;&#60;/action&#62; &#60;block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/&#62; &#60;block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label"&#62; &#60;label&#62;Items Before&#60;/label&#62; &#60;/block&#62; &#60;/block&#62; &#60;/checkout_onepage_review&#62; 要更新为 [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1917" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-miss-button.jpg"><img class="size-full wp-image-1917" title="Magento没有订单提交按钮" src="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-miss-button.jpg" alt="Magento没有订单提交按钮" width="600" height="223" /></a><p class="wp-caption-text">Magento没有订单提交按钮</p></div>
<p>最近用Magento兰亭2011模板的人们向我反映，在订单提交页面没有提交按钮，我来说下如何解决此问题。</p>
<p>先来简单说说此兰亭模板。</p>
<p>Magento兰亭2001真是个很不错的模板，本人很佩服制作此模板的人，因为此模板首先是很好的仿了兰亭，其次是功能上也很丰富，很少有模板有如此丰富的功能。并且比我自己写的兰亭模板强多了，自惭形秽，又崇拜。此模板官网地址是：<a title="magento兰亭模板" href="http://www.bestmagento.com/" >http://www.bestmagento.com/</a> 希望大家支持正版。此模板的缺点可能是因为功能太丰富，一般的新手无法应付。</p>
<p>我看了其模板.phtml文件，并没有什么明显的问题。我觉得应该是XML文件的问题，可能由于版本问题，XML有错误的地方，不出所料。</p>
<p>app\design\frontend\default\se101\layout\checkout.xml  此文件中约380行位置，如下代码</p>
<pre class="brush:xml">&lt;!--
One page checkout order review block
--&gt;

    &lt;checkout_onepage_review translate="label"&gt;
        &lt;label&gt;One Page Checkout Overview&lt;/label&gt;
        &lt;!-- Mage_Checkout --&gt;
        &lt;remove name="right"/&gt;
        &lt;remove name="left"/&gt;

        &lt;block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml"&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;default&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;grouped&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer_grouped&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;configurable&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer_configurable&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/&gt;
            &lt;block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label"&gt;
                &lt;label&gt;Items Before&lt;/label&gt;
            &lt;/block&gt;
        &lt;/block&gt;
    &lt;/checkout_onepage_review&gt;</pre>
<p>要更新为</p>
<pre class="brush:xml">&lt;!--
One page checkout order review block
--&gt;

    &lt;checkout_onepage_review translate="label"&gt;
        &lt;label&gt;One Page Checkout Overview&lt;/label&gt;
        &lt;!-- Mage_Checkout --&gt;
        &lt;remove name="right"/&gt;
        &lt;remove name="left"/&gt;

        &lt;block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml"&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;default&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;grouped&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer_grouped&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;action method="addItemRender"&gt;&lt;type&gt;configurable&lt;/type&gt;&lt;block&gt;checkout/cart_item_renderer_configurable&lt;/block&gt;&lt;template&gt;checkout/onepage/review/item.phtml&lt;/template&gt;&lt;/action&gt;
            &lt;block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/&gt;
            &lt;block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label"&gt;
                &lt;label&gt;Items Before&lt;/label&gt;
            &lt;/block&gt;
			&lt;block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label"&gt;
                &lt;label&gt;Items After&lt;/label&gt;
            &lt;/block&gt;
            &lt;block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/&gt;
            &lt;block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/&gt;
        &lt;/block&gt;
    &lt;/checkout_onepage_review&gt;</pre>
<p>我们通过对比可以发现XML少了两行的声明。</p>
<p>一般我们去分析XML文件的时候，没有谁可以直接看到问题所在，要通过与当前版本的default模板中的XML文件做下对比，才容易确定问题所在。</p>
<p><span id="more-1916"></span>此问题也证明，平时收集Magento模板存起来意义不大，因为Magento升级太快了，跨两个版本模板就不好兼容了。比如1.3的模板用到1.5上，基本不会成功。所以大家不用存那么多的模板。</p>
<p>转载表明出处：www.hellokeykey.com</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e6%b2%a1%e6%9c%89%e8%ae%a2%e5%8d%95%e6%8f%90%e4%ba%a4%e6%8c%89%e9%92%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>去掉Magento边栏Paypal的Logo</title>
		<link>http://www.magentochinese.org/%e5%8e%bb%e6%8e%89magento%e8%be%b9%e6%a0%8fpaypal%e7%9a%84logo/</link>
		<comments>http://www.magentochinese.org/%e5%8e%bb%e6%8e%89magento%e8%be%b9%e6%a0%8fpaypal%e7%9a%84logo/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 09:10:30 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文教程]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1910</guid>
		<description><![CDATA[如上图，我们在现在的Magento版本中，可以看到侧边栏的Palpay标志，如何去掉它呢？后台是可以设置的。 后台-&#62;System-&#62;Configuration-&#62;Payapl-&#62;Frontend Experience Settings 如下图 在 Paypal Product Logo选项中设置为NO，刷新缓存，即可。 本文使用Magento1.5讲解，其它版本类似。 转载表明来自:www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1912" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-paypal-side-logo.jpg"><img class="size-full wp-image-1912" title="magento paypal边栏logo" src="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-paypal-side-logo.jpg" alt="magento paypal边栏logo" width="600" height="308" /></a><p class="wp-caption-text">magento paypal边栏logo</p></div>
<p>如上图，我们在现在的Magento版本中，可以看到侧边栏的Palpay标志，如何去掉它呢？后台是可以设置的。</p>
<p>后台-&gt;System-&gt;Configuration-&gt;Payapl-&gt;Frontend Experience Settings 如下图</p>
<div id="attachment_1911" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/06/Magento-paypal-logo.jpg"><img class="size-full wp-image-1911" title="Magento去除侧边栏paypal标志设置" src="http://www.hellokeykey.com/wp-content/uploads/2011/06/Magento-paypal-logo.jpg" alt="Magento去除侧边栏paypal标志设置" width="600" height="244" /></a><p class="wp-caption-text">Magento去除侧边栏paypal标志设置</p></div>
<p>在 Paypal Product Logo选项中设置为NO，刷新缓存，即可。</p>
<p><span id="more-1910"></span>本文使用Magento1.5讲解，其它版本类似。</p>
<p>转载表明来自:www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/%e5%8e%bb%e6%8e%89magento%e8%be%b9%e6%a0%8fpaypal%e7%9a%84logo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento官方提供培训服务</title>
		<link>http://www.magentochinese.org/magento%e5%ae%98%e6%96%b9%e6%8f%90%e4%be%9b%e5%9f%b9%e8%ae%ad%e6%9c%8d%e5%8a%a1/</link>
		<comments>http://www.magentochinese.org/magento%e5%ae%98%e6%96%b9%e6%8f%90%e4%be%9b%e5%9f%b9%e8%ae%ad%e6%9c%8d%e5%8a%a1/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 08:27:05 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[其他]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento其它]]></category>
		<category><![CDATA[magento培训]]></category>
		<category><![CDATA[magento模板]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1904</guid>
		<description><![CDATA[今天看到水水的文章，去Magento官网看下，此页 http://www.magentocommerce.com/services/course-pricing 。 Magento针对各个Magento人群提供各种培训服务。如上图画红线课程为Magento模板制作开发课程，时间为2天，收费为1850美元，当前汇率折合人民币11989元。与我的Magento模板制作包学包会教程相比较，我的价格还是很实惠的。 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1905" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-course-pricing.png"><img class="size-full wp-image-1905" title="Magento官方提供培训服务" src="http://www.hellokeykey.com/wp-content/uploads/2011/06/magento-course-pricing.png" alt="Magento官方提供培训服务" width="600" height="180" /></a><p class="wp-caption-text">Magento官方提供培训服务</p></div>
<p>今天看到<a title="水水的magento专栏" href="http://blog.csdn.net/shuishui8310" >水水</a>的文章，去Magento官网看下，此页<a title="Magento Course" href="http://www.magentocommerce.com/services/course-pricing" > http://www.magentocommerce.com/services/course-pricing </a>。 Magento针对各个Magento人群提供各种培训服务。如上图画红线课程为Magento模板制作开发课程，时间为2天，收费为1850美元，当前汇率折合人民币11989元。与我的<a title="Magento模板制作中文教程" href="http://www.hellokeykey.com/magento-make-templates-videos/" >Magento模板制作</a>包学包会教程相比较，我的价格还是很实惠的。</p>
<p><span id="more-1904"></span></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%ae%98%e6%96%b9%e6%8f%90%e4%be%9b%e5%9f%b9%e8%ae%ad%e6%9c%8d%e5%8a%a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eBay完全收购Magento</title>
		<link>http://www.magentochinese.org/ebay%e5%ae%8c%e5%85%a8%e6%94%b6%e8%b4%admagento/</link>
		<comments>http://www.magentochinese.org/ebay%e5%ae%8c%e5%85%a8%e6%94%b6%e8%b4%admagento/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 01:03:50 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.magentochinese.org/?p=728</guid>
		<description><![CDATA[eBay已经同意收购互联网电子商务平台Magento的剩余股份，此前eBay已经拥有Magento的股份。双方没有透露具体条款。通过收购Magento和自家的开源电子商务X Commerce，eBay可以提供支付和网站之外的服务。在10月的X Commerce创新大会上，eBay会透露更多的细节。]]></description>
			<content:encoded><![CDATA[<p>今天收到Magento发来的newsletter,说已经被收购.原文如下:<br />
<strong>eBay Agrees to Acquire Magento</strong><br />
The past several years have been an amazing journey for Magento, as we&#8217;ve grown from a new open source platform into an eCommerce leader. Along the way, we&#8217;ve built not only a platform, but a company and a worldwide community. Together, we&#8217;ve identified opportunities, taken risks, innovated, struggled, succeeded, and changed the face of eCommerce. Today marks a milestone on this journey as we announce the most exciting news in our company&#8217;s history.</p>
<p>Magento has reached an agreement to be acquired by eBay Inc. We believe this move will open incredible opportunities for the entire Magento ecosystem.</p>
<p><strong>The Big Picture</strong></p>
<p>Why is this acquisition so exciting for all of us? eBay is evolving to become a strategic commerce partner focused on delivering new ways for merchants of all sizes to drive innovation. As a centerpiece of this strategy, they are building a global, open commerce platform that leverages the worldwide developer community. And Magento will be at the core of this new, open commerce platform, called &#8220;X.Commerce.&#8221;<br />
<strong><br />
Magento &#038; eBay</strong></p>
<p>As many of you know, Magento has had a relationship with eBay for some time. In March 2010, eBay became our first outside investor. Over the past year, eBay has gotten to know our platform, our culture, and our community. They have experienced the passion of the Magento ecosystem, and they are eager to harness the power of this ecosystem to create the next generation of eCommerce innovation.</p>
<p><strong>Magento Forward: The Details</strong></p>
<p>How will this acquisition impact our organization, customers and partners? It&#8217;s too soon to know all the details, but there are a few things we know. Magento will continue to operate out of LA, with Yoav Kutner and me as its leaders following the closing. We&#8217;ll continue building our team and our enhancing our product line, including the Magento Community, Enterprise, and Mobile Editions, as well as Magento Go and the Magento Go Platform. And we&#8217;ll continue strengthening our training, education, packaged consulting services and support efforts around the world.</p>
<p>Through it all, we&#8217;ll be collaborating with our colleagues at eBay on developing the X.Commerce platform and defining the next generation of eCommerce innovation.</p>
<p>Yoav and I recorded a short video message for the community – you can find it on our blog, along with FAQs about the pending acquisition.</p>
<p>Creating The Future Together</p>
<p>To all the members the Magento family: we thank you for all the passion, expertise and hard work that you&#8217;ve invested in Magento. Thanks to you, Magento finds itself exactly where we&#8217;ve always aimed to be: at the core of eCommerce. We are thrilled to become part of a larger organization that recognizes – as we always have – that the future of eCommerce is global, innovative and open. We look forward to creating that future with all of you. 	 </p>
<p>Warm Regards,</p>
<p>Roy Rubin<br />
Co-Founder and CEO, Magento</p>
<p><strong>下面是转自oschina的翻译:</strong></p>
<p>【搜狐IT消息】6月7日消息，eBay已经同意收购互联网电子商务平台Magento的剩余股份，此前eBay已经拥有Magento的股份。双方没有透露具体条款。</p>
<p>eBay预期将在三季度完成交易。在2月的分析师会议上，eBay曾宣布收购Magento 49%的股份。Magento拥有一个电子商务平台，支持在线销售。根据2010年3月美国证券交易委员会的资料显示，投资总计2250万美元。</p>
<p>上个月，eBay曾表示将利用Skype出售获得的24亿美元进行一些收购。</p>
<p>通过收购Magento和自家的开源电子商务X Commerce，eBay可以提供支付和网站之外的服务。在10月的X Commerce创新大会上，eBay会透露更多的细节。</p>
<p>Magento总部设在洛杉矶市，拥有290多名员工。Magento的客户包括福特汽车、斯沃琪集团（瑞士最大的钟表集团）等。（Ark）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/ebay%e5%ae%8c%e5%85%a8%e6%94%b6%e8%b4%admagento/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>使用setTemplate在Controller中设置Magento的页面结构</title>
		<link>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8settemplate%e5%9c%a8controller%e4%b8%ad%e8%ae%be%e7%bd%aemagento%e7%9a%84%e9%a1%b5%e9%9d%a2%e7%bb%93%e6%9e%84/</link>
		<comments>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8settemplate%e5%9c%a8controller%e4%b8%ad%e8%ae%be%e7%bd%aemagento%e7%9a%84%e9%a1%b5%e9%9d%a2%e7%bb%93%e6%9e%84/#comments</comments>
		<pubDate>Fri, 13 May 2011 13:51:02 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1840</guid>
		<description><![CDATA[在Magento中新建一个插件的时候，如何控制我们前台页面的页面结构呢？一个方法是去修改我们的模板XML文件来实现。另一个办法就是在我们插件的Controller（控制器）中来设置Magento的页面结构。 代码如下： $this-&#62;loadLayout(); $this-&#62;getLayout()-&#62;getBlock('root')-&#62;setTemplate('page/1column.phtml'); $this-&#62;renderLayout(); 我们可以看到setTemplate( )的参数是 一栏结构，在此处指定你的前台页面结构。例如如设置成2栏左结构的参数是‘page/2columns-left。’ 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1842" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/set-magento-layout.gif"><img class="size-full wp-image-1842" title="在控制器中设置magento页面结构" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/set-magento-layout.gif" alt="在控制器中设置magento页面结构" width="600" height="214" /></a><p class="wp-caption-text">在控制器中设置magento页面结构</p></div>
<p>在Magento中新建一个插件的时候，如何控制我们前台页面的页面结构呢？一个方法是去修改我们的模板XML文件来实现。另一个办法就是在我们插件的Controller（控制器）中来设置Magento的页面结构。</p>
<p>代码如下：</p>
<pre class="brush:php">$this-&gt;loadLayout();
$this-&gt;getLayout()-&gt;getBlock('root')-&gt;setTemplate('page/1column.phtml');
$this-&gt;renderLayout();</pre>
<p><span id="more-1840"></span></p>
<p>我们可以看到setTemplate( )的参数是 一栏结构，在此处指定你的前台页面结构。例如如设置成2栏左结构的参数是‘page/2columns-left。’</p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8settemplate%e5%9c%a8controller%e4%b8%ad%e8%ae%be%e7%bd%aemagento%e7%9a%84%e9%a1%b5%e9%9d%a2%e7%bb%93%e6%9e%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用APC为Magento加速</title>
		<link>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8apc%e4%b8%bamagento%e5%8a%a0%e9%80%9f/</link>
		<comments>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8apc%e4%b8%bamagento%e5%8a%a0%e9%80%9f/#comments</comments>
		<pubDate>Fri, 13 May 2011 02:19:52 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[Magento Apc]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1829</guid>
		<description><![CDATA[Centos系统的Lamp环境运行Magento，我们来看下如何使用APC为Magento加速。 网上安装APC的教程很多，我这里将我自己验证过的几个组件的安装命令列出来，大家参考下。如下 #yum install install #yum install php-devel #yum install php-pear #yum install httpd-devel #yum install pcre-devel 先安装如上几个模块，（使用yum就是很省心）。运行如下命令进行APC安装，安装过程中的问题，按照中括号中的建议值填写。 #pecl install apc 安装结束后有如下的提示： # configuration option "php_ini" is not set to php.ini location # You should add "extension=apc.so" to php.ini 意思是说，让我们在php.ihi文件中，声明加载APC这个扩展。 我的php.ini路径是 /etc/php.ini 在里面的扩展声明部分，加上如下内容即可 extension=apc.so [APC] apc.enabled =1 apc.shm_size=256 apc.num_files_hint=10000 apc.user_entries_hint=10000 apc.max_file_size=5M apc.stat=1 在上面php.ini中[APC]后面的内容是对APC参数进行的设置，你可以根据你的情况来自己修改。 APC优化设置可以参考：http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/ 重启我们的apache服务器，我们的APC安装就结束了，下面进入Magento的配置环节。 [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1833" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-apc.jpg"><img class="size-full wp-image-1833" title="使用APC为Magento加速" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-apc.jpg" alt="使用APC为Magento加速" width="600" height="323" /></a><p class="wp-caption-text">使用APC为Magento加速</p></div>
<p>Centos系统的Lamp环境运行Magento，我们来看下如何使用APC为Magento加速。</p>
<p>网上安装APC的教程很多，我这里将我自己验证过的几个组件的安装命令列出来，大家参考下。如下</p>
<pre class="brush:perl">#yum install install
#yum install php-devel
#yum install php-pear
#yum install httpd-devel
#yum install pcre-devel</pre>
<p>先安装如上几个模块，（使用yum就是很省心）。运行如下命令进行APC安装，安装过程中的问题，按照中括号中的建议值填写。</p>
<pre class="brush:perl">#pecl install apc</pre>
<p>安装结束后有如下的提示：</p>
<pre class="brush:perl"># configuration option "php_ini" is not set to php.ini location
# You should add "extension=apc.so" to php.ini</pre>
<p>意思是说，让我们在php.ihi文件中，声明加载APC这个扩展。</p>
<p>我的php.ini路径是 /etc/php.ini</p>
<p>在里面的扩展声明部分，加上如下内容即可</p>
<pre class="brush:perl">extension=apc.so
[APC]
apc.enabled =1
apc.shm_size=256
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=1</pre>
<p>在上面php.ini中[APC]后面的内容是对APC参数进行的设置，你可以根据你的情况来自己修改。</p>
<p>APC优化设置可以参考：<a title="use APC in Magento" href="http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/" >http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/</a></p>
<p>重启我们的apache服务器，我们的APC安装就结束了，下面进入Magento的配置环节。</p>
<p>我们去修改Magento的配置文件，文件路径 Magento根目录/app/etc/local.xml</p>
<p>修改后为：</p>
<pre class="brush:xml">&lt;config&gt;
    &lt;global&gt;
        &lt;install&gt;
            &lt;date&gt;&lt;![CDATA[Thu, 12 May 2011 05:06:06 +0000]]&gt;&lt;/date&gt;
        &lt;/install&gt;
        &lt;crypt&gt;
            &lt;key&gt;&lt;![CDATA[295888775466d0eb721707c95763b0be]]&gt;&lt;/key&gt;
        &lt;/crypt&gt;
        &lt;disable_local_modules&gt;false&lt;/disable_local_modules&gt;
        &lt;resources&gt;
            &lt;db&gt;
                &lt;table_prefix&gt;&lt;![CDATA[]]&gt;&lt;/table_prefix&gt;
            &lt;/db&gt;
            &lt;default_setup&gt;
                &lt;connection&gt;
                    &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;
                    &lt;username&gt;&lt;![CDATA[root]]&gt;&lt;/username&gt;
                    &lt;password&gt;&lt;![CDATA[123456789]]&gt;&lt;/password&gt;
                    &lt;dbname&gt;&lt;![CDATA[shop]]&gt;&lt;/dbname&gt;
                    &lt;active&gt;1&lt;/active&gt;
                &lt;/connection&gt;
            &lt;/default_setup&gt;
        &lt;/resources&gt;
        &lt;session_save&gt;&lt;![CDATA[files]]&gt;&lt;/session_save&gt;
		&lt;cache&gt;
          &lt;backend&gt;apc&lt;/backend&gt;
          &lt;prefix&gt;MAGE_&lt;/prefix&gt;
     	&lt;/cache&gt;
    &lt;/global&gt;
    &lt;admin&gt;
        &lt;routers&gt;
            &lt;adminhtml&gt;
                &lt;args&gt;
                    &lt;frontName&gt;&lt;![CDATA[thisisadmin]]&gt;&lt;/frontName&gt;
                &lt;/args&gt;
            &lt;/adminhtml&gt;
        &lt;/routers&gt;
    &lt;/admin&gt;
&lt;/config&gt;</pre>
<p>注意，增加的代码是如下（可能因为版本变动，此设置有变化，注意自己google最新Magento文章，参考设置）</p>
<pre class="brush:perl">&lt;cache&gt;
    &lt;backend&gt;apc&lt;/backend&gt;
    &lt;prefix&gt;MAGE_&lt;/prefix&gt;
&lt;/cache&gt;</pre>
<p>注意，此处的&#8217;MAGE_&#8217; 是唯一值，如果你运行了多个Magento，要给每一个写上不同的&lt;prefix&gt;。</p>
<p>最后一步，刷新Magento缓存。</p>
<p>这样 整个的安装配置过程就结束了。最后我们可以使用APC安装包中的apc.php文件看下我们APC运行的状态。将此文件放在你的magento网站根目录，通过  网址/apc.php 访问，如本文章开始的那张图片，会显示APC的运行信息，也可以看到我们刚才已经设置的参数信息。可以以此图来进行优化配置。</p>
<p><span id="more-1829"></span></p>
<p>转载标明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8apc%e4%b8%bamagento%e5%8a%a0%e9%80%9f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento获得全部分类</title>
		<link>http://www.magentochinese.org/magento%e8%8e%b7%e5%be%97%e5%85%a8%e9%83%a8%e5%88%86%e7%b1%bb/</link>
		<comments>http://www.magentochinese.org/magento%e8%8e%b7%e5%be%97%e5%85%a8%e9%83%a8%e5%88%86%e7%b1%bb/#comments</comments>
		<pubDate>Tue, 10 May 2011 10:01:25 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1800</guid>
		<description><![CDATA[magento获得全部的菜单分类，这段代码的好处就是可以放在任意的phtml文件中，并且做了诸多的条件判断。我们可以参考灵活运用，供初学者参考。 此代码来自互联网：http://www.magentocommerce.com/boards/viewthread/24947/P15/ function nodeToArray(Varien_Data_Tree_Node $node) { $result = array(); $result['category_id'] = $node-&#62;getId(); $result['parent_id'] = $node-&#62;getParentId(); $result['name'] = $node-&#62;getName(); $result['is_active'] = $node-&#62;getIsActive(); $result['position'] = $node-&#62;getPosition(); $result['level'] = $node-&#62;getLevel(); $result['children'] = array(); foreach ($node-&#62;getChildren() as $child) { $result['children'][] = nodeToArray($child); } return $result; } function load_tree() { $tree = Mage::getResourceSingleton('catalog/category_tree') -&#62;load(); $store = 1; $parentId = 1; [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1809" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-get-a-list-of-all-categories.jpg"><img class="size-full wp-image-1809" title="Magento获得全部分类" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-get-a-list-of-all-categories.jpg" alt="Magento获得全部分类" width="600" height="127" /></a><p class="wp-caption-text">Magento获得全部分类</p></div>
<p>magento获得全部的菜单分类，这段代码的好处就是可以放在任意的phtml文件中，并且做了诸多的条件判断。我们可以参考灵活运用，供初学者参考。</p>
<p>此代码来自互联网：<a title="get a list of all categories" href="http://www.magentocommerce.com/boards/viewthread/24947/P15/" >http://www.magentocommerce.com/boards/viewthread/24947/P15/</a></p>
<pre class="brush:php">function nodeToArray(Varien_Data_Tree_Node $node) {
    $result = array();
    $result['category_id'] = $node-&gt;getId();
    $result['parent_id'] = $node-&gt;getParentId();
    $result['name'] = $node-&gt;getName();
    $result['is_active'] = $node-&gt;getIsActive();
    $result['position'] = $node-&gt;getPosition();
    $result['level'] = $node-&gt;getLevel();
    $result['children'] = array();

    foreach ($node-&gt;getChildren() as $child) {
        $result['children'][] = nodeToArray($child);
    }

    return $result;
}

function load_tree() {

    $tree = Mage::getResourceSingleton('catalog/category_tree')
                    -&gt;load();

    $store = 1;
    $parentId = 1;

    $tree = Mage::getResourceSingleton('catalog/category_tree')
                    -&gt;load();

    $root = $tree-&gt;getNodeById($parentId);

    if ($root &amp;&amp; $root-&gt;getId() == 1) {
        $root-&gt;setName(Mage::helper('catalog')-&gt;__('Root'));
    }

    $collection = Mage::getModel('catalog/category')-&gt;getCollection()
                    -&gt;setStoreId($store)
                    -&gt;addAttributeToSelect('name')
                    //-&gt;addAttributeToSelect('id')
                    -&gt;addAttributeToSelect('is_active');

    $tree-&gt;addCollectionData($collection, true);

    return nodeToArray($root);
}

function print_tree($tree, $level) {
    $level++;
    foreach ($tree as $item) {
        echo str_repeat("*", $level) . $item['name'] . '*' . $item['category_id'] . "&lt;br&gt;";
        print_tree($item['children'], $level);
    }
}

$tree = load_tree();
print_tree($tree['children'], 0);</pre>
<p><span id="more-1800"></span></p>
<p>转载表明出处:www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e8%8e%b7%e5%be%97%e5%85%a8%e9%83%a8%e5%88%86%e7%b1%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento团购插件</title>
		<link>http://www.magentochinese.org/magento%e5%9b%a2%e8%b4%ad%e6%8f%92%e4%bb%b6/</link>
		<comments>http://www.magentochinese.org/magento%e5%9b%a2%e8%b4%ad%e6%8f%92%e4%bb%b6/#comments</comments>
		<pubDate>Mon, 09 May 2011 13:10:39 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[模块]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento插件]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1792</guid>
		<description><![CDATA[magento现有一款免费的团购插件，官方插件地址为：https://www.magentocommerce.com/magento-connect/Zizio/extension/6378/ziziogroupsale 。需要登录才能获得Magento connect安装，现在是稳定版支持Magento 1.3\1.4\1.5版本。 为了免去大家登录的麻烦公布安装key如下，安装方法见我的magento cennect使用视频。 Magento 1.3 connect安装key为：magento-community/ZizioGroupSale Magento 1.5 connect安装key为：http://connect20.magentocommerce.com/community/ZizioGroupSale magento1.4试下是用1.3的还是1.5的key，由于Magento connect升级，key有变化。 此团购插件安装后，记得刷新Magento的索引管理和Magento的缓存。 通过Magento后台: Promotions-&#62;Zizio Group Sale访问此插件。第一次使用此插件需要填写注册信息，都是免费的了，就费心填下吧，填完会发送欢迎信息到你的邮箱。然后就可以添加编辑团购商品了。 团购商品会显示在原商品的分类页面，如下图。所以如果搞团购就新建个团购分类，好将所有的团购商品集中到一起。 转载表明出处：www.hellokeykey.com &#160; &#160;]]></description>
			<content:encoded><![CDATA[<div id="attachment_1793" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-group-sale.jpg"><img class="size-full wp-image-1793" title="magento团购插件" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-group-sale.jpg" alt="magento团购插件" width="600" height="493" /></a><p class="wp-caption-text">magento团购插件</p></div>
<p>magento现有一款免费的团购插件，官方插件地址为：https://www.magentocommerce.com/magento-connect/Zizio/extension/6378/ziziogroupsale 。需要登录才能获得Magento connect安装，现在是稳定版支持Magento 1.3\1.4\1.5版本。</p>
<p>为了免去大家登录的麻烦公布安装key如下，安装方法见我的magento cennect使用视频。</p>
<p>Magento 1.3  connect安装key为：magento-community/ZizioGroupSale</p>
<p>Magento 1.5 connect安装key为：http://connect20.magentocommerce.com/community/ZizioGroupSale</p>
<p>magento1.4试下是用1.3的还是1.5的key，由于Magento connect升级，key有变化。</p>
<p>此团购插件安装后，记得刷新Magento的索引管理和Magento的缓存。</p>
<p>通过Magento后台: Promotions-&gt;Zizio Group Sale访问此插件。第一次使用此插件需要填写注册信息，都是免费的了，就费心填下吧，填完会发送欢迎信息到你的邮箱。然后就可以添加编辑团购商品了。</p>
<p>团购商品会显示在原商品的分类页面，如下图。所以如果搞团购就新建个团购分类，好将所有的团购商品集中到一起。</p>
<div id="attachment_1796" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-group-sale-1.jpg"><img class="size-large wp-image-1796" title="magento团购插件" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/magento-group-sale-1-600x627.jpg" alt="magento团购插件" width="600" height="627" /></a><p class="wp-caption-text">magento团购插件</p></div>
<p><span id="more-1792"></span></p>
<p>转载表明出处：www.hellokeykey.com</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%9b%a2%e8%b4%ad%e6%8f%92%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento运输方式的设置</title>
		<link>http://www.magentochinese.org/magento%e8%bf%90%e8%be%93%e6%96%b9%e5%bc%8f%e7%9a%84%e8%ae%be%e7%bd%ae/</link>
		<comments>http://www.magentochinese.org/magento%e8%bf%90%e8%be%93%e6%96%b9%e5%bc%8f%e7%9a%84%e8%ae%be%e7%bd%ae/#comments</comments>
		<pubDate>Sat, 07 May 2011 16:40:02 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文视频]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento视频]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1785</guid>
		<description><![CDATA[本视频讲解如何设置Magento5运输方式,关于表运费见我博客文章：Magento表运费设置。本视频基于Magento 1.5版本录制，其余版本可能稍有不同。 更多中文视频见：Magento中文视频教程 &#160; 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1789" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/set-Magento-shipping-methods.png"><img class="size-large wp-image-1789" title="设置Magento物流" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/set-Magento-shipping-methods-600x279.png" alt="设置Magento物流" width="600" height="279" /></a><p class="wp-caption-text">设置Magento物流</p></div>
<p>本视频讲解如何设置Magento5运输方式,关于表运费见我博客文章：<a title="Magento表运费设置" href="http://www.hellokeykey.com/set-magento-table-rate/" >Magento表运费设置</a>。本视频基于Magento 1.5版本录制，其余版本可能稍有不同。</p>
<p><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/sid/XMjYxMzIxNzY4/v.swf" quality="high" allowscriptaccess="sameDomain" align="middle"></embed></p>
<p>更多中文视频见：<a title="Magento中文" href="http://www.hellokeykey.com/magento-chinese-tutorial-videos/" >Magento中文视频教程</a></p>
<p>&nbsp;</p>
<p><span id="more-1785"></span></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e8%bf%90%e8%be%93%e6%96%b9%e5%bc%8f%e7%9a%84%e8%ae%be%e7%bd%ae/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento批量生成优惠券</title>
		<link>http://www.magentochinese.org/magento%e6%89%b9%e9%87%8f%e7%94%9f%e6%88%90%e4%bc%98%e6%83%a0%e5%88%b8/</link>
		<comments>http://www.magentochinese.org/magento%e6%89%b9%e9%87%8f%e7%94%9f%e6%88%90%e4%bc%98%e6%83%a0%e5%88%b8/#comments</comments>
		<pubDate>Fri, 06 May 2011 08:55:51 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1774</guid>
		<description><![CDATA[使用Magento后台手动生成优惠券，效率太低了。如果生成1万个号码不一样的优惠券，还是要靠代码。 我来分享一段从互联网获得的批量生成优惠券的代码，如下： 此代码在Magento外部运行，所有使用了require_once(&#8216;app/Mage.php&#8217;); 此代码只是一个生成优惠券的演示，如果要实现具体的功能，还需要修改，但是有了这个demo就容易多了。 示例1： &#60;?php require_once('app/Mage.php'); Mage::app('default'); function generateUniqueId($length = null) { $rndId = crypt(uniqid(rand(),1)); $rndId = strip_tags(stripslashes($rndId)); $rndId = str_replace(array(".", "$"),"",$rndId); $rndId = strrev(str_replace("/","",$rndId)); if (!is_null($rndId)){ return strtoupper(substr($rndId, 0, $length)); } return strtoupper($rndId); } /* create unique coupan code */ for($cc = 0 ; $cc&#60;15 ; $cc++){ $productId = 297;//(int) $this-&#62;getRequest()-&#62;getParam('id'); $discountprice= 1;//$_POST['product']['discountprice']; [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1778" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/05/create-mass-magento-coupons.jpg"><img class="size-full wp-image-1778" title="批量生成Magento优惠券" src="http://www.hellokeykey.com/wp-content/uploads/2011/05/create-mass-magento-coupons.jpg" alt="批量生成Magento优惠券" width="600" height="303" /></a><p class="wp-caption-text">批量生成Magento优惠券</p></div>
<p>使用Magento后台手动生成优惠券，效率太低了。如果生成1万个号码不一样的优惠券，还是要靠代码。</p>
<p>我来分享一段从互联网获得的批量生成优惠券的代码，如下：</p>
<p>此代码在Magento外部运行，所有使用了require_once(&#8216;app/Mage.php&#8217;); 此代码只是一个生成优惠券的演示，如果要实现具体的功能，还需要修改，但是有了这个demo就容易多了。</p>
<p>示例1：</p>
<pre class="brush:php">&lt;?php
require_once('app/Mage.php');
Mage::app('default');
function generateUniqueId($length = null)
    {
        $rndId = crypt(uniqid(rand(),1));
        $rndId = strip_tags(stripslashes($rndId));
        $rndId = str_replace(array(".", "$"),"",$rndId);
        $rndId = strrev(str_replace("/","",$rndId));
            if (!is_null($rndId)){
            return strtoupper(substr($rndId, 0, $length));
            }
        return strtoupper($rndId);
    }
    /* create unique coupan code */
    for($cc = 0 ; $cc&lt;15 ; $cc++){
        $productId  = 297;//(int) $this-&gt;getRequest()-&gt;getParam('id');
        $discountprice= 1;//$_POST['product']['discountprice'];
        $model = Mage::getModel('salesrule/rule');
        $couponCode=generateUniqueId(8);
        $model-&gt;setName($couponCode);
        $model-&gt;setDescription('Discount coupon for Surger.');
        $model-&gt;setUsesPerCoupon(1);
        $model-&gt;setUsesPerCustomer(1);
        $model-&gt;setCustomerGroupIds('0,1');
        $model-&gt;setIsActive(1);
       // $model-&gt;setConditionsSerialized('a:6:{s:4:\"type\";s:32:\"salesrule/rule_condition_combine\";s:9:\"attribute\";N;s:8:\"operator\";N;s:5:\"value\";s:1:\"1\";s:18:\"is_value_processed\";N;s:10:\"aggregator\";s:3:\"all\";}');
        //$model-&gt;setActionsSerialized('a:6:{s:4:\"type\";s:40:\"salesrule/rule_condition_product_combine\";s:9:\"attribute\";N;s:8:\"operator\";N;s:5:\"value\";s:1:\"1\";s:18:\"is_value_processed\";N;s:10:\"aggregator\";s:3:\"all\";}');
        $model-&gt;setStopRulesProcessing(0);
        $model-&gt;setIsAdvanced(1);
       // $model-&gt;setProductIds($productId);
        $model-&gt;setSortOrder('0');
        $model-&gt;setSimpleAction('by_percent');
        $model-&gt;setDiscountAmount($discountprice);
        $model-&gt;setDiscountStep(0);
        $model-&gt;setSimpleFreeShipping(0);
        $model-&gt;setCouponType(2);
        $model-&gt;setCouponCode($couponCode);
        $model-&gt;setUsesPerCoupon(1);
        $model-&gt;setTimesUsed(0);
        $model-&gt;setIsRss(0);
        $model-&gt;setWebsiteIds('1');
        $model-&gt;save();
	}
echo 'ok';</pre>
<p>&nbsp;</p>
<p>//获得Magento优惠券的数据结构可以使用</p>
<pre class="brush:php">$coupon = Mage::getModel('salesrule/rule')-&gt;load(1);
echo '&lt;pre&gt;';
print_r($coupon-&gt;getData());
echo '&lt;/pre&gt;';</pre>
<p><span id="more-1774"></span>示例2：</p>
<pre class="brush:php">$coupon = Mage::getModel('salesrule/rule');
    $coupon-&gt;setName('test coupon')
    -&gt;setDescription('this is a description')
    -&gt;setFromDate('2010-05-09')
    -&gt;setCouponCode('CODENAME')
    -&gt;setUsesPerCoupon(1)
    -&gt;setUsesPerCustomer(1)
    -&gt;setCustomerGroupIds(array(1)) //an array of customer grou pids
    -&gt;setIsActive(1)
    //serialized conditions.  the following examples are empty
    -&gt;setConditionsSerialized('a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}')
    -&gt;setActionsSerialized('a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}')
    -&gt;setStopRulesProcessing(0)
    -&gt;setIsAdvanced(1)
    -&gt;setProductIds('')
    -&gt;setSortOrder(0)
    -&gt;setSimpleAction('by_percent')
    -&gt;setDiscountAmount(10)
    -&gt;setDiscountQty(null)
    -&gt;setDiscountStep('0')
    -&gt;setSimpleFreeShipping('0')
    -&gt;setApplyToShipping('0')
    -&gt;setIsRss(0)
    -&gt;setWebsiteIds(array(1));
    $coupon-&gt;save();</pre>
<p>此文参考文章地址：<a title="Magento create coupon by code" href="http://stackoverflow.com/questions/4030887/magento-discount-coupan-code-created-on-fly-but-not-working-properly/5894834#5894834" >http://stackoverflow.com/questions/4030887/magento-discount-coupan-code-created-on-fly-but-not-working-properly/5894834#5894834</a><br />
<a title="magento create coupon by code" href="http://blog.leoware.com/magento/coupons-in-magento-part-2.html" >http://blog.leoware.com/magento/coupons-in-magento-part-2.html</a></p>
<p><a title="magento create coupon by code" href="http://blog.leoware.com/magento/coupons-in-magento-part-2.html" ></a><a href="http://alanstorm.com/magento_model_generation">http://alanstorm.com/magento_model_generation</a><br />
转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e6%89%b9%e9%87%8f%e7%94%9f%e6%88%90%e4%bc%98%e6%83%a0%e5%88%b8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento安装网址验证报警</title>
		<link>http://www.magentochinese.org/magento%e5%ae%89%e8%a3%85%e7%bd%91%e5%9d%80%e9%aa%8c%e8%af%81%e6%8a%a5%e8%ad%a6/</link>
		<comments>http://www.magentochinese.org/magento%e5%ae%89%e8%a3%85%e7%bd%91%e5%9d%80%e9%aa%8c%e8%af%81%e6%8a%a5%e8%ad%a6/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 04:50:24 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento安装]]></category>
		<category><![CDATA[magento安装环境]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1708</guid>
		<description><![CDATA[Magento安装的时候，在数据库初始化页面，遇到如下错误提示 The URL &#8220;http://xxx.xxxx.com/&#8221; is invalid. Response from server isn&#8217;t valid. 这个是因为你的Magento安装网址配置有误造成的，请检查你的服务器的域名网址配置信息。当然了，我们可以跳过这个网址的验证，但是如果是在正式运营环境，一定要确保不出现此错误提示。 跳过magento此错误报警的办法就是，如上图，勾选箭头指示的地方“Skip Base URL validation before next step”。就是跳过URL的验证。 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1712" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-install-3.jpg"><img class="size-full wp-image-1712" title="magento安装网址验证错误" src="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-install-3.jpg" alt="magento安装网址验证错误" width="600" height="677" /></a><p class="wp-caption-text">magento安装网址验证错误</p></div>
<p>Magento安装的时候，在数据库初始化页面，遇到如下错误提示</p>
<p>The URL &#8220;http://xxx.xxxx.com/&#8221; is invalid.<br />
Response from server isn&#8217;t valid.</p>
<p>这个是因为你的Magento安装网址配置有误造成的，请检查你的服务器的域名网址配置信息。当然了，我们可以跳过这个网址的验证，但是如果是在正式运营环境，一定要确保不出现此错误提示。</p>
<p>跳过magento此错误报警的办法就是，如上图，勾选箭头指示的地方“Skip Base URL validation before next step”。就是跳过URL的验证。</p>
<p><span id="more-1708"></span></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%ae%89%e8%a3%85%e7%bd%91%e5%9d%80%e9%aa%8c%e8%af%81%e6%8a%a5%e8%ad%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Magento Api给产品添加图片</title>
		<link>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8magento-api%e7%bb%99%e4%ba%a7%e5%93%81%e6%b7%bb%e5%8a%a0%e5%9b%be%e7%89%87/</link>
		<comments>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8magento-api%e7%bb%99%e4%ba%a7%e5%93%81%e6%b7%bb%e5%8a%a0%e5%9b%be%e7%89%87/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 03:36:52 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1697</guid>
		<description><![CDATA[magento的Api默认就有更新产品图片的功能，今天将我自己测试的代码共享下，供大家学习参考。本次使用magento 1.5版Api,其它版本可能稍有不同。 代码片段如下： //省略初始化Api过程，见我的其余magento API文章 www.hellokeykey.com // 产品图片 // 初始化产品图片信息，注意自己上传个产品图片到magento的产品图片文件夹 // $imagePath为图片路径，如果你使用相对路径，注意测试下是正确 // label为图片的alt属性 // position 为图片的显示顺序 // type 为此图片作为'thumbnail','small_image','image'中的哪一个 // mime为图片类型 $imagePath = "http://www.......magento/media/catalog/product/h/t/htc-touch-diamond.jpg"; //产品图片路径 $newImage = array( 'file' =&#62; array( 'name' =&#62; 'file_name', 'content' =&#62; base64_encode(file_get_contents($imagePath)), 'mime' =&#62; 'image/jpeg' ), 'label' =&#62; 'Cool Image Through Soap', 'position' =&#62; 1, 'types' =&#62; array('thumbnail', 'small_image', [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1698" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-api-update-product-images.jpg"><img class="size-full wp-image-1698" title="magento api update product images" src="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-api-update-product-images.jpg" alt="magento api update product images" width="600" height="315" /></a><p class="wp-caption-text">magento api update product images</p></div>
<p>magento的Api默认就有更新产品图片的功能，今天将我自己测试的代码共享下，供大家学习参考。本次使用magento 1.5版Api,其它版本可能稍有不同。</p>
<p>代码片段如下：</p>
<pre class="brush:php">//省略初始化Api过程，见我的其余magento API文章 www.hellokeykey.com
//        产品图片
//        初始化产品图片信息，注意自己上传个产品图片到magento的产品图片文件夹
//        $imagePath为图片路径，如果你使用相对路径，注意测试下是正确
//        label为图片的alt属性
//        position 为图片的显示顺序
//        type 为此图片作为'thumbnail','small_image','image'中的哪一个
//        mime为图片类型
        $imagePath = "http://www.......magento/media/catalog/product/h/t/htc-touch-diamond.jpg";  //产品图片路径
        $newImage = array(
            'file' =&gt; array(
                'name' =&gt; 'file_name',
                'content' =&gt; base64_encode(file_get_contents($imagePath)),
                'mime' =&gt; 'image/jpeg'
            ),
            'label' =&gt; 'Cool Image Through Soap',
            'position' =&gt; 1,
            'types' =&gt; array('thumbnail', 'small_image', 'image'),
            'exclude' =&gt; 0
        );
//使用 Api创建产品图片
$imageFilename = $client-&gt;call($session, 'product_media.create', array($sku, $newImage))</pre>
<p><span id="more-1697"></span></p>
<p>官网文章请参考：<a title="Magento Product Images API" href="http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute_media#catalog_product_attribute_media.currentstore" >Magento Product image Api</a></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/%e4%bd%bf%e7%94%a8magento-api%e7%bb%99%e4%ba%a7%e5%93%81%e6%b7%bb%e5%8a%a0%e5%9b%be%e7%89%87/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento设置paypal等支付方式</title>
		<link>http://www.magentochinese.org/magento%e8%ae%be%e7%bd%aepaypal%e7%ad%89%e6%94%af%e4%bb%98%e6%96%b9%e5%bc%8f/</link>
		<comments>http://www.magentochinese.org/magento%e8%ae%be%e7%bd%aepaypal%e7%ad%89%e6%94%af%e4%bb%98%e6%96%b9%e5%bc%8f/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 15:28:07 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文视频]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento视频]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1679</guid>
		<description><![CDATA[此讲使用magento1.5版本，其它版本可能稍有不同，主要介绍了如何设置paypal的网站标准支付方式，也是paypal应用最广，门槛最低的支付方式。也讲到了其它支付方式设置的注意事项。中文视频如下： &#160; 更多magento中文视频：http://www.hellokeykey.com/magento-chinese-tutorial-videos/ 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<p>此讲使用magento1.5版本，其它版本可能稍有不同，主要介绍了如何设置paypal的网站标准支付方式，也是paypal应用最广，门槛最低的支付方式。也讲到了其它支付方式设置的注意事项。中文视频如下：</p>
<p><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/sid/XMjYxMzI1MzA4/v.swf" quality="high" allowscriptaccess="sameDomain" align="middle"></embed></p>
<p>&nbsp;</p>
<p><span id="more-1679"></span></p>
<p>更多magento中文视频：http://www.hellokeykey.com/magento-chinese-tutorial-videos/</p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e8%ae%be%e7%bd%aepaypal%e7%ad%89%e6%94%af%e4%bb%98%e6%96%b9%e5%bc%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento删除订单插件</title>
		<link>http://www.magentochinese.org/magento%e5%88%a0%e9%99%a4%e8%ae%a2%e5%8d%95%e6%8f%92%e4%bb%b6/</link>
		<comments>http://www.magentochinese.org/magento%e5%88%a0%e9%99%a4%e8%ae%a2%e5%8d%95%e6%8f%92%e4%bb%b6/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 15:41:41 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento插件]]></category>
		<category><![CDATA[magento教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1668</guid>
		<description><![CDATA[今天我的客户需要我删除测试时候的magento订单，一般我都是去数据库删除订单（见此文章：http://inchoo.net/ecommerce/magento/delete-test-orders-in-magento/）。已经早就有人写好了删除magento订单的插件，此插件可以在订单管理页面选择删除订单。 插件官网地址：http://www.magentocommerce.com/extension/specs/4562/em_deleteorder magento connect 安装key为： Magento Connect Version 1.0 : magento-community/EM_DeleteOrder Magento Connect Version 2.0 : http://connect20.magentocommerce.com/community/EM_DeleteOrder 此插件是免费版，目前支持magento版本有1.4.1.1, 1.4.2, 1.5。 当你在安装插件前请备份好你的数据库，以免此插件有bug。我测试了下，没有什么问题。 &#160; 转载表明出处：www.hellokeykey.com]]></description>
			<content:encoded><![CDATA[<div id="attachment_1669" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-delect-order.gif"><img class="size-full wp-image-1669" title="magento删除订单" src="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-delect-order.gif" alt="magento删除订单" width="600" height="353" /></a><p class="wp-caption-text">magento删除订单</p></div>
<p>今天我的客户需要我删除测试时候的magento订单，一般我都是去数据库删除订单（见此文章：http://inchoo.net/ecommerce/magento/delete-test-orders-in-magento/）。已经早就有人写好了删除magento订单的插件，此插件可以在订单管理页面选择删除订单。<br />
插件官网地址：<a title="magento删除订单插件" href="http://www.magentocommerce.com/extension/specs/4562/em_deleteorder" >http://www.magentocommerce.com/extension/specs/4562/em_deleteorder</a><br />
magento connect 安装key为：<br />
Magento Connect Version 1.0 :  magento-community/EM_DeleteOrder<br />
Magento Connect Version 2.0 :  http://connect20.magentocommerce.com/community/EM_DeleteOrder<br />
此插件是免费版，目前支持magento版本有1.4.1.1, 1.4.2, 1.5。<br />
当你在安装插件前请备份好你的数据库，以免此插件有bug。我测试了下，没有什么问题。</p>
<p>&nbsp;</p>
<p><span id="more-1668"></span></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%88%a0%e9%99%a4%e8%ae%a2%e5%8d%95%e6%8f%92%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何使用Magento Api创建Simple Product</title>
		<link>http://www.magentochinese.org/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8magento-api%e5%88%9b%e5%bb%basimple-product/</link>
		<comments>http://www.magentochinese.org/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8magento-api%e5%88%9b%e5%bb%basimple-product/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 05:51:40 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[聚合]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1661</guid>
		<description><![CDATA[我最近看了下Magento的Api，尝试了下如何使用magento的Api来创建simple product。Magento本身的Api功能还是很有限的，要是做二次开发，那就必须要扩充下。希望官方可以增加Api的功能，我们就省心了。Magento的Api执行速度不快，使用多任务的Call速度就还算是满意。当然这个和服务器的优良是有关系的。我在simplehelix.com 服务器上的Magento，大概是7.2秒创建1000为新用户，速度还是可以接受的。 下面我来分享下使用Magento Api创建普通商品的代码，以供初学者学习参考。当然其中的必要几处参数，要根据自己的Magento状况来修改。我这个里面列举了非常多的参数，是目前互联网上参数说明最详细的了吧。 &#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&#62; &#60;title&#62;来自www.hellokeykey.com&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;?php //初始化magento的api连接 $client = new SoapClient('http://www.hillkey.com/api/soap/?wsdl'); $session = $client-&#62;login('apiuser', 'apikey'); echo "&#60;br /&#62;"; echo "session:" . $session; echo "&#60;br /&#62;"; $product_type = "simple"; $product_name = "iPhone" . rand(); //产品名称 $product_sku = "happigo001" . [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1662" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-api-create-simple-product.jpg"><img class="size-full wp-image-1662" title="如何使用magento api创建simple product" src="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-api-create-simple-product.jpg" alt="如何使用magento api创建simple product" width="600" height="212" /></a><p class="wp-caption-text">如何使用magento api创建simple product</p></div>
<p>我最近看了下Magento的Api，尝试了下如何使用magento的Api来创建simple product。Magento本身的Api功能还是很有限的，要是做二次开发，那就必须要扩充下。希望官方可以增加Api的功能，我们就省心了。Magento的Api执行速度不快，使用多任务的Call速度就还算是满意。当然这个和服务器的优良是有关系的。我在<a title="SIMPLEHELIX" href="https://www.simplehelix.com/hosting/aff.php?aff=287" >simplehelix.com</a> 服务器上的Magento，大概是7.2秒创建1000为新用户，速度还是可以接受的。</p>
<p>下面我来分享下使用Magento Api创建普通商品的代码，以供初学者学习参考。当然其中的必要几处参数，要根据自己的Magento状况来修改。我这个里面列举了非常多的参数，是目前互联网上参数说明最详细的了吧。</p>
<pre class="brush:php">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
        &lt;title&gt;来自www.hellokeykey.com&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;

        &lt;?php
//初始化magento的api连接
        $client = new SoapClient('http://www.hillkey.com/api/soap/?wsdl');
        $session = $client-&gt;login('apiuser', 'apikey');
        echo "&lt;br /&gt;";
        echo "session:" . $session;
        echo "&lt;br /&gt;";
        $product_type = "simple";
        $product_name = "iPhone" . rand();   //产品名称
        $product_sku = "happigo001" . rand();   //产品货号
        $product_des = "description";   //产品描述
        $product_sdes = "short description"; //产品简短描述
        $product_price = 100;  //产品价格
        $product_status = "1"; //产品状态，1为激活，0为不激活
        $product_website = array(1); //产品属于哪个website
        $product_category_id[0] = 10; //产品所属分类ID
        $product_weight = "500";  //商品重量
        $product_news_from_date = "2011-04-01 00:00:00"; //产品新品开始日期
        $product_news_to_date = "2011-04-30 00:00:00"; //产品新品结束日期
        $product_tax_class_id = "0"; //产品税的设置
        $product_visibility = "4"; //产品可见的设置
//        $product_url_path = "test111"; //产品url    不管用，使用url_key
        $product_url_key = $product_name;   //此值有空格的话，会自动换成横线，不错，省的处理了
        $product_cost = "90";  //商品成本
        $product_special_price = "95";  //商品特价价格
        $product_special_from_date = "2011-04-01 00:00:00";  //特价开始日期
        $product_special_to_date = "2011-05-01 00:00:00";  //特价结束日期
        $product_is_in_stock = "1"; //是否有库存
        $product_qty = 100;  //库存数量
        $product_manage_stock = "1"; //manage_stock 状态
        $product_enable_googlecheckout = "0"; //是否支持google支付
        $product_custom_design = "default/modern"; //设置使用哪个模板主题
        $product_custom_layout_update = '&lt;reference name="left"&gt;
            &lt;block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml"&gt;
                &lt;action method="setImgSrc"&gt;&lt;src&gt;images/media/col_left_callout.jpg&lt;/src&gt;&lt;/action&gt;
                &lt;action method="setImgAlt" translate="alt" module="catalog"&gt;&lt;alt&gt;Our customer service is available 24/7. Call us at (555) 555-0123.&lt;/alt&gt;&lt;/action&gt;
                &lt;action method="setLinkUrl"&gt;&lt;url&gt;checkout/cart&lt;/url&gt;&lt;/action&gt;
            &lt;/block&gt;
&lt;/reference&gt;'; // layout xml
        $product_custom_design_from = "2011-04-01 00:00:00"; //模板启用日期
        $product_custom_design_to = "2011-05-01 00:00:00"; //模板启用日期
        $product_page_layout = "two_columns_right"; //模板结构
        $product_gift_message_available = "1"; //是否允许礼物留言
        $attribute_set = "9"; // 这个是属性组，属性组是
        $imagePath = "http://www.hillkey.com/media/catalog/product/h/t/htc-touch-diamond.jpg";  //产品图片路径
//        产品的数据数组
        $newProductData = array(
            'name' =&gt; $product_name,
            'websites' =&gt; $product_website,
            'short_description' =&gt; $product_sdes,
            'description' =&gt; $product_des,
            'price' =&gt; $product_price,
            'status' =&gt; $product_status,
            'weight' =&gt; $product_weight,
            'news_from_date' =&gt; $product_news_from_date,
            'news_to_date' =&gt; $product_news_to_date,
            'tax_class_id' =&gt; $product_tax_class_id,
            'visibility' =&gt; $product_visibility,
            'url_key' =&gt; $product_name,
            'cost' =&gt; $product_cost,
            'special_price' =&gt; $product_special_price,
            'special_from_date' =&gt; $product_special_from_date,
            'special_to_date' =&gt; $product_special_to_date,
            'enable_googlecheckout' =&gt; $product_enable_googlecheckout,
            'custom_design' =&gt; $product_custom_design,
            'custom_layout_update' =&gt; $product_custom_layout_update,
            'page_layout' =&gt; $product_page_layout,
            'custom_design_from' =&gt; $product_custom_design_from,
            'custom_design_to' =&gt; $product_custom_design_to,
            'gift_message_available' =&gt; $product_gift_message_available,
        );
//        产品图片
//        初始化产品图片信息，注意自己上传个产品图片到magento的产品图片文件夹
//        label为图片的alt属性
//        position 为图片的显示顺序
//        type 为此图片作为'thumbnail','small_image','image'中的哪一个
//        mime为图片类型

        $newImage = array(
            'file' =&gt; array(
                'name' =&gt; 'file_name',
                'content' =&gt; base64_encode(file_get_contents($imagePath)),
                'mime' =&gt; 'image/jpeg'
            ),
            'label' =&gt; 'Cool Image Through Soap',
            'position' =&gt; 1,
            'types' =&gt; array('thumbnail', 'small_image', 'image'),
            'exclude' =&gt; 0
        );
//            array(
//                'file' =&gt; array(
//                    'name' =&gt; 'file_name',
//                    'content' =&gt; base64_encode(file_get_contents('/media/catalog/product/m/o/model.jpg')),
//                    'mime' =&gt; 'image/jpeg'
//                ),
//                'label' =&gt; 'Cool Image Through Soap',
//                'position' =&gt; 2,
//                'types' =&gt; array('small_image'),
//                'exclude' =&gt; 0
//            )
//        print_r($newImage);
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;New product Info:&lt;/p&gt;';
        echo "New product NO.:" . $client-&gt;call($session, 'product.create', array($product_type, $attribute_set, $product_sku, $newProductData));
        echo "&lt;br /&gt;";
//        使用api创建一个商品（本代码来自www.hellokeykey.com）
        $see_new_product_info = $client-&gt;call($session, 'product.info', $product_sku);
//        更新商品的库存信息
        $client-&gt;call($session, 'product_stock.update', array($product_sku, array('manage_stock' =&gt; $product_manage_stock, 'qty' =&gt; $product_qty, 'is_in_stock' =&gt; "1")));
//        设置商品分类
        $client-&gt;call($session, 'category.assignProduct', array($product_category_id, $product_sku, 1));
//        创建产品图片，注意是先有产品后添加图片的
        $imageFilename = $client-&gt;call($session, 'product_media.create', array($product_sku, $newImage));
        //输出刚创建的产品信息
        $see_new_product_info = $client-&gt;call($session, 'product.info', $product_sku);
        var_dump($see_new_product_info);
        echo "&lt;p&gt;stock:";
//        输出库存信息
        var_dump($client-&gt;call($session, 'product_stock.list', $product_sku));
        echo "&lt;/p&gt;&lt;br /&gt;";
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;New Product Image info:&lt;/p&gt;';
        var_dump($client-&gt;call($session, 'product_media.list', $product_sku));
//        $attributeSets = $attributeSets[1];
//        $attributeSet_ID = array_search('Default',$attributeSets);
//        echo "&lt;br /&gt;";
//        echo "Default AttributeSet ID;".$attributeSet_ID;
//        $set = current($attributeSets);
//        以下为示例输出，一个是输出现有的属性组以及代码。然后是输出一个magento simple product产品，自己后台新建一个产品，将此产品的属性填写完整，好输出来分析下各个属性值的特点，与自己要创建的坐下对比
        $attributeSets = $client-&gt;call($session, 'product_attribute_set.list');
        $attributes = $client-&gt;call($session, 'product_attribute.list','40');
        $attribute_options = $client-&gt;call($session, 'product_attribute.options', array('attribute_id'=&gt;'502'));
//        $set = current($attributeSets);
//        $attributes = $client-&gt;call($session, 'product_attribute.list', $set['set_id']);
//        var_dump($attributes);
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;Attribute Sets:&lt;/p&gt;';
        var_dump($attributeSets);
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;Attribute Set of shoes:&lt;/p&gt;';
        var_dump($attributes);
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;Attribute shoes_size:&lt;/p&gt;';
        var_dump($attribute_options);
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;Product Date:&lt;/p&gt;';
//        echo "&lt;br /&gt;set&lt;br /&gt;";
//        var_dump($set);
        $sku_of_product = "HTC Touch Diamond";
        $p_info = $client-&gt;call($session, 'product.info', $sku_of_product);
        var_dump($p_info);
        echo "&lt;p&gt;stock:";
        var_dump($client-&gt;call($session, 'product_stock.list', $sku_of_product));
        echo "&lt;/p&gt;&lt;br /&gt;";
        echo "&lt;br /&gt;";
        echo '&lt;p style="color:#FFFFFF; background-color:#999999; padding:10px;"&gt;Product Image info:&lt;/p&gt;';
        var_dump($client-&gt;call($session, 'product_media.list', $sku_of_product));
//        $attribute_options = $client-&gt;call($session, 'product_attribute.options', array('attribute_id'=&gt;'put_attribute_id_as_int_here'));
//var_dump($attribute_options);
        ?&gt;

        &lt;?php $client-&gt;endSession($session); ?&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p><span id="more-1661"></span></p>
<p>转载标明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8magento-api%e5%88%9b%e5%bb%basimple-product/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento后台生成google网站地图sitemap.xml</title>
		<link>http://www.magentochinese.org/magento%e5%90%8e%e5%8f%b0%e7%94%9f%e6%88%90google%e7%bd%91%e7%ab%99%e5%9c%b0%e5%9b%besitemap-xml/</link>
		<comments>http://www.magentochinese.org/magento%e5%90%8e%e5%8f%b0%e7%94%9f%e6%88%90google%e7%bd%91%e7%ab%99%e5%9c%b0%e5%9b%besitemap-xml/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 14:06:02 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文视频]]></category>
		<category><![CDATA[magento使用教程]]></category>
		<category><![CDATA[magento视频]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1629</guid>
		<description><![CDATA[说是生成google网站地图sitemap.xml,其实此sitemap.xml文件是大多数搜索引擎，如百度，雅虎，必应都支持的。通过相应的提交网址，将网站地图提交给搜索引擎，以帮助网站被尽快的收录。本视频]]></description>
			<content:encoded><![CDATA[<p>说是生成google网站地图sitemap.xml,其实此sitemap.xml文件是大多数搜索引擎，如百度，雅虎，必应都支持的。通过相应的提交网址，将网站地图提交给搜索引擎，以帮助网站被尽快的收录。本视频使用magento1.5版本讲解，其它版本可能稍有不同。<br />
<embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/sid/XMjU2ODE4ODM2/v.swf" align="middle" allowscriptaccess="sameDomain" quality="high"></embed></p>
<p><span id="more-1629"></span></p>
<p>更多中文视频见：<a href="http://www.hellokeykey.com/magento-chinese-tutorial-videos/">http://www.hellokeykey.com/magento-chinese-tutorial-videos/</a></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%90%8e%e5%8f%b0%e7%94%9f%e6%88%90google%e7%bd%91%e7%ab%99%e5%9c%b0%e5%9b%besitemap-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento使用代码创建订单</title>
		<link>http://www.magentochinese.org/magento%e4%bd%bf%e7%94%a8%e4%bb%a3%e7%a0%81%e5%88%9b%e5%bb%ba%e8%ae%a2%e5%8d%95/</link>
		<comments>http://www.magentochinese.org/magento%e4%bd%bf%e7%94%a8%e4%bb%a3%e7%a0%81%e5%88%9b%e5%bb%ba%e8%ae%a2%e5%8d%95/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 07:27:11 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wiki]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1572</guid>
		<description><![CDATA[首先感谢inchoo的文章：Programmatically create order in Magento 但此文章的方法有点复杂。于是见其下面的评论， Vinai 出场了，见：http://pastebin.com/8cft4d8v  终于，我找到了想要的代码。 代码分享如下 &#60;?php require_once 'app/Mage.php'; Mage::app(); $quote = Mage::getModel('sales/quote') -&#62;setStoreId(Mage::app()-&#62;getStore('default')-&#62;getId()); if (1) { // for customer orders: $customer = Mage::getModel('customer/customer') -&#62;setWebsiteId(1) -&#62;loadByEmail('493835927@qq.com'); $quote-&#62;assignCustomer($customer); } else { // for guesr orders only: $quote-&#62;setCustomerEmail('customer@example.com'); } // add product(s) $product = Mage::getModel('catalog/product')-&#62;load(166); $buyInfo = array( 'qty' =&#62; 1, // custom option [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1573" class="wp-caption alignnone" style="width: 610px"><a href="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-create-order.jpg"><img class="size-full wp-image-1573" title="magento代码创建订单" src="http://www.hellokeykey.com/wp-content/uploads/2011/04/magento-create-order.jpg" alt="magento代码创建订单" width="600" height="239" /></a><p class="wp-caption-text">magento代码创建订单</p></div>
<p>首先感谢inchoo的文章：<a title="magento创建订单" href="http://inchoo.net/ecommerce/magento/programmatically-create-order-in-magento" >Programmatically create order in Magento</a> 但此文章的方法有点复杂。于是见其下面的评论， <cite><a rel="external nofollow" href="http://netzarbeiter.com/">Vinai</a> </cite>出场了，见：http://pastebin.com/8cft4d8v  终于，我找到了想要的代码。</p>
<p>代码分享如下</p>
<pre class="brush:php">&lt;?php

require_once 'app/Mage.php';

Mage::app();

$quote = Mage::getModel('sales/quote')
	-&gt;setStoreId(Mage::app()-&gt;getStore('default')-&gt;getId());

if (1) {
	// for customer orders:
	$customer = Mage::getModel('customer/customer')
		-&gt;setWebsiteId(1)
		-&gt;loadByEmail('493835927@qq.com');
	$quote-&gt;assignCustomer($customer);
} else {
	// for guesr orders only:
	$quote-&gt;setCustomerEmail('customer@example.com');
}

// add product(s)
$product = Mage::getModel('catalog/product')-&gt;load(166);
$buyInfo = array(
	'qty' =&gt; 1,
	// custom option id =&gt; value id
	// or
	// configurable attribute id =&gt; value id
);
$quote-&gt;addProduct($product, new Varien_Object($buyInfo));

$addressData = array(
	'firstname' =&gt; 'Test',
	'lastname' =&gt; 'Test',
	'street' =&gt; 'Sample Street 10',
	'city' =&gt; 'Somewhere',
	'postcode' =&gt; '123456',
	'telephone' =&gt; '123456',
	'country_id' =&gt; 'US',
	'region_id' =&gt; 12, // id from directory_country_region table
);

$billingAddress = $quote-&gt;getBillingAddress()-&gt;addData($addressData);
$shippingAddress = $quote-&gt;getShippingAddress()-&gt;addData($addressData);

$shippingAddress-&gt;setCollectShippingRates(true)-&gt;collectShippingRates()
		-&gt;setShippingMethod('flatrate_flatrate')
		-&gt;setPaymentMethod('checkmo');

$quote-&gt;getPayment()-&gt;importData(array('method' =&gt; 'checkmo'));

$quote-&gt;collectTotals()-&gt;save();

$service = Mage::getModel('sales/service_quote', $quote);
$service-&gt;submitAll();
$order = $service-&gt;getOrder();

printf("Created order %s\n", $order-&gt;getIncrementId());</pre>
<p><span id="more-1572"></span></p>
<p>如上 为我自己做测试时使用的代码，设置上了必要的参数。请按照你的magento环境设置相应的参数。详情见我开始提到的原代码出处。</p>
<p>转载标明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e4%bd%bf%e7%94%a8%e4%bb%a3%e7%a0%81%e5%88%9b%e5%bb%ba%e8%ae%a2%e5%8d%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento添加产品分类</title>
		<link>http://www.magentochinese.org/magento%e6%b7%bb%e5%8a%a0%e4%ba%a7%e5%93%81%e5%88%86%e7%b1%bb/</link>
		<comments>http://www.magentochinese.org/magento%e6%b7%bb%e5%8a%a0%e4%ba%a7%e5%93%81%e5%88%86%e7%b1%bb/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 15:34:00 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文视频]]></category>
		<category><![CDATA[magento使用教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1558</guid>
		<description><![CDATA[本magento中文视频讲解如何添加一个分类到magento中，使用magento1.5版本，其它版本设置类似。


更多中文视频见：http://www.hellokeykey.com/magento-chinese-tutorial-videos/
转载表明出处：www.hellokeykey.com
]]></description>
			<content:encoded><![CDATA[<p>本magento中文视频讲解如何添加一个分类到magento中，使用magento1.5版本，其它版本设置类似。<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="src" value="http://player.youku.com/player.php/Type/Folder/Fid/5593162/Ob/1/Pt/6/sid/XMjUxMDk5OTM2/v.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/Type/Folder/Fid/5593162/Ob/1/Pt/6/sid/XMjUxMDk5OTM2/v.swf" quality="high" align="middle"></embed></object></p>
<p><span id="more-1558"></span></p>
<p>更多中文视频见：<a href="http://www.hellokeykey.com/magento-chinese-tutorial-videos/">http://www.hellokeykey.com/magento-chinese-tutorial-videos/</a></p>
<p>转载表明出处：www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e6%b7%bb%e5%8a%a0%e4%ba%a7%e5%93%81%e5%88%86%e7%b1%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>magento开启在线翻译功能</title>
		<link>http://www.magentochinese.org/magento%e5%bc%80%e5%90%af%e5%9c%a8%e7%ba%bf%e7%bf%bb%e8%af%91%e5%8a%9f%e8%83%bd/</link>
		<comments>http://www.magentochinese.org/magento%e5%bc%80%e5%90%af%e5%9c%a8%e7%ba%bf%e7%bf%bb%e8%af%91%e5%8a%9f%e8%83%bd/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 15:30:39 +0000</pubDate>
		<dc:creator>key</dc:creator>
				<category><![CDATA[聚合]]></category>
		<category><![CDATA[视频]]></category>
		<category><![CDATA[hellokeykey]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento中文视频]]></category>
		<category><![CDATA[magento使用教程]]></category>

		<guid isPermaLink="false">http://www.hellokeykey.com/?p=1556</guid>
		<description><![CDATA[本视频讲解如何使用magneto在线翻译功能，以用来弥补语言包的不足。本视频使用magento 1.5版本，其它版本设置类似。


更多中文视频见：http://www.hellokeykey.com/magento-chinese-tutorial-videos/
转载表明...]]></description>
			<content:encoded><![CDATA[<p>本视频讲解如何使用magneto在线翻译功能，以用来弥补语言包的不足。本视频使用magento 1.5版本，其它版本设置类似。</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="src" value="http://player.youku.com/player.php/Type/Folder/Fid/5593162/Ob/1/Pt/5/sid/XMjUwODY4NzQ0/v.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/Type/Folder/Fid/5593162/Ob/1/Pt/5/sid/XMjUwODY4NzQ0/v.swf" quality="high" align="middle"></embed></object></p>
<p><span id="more-1556"></span></p>
<p>更多中文视频见：<a href="http://www.hellokeykey.com/magento-chinese-tutorial-videos/">http://www.hellokeykey.com/magento-chinese-tutorial-videos/</a></p>
<p>转载表明出处:www.hellokeykey.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.magentochinese.org/magento%e5%bc%80%e5%90%af%e5%9c%a8%e7%ba%bf%e7%bf%bb%e8%af%91%e5%8a%9f%e8%83%bd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

