<?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>Asia Connect Technology JSC &#187; Magento Tricks</title>
	<atom:link href="http://asia-connect.com.vn/tag/magento-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://asia-connect.com.vn</link>
	<description>The place for connecting you to the success</description>
	<lastBuildDate>Fri, 12 Mar 2010 03:49:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Adding a new language in Magento</title>
		<link>http://asia-connect.com.vn/2009/09/adding-a-new-language-in-magento/</link>
		<comments>http://asia-connect.com.vn/2009/09/adding-a-new-language-in-magento/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 02:08:09 +0000</pubDate>
		<dc:creator>lydh</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=838</guid>
		<description><![CDATA[
As anything in Magento adding a new language is something that requires a certain procedure which we will explain right now and for future reference.
 
Follow these easy steps and enjoy your multilingual site:

1. Download the desired translation thru Magento connect via admin.
2. Once installed Go to: System -&#62; Manage Stores -&#62; Create store view. Enter the data and save.
3. Now go to: Configuration -&#62; Current Configuration Scope (Select your language from the dropdown) and on the right side under “Locale options” choose the desired language.

Note: Be sure to clear ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/drupal-to-magento-integration-simple-link-tweak-with-multilingual-site/' rel='bookmark' title='Permanent Link: Drupal to Magento integration, simple link tweak with multilingual site'>Drupal to Magento integration, simple link tweak with multilingual site</a></li><li><a href='http://asia-connect.com.vn/2009/07/top-3-solutions-when-your-magento-categories-are-not-displaying/' rel='bookmark' title='Permanent Link: Top 3 Solutions when your Magento Categories are not displaying'>Top 3 Solutions when your Magento Categories are not displaying</a></li><li><a href='http://asia-connect.com.vn/2009/04/using-jquery-in-magento/' rel='bookmark' title='Permanent Link: Using jQuery in Magento'>Using jQuery in Magento</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img title="Adding a new language in Magento" src="http://inchoo.net/wp-content/uploads/2009/03/multilingual-magento.jpg" alt="Adding a new language in Magento" width="585" /></p>
<p>As anything in <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> adding a new language is something that requires a certain procedure which we will explain right now and for future reference.</p>
<p><span id="more-1151"> </span></p>
<p>Follow these easy steps and enjoy your multilingual site:</p>
<ul type="disc"><!-- bullet type: disc/square/circle--></p>
<li>1. Download the desired translation thru Magento connect via admin.</li>
<li>2. Once installed Go to: System -&gt; Manage Stores -&gt; Create store view. Enter the data and save.</li>
<li>3. Now go to: Configuration -&gt; Current Configuration Scope (Select your language from the dropdown) and on the right side under “Locale options” choose the desired language.</li>
</ul>
<blockquote><p>Note: Be sure to clear the cache before trying to use your new language.</p></blockquote>
<p>That’s it, now when you go to the frontend of the site, you’ll notice a dropdown menu allowing the language switching.</p>
<p>Did you clear the cache?</p>
<p style="text-align: right;"><em>By</em> <span>Željko Prša<em> from <a rel="nofollow" href="http://inchoo.net/ecommerce/magento/adding-a-new-language-in-magento/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');" target="_blank">Inchoo.net</a></em><br />
</span></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/drupal-to-magento-integration-simple-link-tweak-with-multilingual-site/' rel='bookmark' title='Permanent Link: Drupal to Magento integration, simple link tweak with multilingual site'>Drupal to Magento integration, simple link tweak with multilingual site</a></li><li><a href='http://asia-connect.com.vn/2009/07/top-3-solutions-when-your-magento-categories-are-not-displaying/' rel='bookmark' title='Permanent Link: Top 3 Solutions when your Magento Categories are not displaying'>Top 3 Solutions when your Magento Categories are not displaying</a></li><li><a href='http://asia-connect.com.vn/2009/04/using-jquery-in-magento/' rel='bookmark' title='Permanent Link: Using jQuery in Magento'>Using jQuery in Magento</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/09/adding-a-new-language-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add New Reference in Magento</title>
		<link>http://asia-connect.com.vn/2009/09/add-new-reference-in-magento/</link>
		<comments>http://asia-connect.com.vn/2009/09/add-new-reference-in-magento/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 02:52:53 +0000</pubDate>
		<dc:creator>lydh</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=833</guid>
		<description><![CDATA[
If you already performed some Magento research, you will know that it is built on a fully modular model that gives great scalability and flexibility for your store. While creating a theme, you are provided with many content blocks that you can place in structural blocks. If you are not sure what they are, please read Designer’s Guide to Magento first. Magento provides few structural blocks by default and many content blocks. This article tells what needs to be in place to create new structural block.
What are structural blocks?
They are ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/move-mini-cart-in-the-sidebar-to-the-header-or-anywhere-in-magento/' rel='bookmark' title='Permanent Link: Move mini-cart in the sidebar to the header (or anywhere) in Magento'>Move mini-cart in the sidebar to the header (or anywhere) in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/07/how-to-add-dynamic-content-to-magento-static-blocks-and-pages/' rel='bookmark' title='Permanent Link: How to Add Dynamic Content to Magento Static Blocks and Pages?'>How to Add Dynamic Content to Magento Static Blocks and Pages?</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img title="Add New Reference in Magento" src="http://inchoo.net/wp-content/uploads/2009/03/newreference-start.png" alt="Add New Reference in Magento" width="585" /></p>
<p>If you already performed some <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> research, you will know that it is built on a fully modular model that gives great scalability and flexibility for your store. While creating a theme, you are provided with many content blocks that you can place in structural blocks. If you are not sure what they are, please read <a rel="nofollow" title="Introdcution to Structural and Content Blocks" href="http://inchoo.net/ecommerce/magento/designers-guide-to-magento-pdf-download/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');">Designer’s Guide to Magento</a> first. Magento provides few structural blocks by default and many content blocks. This article tells what needs to be in place to create new <strong>structural block</strong>.</p>
<h2>What are structural blocks?</h2>
<p>They are the parent blocks of content blocks and serve to <em>position</em> its content blocks within a store page context. Take a look at the image below. These structural blocks exist in the forms of the header area, left column area, right column…etc. which serve to create the <em>visual structure</em> for a store page. Our goal is to create a new structural block called “newreference”.</p>
<p><img title="newreference" src="http://inchoo.net/wp-content/uploads/2009/03/newreference.png" alt="newreference" width="585" /></p>
<h3>Step 1: Name the structural block</h3>
<p>Open the file layout/page.xml in your active theme folder. Inside you will find lines like:</p>
<pre class="brush: html;">
&lt;block type=&quot;core/text_list&quot; name=&quot;left&quot; as=&quot;left&quot;/&gt;
&lt;block type=&quot;core/text_list&quot; name=&quot;content&quot; as=&quot;content&quot;/&gt;
&lt;block type=&quot;core/text_list&quot; name=&quot;right&quot; as=&quot;right&quot;/&gt;
</pre>
<p>Let’s mimic this and add a new line somewhere inside the same block tag.</p>
<pre class="brush: html;">
&lt;block type=&quot;core/text_list&quot; name=&quot;newreference&quot; as=&quot;newreference&quot;/&gt;
</pre>
<p>Good. Now we told Magento that new structural block exists with the name “newreference”. Magento still doesn’t know what to do with it.</p>
<h3>Step 2: Tell Magento where to place it</h3>
<p>We now need to point Magento where it should output this new structural block. Let’s go to template/page folder in our active theme folder. You will notice different layouts there. Let’s assume we want the new structural block to appear only on pages that use 2-column layout with right sidebar. In that case we should open <strong>2columns-right.phtml</strong> file.</p>
<p>Let’s assume we wish the “newreference” block to be placed below 2 columns, but above the footer. In this case, our updated file could look like this:</p>
<pre class="brush: php;">
&lt;!-- start middle --&gt;
&lt;div&gt;
&lt;div&gt;&lt; ?php getChildHtml('breadcrumbs') ?&gt;
&lt;!-- start center --&gt;
&lt;div id=&quot;main&quot;&gt;&lt;!-- start global messages --&gt;
&lt; ?php  getChildHtml('global_messages') ?&gt;
&lt;!-- end global messages --&gt;
&lt;!-- start content --&gt;
&lt; ?php  getChildHtml('content') ?&gt;
&lt;!-- end content --&gt;&lt;/div&gt;
&lt;!-- end center --&gt;

&lt;!-- start right --&gt;
&lt;div&gt;&lt; ?php getChildHtml('right') ?&gt;&lt;/div&gt;
&lt;!-- end right --&gt;&lt;/div&gt;
&lt;div&gt;&lt; ?php getChildHtml('newreference') ?&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;!-- end middle --&gt;
</pre>
<h3>Step 3: Populating structural block</h3>
<p>We have the block properly placed, but unfortunately nothing is new on the frontsite. Let’s populate the new block with something. We will put new products block there as an example. Go to appropriate layout XML file and add this block to appropriate place.</p>
<pre class="brush: html;">
&lt;reference name=&quot;newreference&quot;&gt;
&lt;block type=&quot;catalog/product_new&quot; name=&quot;home.product.new&quot; template=&quot;catalog/product/new.phtml&quot; /&gt;
&lt;/reference&gt;
</pre>
<p>That’s it. I hope it will help someone <img src="http://inchoo.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p style="text-align: right;"><em>By</em> <span>Tomislav Bilic </span><span style="text-decoration: underline;"><em>from <a rel="nofollow" href="http://inchoo.net/ecommerce/magento/custom-reference-structural-block/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');" target="_blank">Inchoo.net</a></em></span></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/09/move-mini-cart-in-the-sidebar-to-the-header-or-anywhere-in-magento/' rel='bookmark' title='Permanent Link: Move mini-cart in the sidebar to the header (or anywhere) in Magento'>Move mini-cart in the sidebar to the header (or anywhere) in Magento</a></li><li><a href='http://asia-connect.com.vn/2009/07/how-to-add-dynamic-content-to-magento-static-blocks-and-pages/' rel='bookmark' title='Permanent Link: How to Add Dynamic Content to Magento Static Blocks and Pages?'>How to Add Dynamic Content to Magento Static Blocks and Pages?</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/09/add-new-reference-in-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing default category sort order in Magento</title>
		<link>http://asia-connect.com.vn/2009/09/changing-default-category-sort-order-in-magento/</link>
		<comments>http://asia-connect.com.vn/2009/09/changing-default-category-sort-order-in-magento/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 02:42:37 +0000</pubDate>
		<dc:creator>lydh</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=826</guid>
		<description><![CDATA[
Category toolbar has many options. By default is shows how many items are in the category, you can choose how many products you wish to be displayed per page, you can change the listing type (List or Grid) and you may choose Sort Order. This “Sort Order” can be confusing. The default “Sort Order” is “Best Value”. What does it mean? How is the Best value determined? Can we change the default sort order?
 
What is “Best Value” filed?
When you go to Category page in Magento administration, you will see ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/some-custom-blocks-to-help-you-show-products/' rel='bookmark' title='Permanent Link: Some custom Blocks to help you show products'>Some custom Blocks to help you show products</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img title="Changing default category sort order in Magento" src="http://inchoo.net/wp-content/uploads/2009/02/default_sort_order.png" alt="Changing default category sort order in Magento" width="585" /></p>
<p>Category toolbar has many options. By default is shows how many items are in the category, you can choose how many products you wish to be displayed per page, you can change the listing type (List or Grid) and you may choose Sort Order. This “Sort Order” can be confusing. The default “Sort Order” is “Best Value”. What does it mean? How is the Best value determined? Can we change the default sort order?</p>
<p><span id="more-946"> </span></p>
<h2>What is “Best Value” filed?</h2>
<p>When you go to Category page in <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> administration, you will see “Category Products” tab. From there, you will see the list of products that are associated to this category. The last column in “Position”. That is how “Best Value” is determined. So, best value is not something that is dynamically calculated. You can tailor it to your likings.<br />
<img title="Magento Category Product List Position" src="http://inchoo.net/wp-content/uploads/2009/02/category_product_list_position.png" alt="Magento Category Product List Position" width="585" /></p>
<h2>How to change default Sort Order</h2>
<p>The file you need to look at is: <strong>/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php</strong> Since we’ll modify it, make a copy to <strong>/app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php</strong></p>
<p>One there, you will notice this code at the beginning of the file:</p>
<pre class="brush: php;">
$this-&gt;_availableOrder = array(
'position'  =&gt; $this-&gt;__('Best Value'),
'name'      =&gt; $this-&gt;__('Name'),
'price'     =&gt; $this-&gt;__('Price')
);
</pre>
<p>Default order takes the first value available. So, all you have to do is to either:</p>
<ul>
<li>reorder it if you want to have a selection in the Toolbar or</li>
<li>set only one value of choice if you will remove the selection from the toolbar</li>
</ul>
<p>I hope this will help somebody.</p>
<p style="text-align: right;"><em>By </em><span>Tomislav Bilic</span><em> from <a rel="nofollow" href="http://inchoo.net/ecommerce/magento/changing-default-category-sort-order-in-magento/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');" target="_blank">Inchoo.net</a></em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/some-custom-blocks-to-help-you-show-products/' rel='bookmark' title='Permanent Link: Some custom Blocks to help you show products'>Some custom Blocks to help you show products</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/09/changing-default-category-sort-order-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Color Switcher in Magento</title>
		<link>http://asia-connect.com.vn/2009/09/create-a-color-switcher-in-magento/</link>
		<comments>http://asia-connect.com.vn/2009/09/create-a-color-switcher-in-magento/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 04:19:12 +0000</pubDate>
		<dc:creator>lydh</dc:creator>
				<category><![CDATA[Magento Customization]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=613</guid>
		<description><![CDATA[
Magento comes packed with a lot of options. But no matter how many options you put into some product you can never cover all of them. One of such options (for now) is a color switcher in Magento. To be more precise, an image switcher based on color selection.
Recently I’ve made a screencast on my site on this subject, with somewhat different title. The idea is to have a dropdown box from which you choose a color and based on the color selection product image changes. All of this is ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/how-to-change-background-color-of-product-image-placeholder/' rel='bookmark' title='Permanent Link: How to change background color of product image placeholder?'>How to change background color of product image placeholder?</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/09/create-a-new-magento-theme/' rel='bookmark' title='Permanent Link: Create a new Magento theme'>Create a new Magento theme</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><img title="Create a Color Switcher in Magento" src="http://inchoo.net/wp-content/uploads/2008/10/color_switcher.jpg" alt="Create a Color Switcher in Magento" width="585" /></p>
<p><a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> comes packed with a lot of options. But no matter how many options you put into some product you can never cover all of them. One of such options (for now) is a color switcher in Magento. To be more precise, an image switcher based on color selection.</p>
<p>Recently I’ve made a <a rel="nofollow" href="http://activecodeline.com/2008/09/29/magento-product-image-change-on-color-selection/" onclick="javascript:pageTracker._trackPageview('/outbound/article/activecodeline.com');">screencast</a> on my site on this subject, with somewhat different title. The idea is to have a dropdown box from which you choose a color and based on the color selection product image changes. All of this is to be based on some simple javascript (in my case, jQuery).</p>
<p>Before we continue, you might want to see <a rel="nofollow" title="Take a look at color switcher in action" href="http://www.kapitolreef.com/shop/snorkel.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.kapitolreef.com');">color switcher in action</a>. We used this solution on our <a rel="nofollow" title="Kapitol Reef Snorkel" href="http://inchoo.net/wordpress/kapitol-reef-magento-online-store/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');">Kapitol Reef project</a>.</p>
<p>First you need to upload some images to your product and give them some meaningful names like Red, Blue, Green depending on your product color. When I say give them name, I mean on label values. Same goes for creating custom attribute. You create a dropdown selection box and create the same amount of dropdown options as you have images, giving them the same name Red, Green, Blue… and so on. Here are some images for you to see what I’m talking about:<br />
<a href="http://inchoo.net/wp-content/uploads/2008/09/1_product_images.png"  rel="nofollow"  onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');"  class="thickbox noicon" title="1_product_images"><img title="1_product_images" src="http://inchoo.net/wp-content/uploads/2008/09/1_product_images-637x519.png" alt="" width="585" /></a> <a href="http://inchoo.net/wp-content/uploads/2008/09/2_product_custom_options.png"  rel="nofollow"  onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');"  class="thickbox noicon" title="2_product_custom_options"><img title="2_product_custom_options" src="http://inchoo.net/wp-content/uploads/2008/09/2_product_custom_options-637x456.png" alt="" width="585" /></a></p>
<p>After this is done we go to the code part. There are three things you need to do here.<br />
Upload the jQuery and save it into the /js/jquery/jquery.js. One important note on jQuery; for some reason I had to use jQuery 1.2.3 to get this example working. Latest version 1.2.6 (as of time of this writing) did not work. You can see the exact error it gave me on my <a rel="nofollow" href="http://activecodeline.com/2008/09/29/magento-product-image-change-on-color-selection/" onclick="javascript:pageTracker._trackPageview('/outbound/article/activecodeline.com');">screencast</a>.<br />
Now you need to modify /template/page/html/head.phtml file to include the jQuery script (or any other if you can code the same logic into it) and write down few lines of JS to do the switching (you can download my version of file here <a rel="nofollow" href="http://inchoo.net/wp-content/uploads/2008/09/headphtml.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');">head.phtml</a>)<br />
And finaly, you need to modify the /template/catalog/product/view/media.phtml file to grab all of the product images and dump them into some div. Here is my sample (<a rel="nofollow" href="http://inchoo.net/wp-content/uploads/2008/09/mediaphtml.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');">media.phtml</a>) so just copy paste the code.</p>
<p>And some additional screenshots for you to see final result</p>
<p><a href="http://inchoo.net/wp-content/uploads/2008/09/3_frontend_color_selection.jpg"  rel="nofollow"  onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');"  class="thickbox noicon" title="3_frontend_color_selection"><img title="3_frontend_color_selection" src="http://inchoo.net/wp-content/uploads/2008/09/3_frontend_color_selection-637x634.jpg" alt="" width="585" /></a> <a href="http://inchoo.net/wp-content/uploads/2008/09/4_frontend_firebug_selection.jpg"  rel="nofollow"  onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');"  class="thickbox noicon" title="4_frontend_firebug_selection"><img title="4_frontend_firebug_selection" src="http://inchoo.net/wp-content/uploads/2008/09/4_frontend_firebug_selection-637x508.jpg" alt="" width="585" /></a></p>
<p>After some additional styling you can get some impressive results for this. Hope you find it useful.</p>
<p>You can see complete screencast at:<br />
<a rel="nofollow" title="Magento Color Changer Video" href="http://activecodeline.com/wp-content/uploads/videos/MagentoProductColorChooser.swf" onclick="javascript:pageTracker._trackPageview('/outbound/article/activecodeline.com');" target="_blank">http://activecodeline.com/wp-content/uploads/videos/MagentoProductColorChooser.swf</a></p>
<p style="text-align: right;"><em>By </em><span>Branko Ajzele </span><em>from <a rel="nofollow" href="http://inchoo.net/ecommerce/magento/create-a-color-switcher-in-magento/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');" target="_blank">Inchoo.net</a></em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/how-to-change-background-color-of-product-image-placeholder/' rel='bookmark' title='Permanent Link: How to change background color of product image placeholder?'>How to change background color of product image placeholder?</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/09/create-a-new-magento-theme/' rel='bookmark' title='Permanent Link: Create a new Magento theme'>Create a new Magento theme</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/09/create-a-color-switcher-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving Magento Speed &amp; Performance With MySQL Query Cache</title>
		<link>http://asia-connect.com.vn/2009/07/improving-magento-speed-performance-with-mysql-query-cache/</link>
		<comments>http://asia-connect.com.vn/2009/07/improving-magento-speed-performance-with-mysql-query-cache/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 08:49:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=534</guid>
		<description><![CDATA[Improving Magento performance is at the top of the list for most professional Magento developers. There’s no doubt that enhancing the speed at which Magento performs can only be good for business.
One of the most important enhancements you can make to your Magento installation is to properly configure your MySQL database server.
A proper MySQL configuration requires a low level understanding of your underlying hardware and, primarily, the memory (RAM) available.
There is one specific MySQL configuration parameter above all others that will produce significant performance improvements and takes very little understanding ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/boost-the-speed-of-your-magento-by-235/' rel='bookmark' title='Permanent Link: Boost the speed of your Magento by ~235%'>Boost the speed of your Magento by ~235%</a></li><li><a href='http://asia-connect.com.vn/2009/09/magento-mysql-database-diagram/' rel='bookmark' title='Permanent Link: Magento MySQL database diagram'>Magento MySQL database diagram</a></li><li><a href='http://asia-connect.com.vn/2009/10/remove-sid-query-from-magento-urls/' rel='bookmark' title='Permanent Link: Remove SID query from Magento URLs'>Remove SID query from Magento URLs</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Improving <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> performance is at the top of the list for most professional Magento developers. There’s no doubt that enhancing the speed at which Magento performs can only be good for business.</p>
<p>One of the most important enhancements you can make to your Magento installation is to properly configure your MySQL database server.</p>
<p>A proper MySQL configuration requires a low level understanding of your underlying hardware and, primarily, the memory (RAM) available.</p>
<p>There is one specific MySQL configuration parameter above all others that will produce significant performance improvements and takes very little understanding to implement.</p>
<h2>Query Caching</h2>
<p>The single most effective configuration item for enhancing the performance of Magento is money. The second is MySQL’s cache queries configuration parameters.</p>
<p><a rel="nofollow" href="http://www.magentocommerce.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');">Magento Commerce </a> is a database application, and as such, requires a great deal of database access and read operations. However, Magento also makes many identical queries each time a page is viewed with relatively little changes in these queries over time.</p>
<p>Each time a Magento page is loaded, a series of database queries are made and the database server must go to work.</p>
<p>Each query is first parsed and the execution of the query is initiated. Then the data must be retrieved from the disk or storage media, sorted and manipulated, and then ultimately returned to the client. This results in performance slow downs because of, among other things, slower disk access.</p>
<p>MySQL offers a built in configuration parameter known as <code>query_cache_size</code>. This configuration directive tells the MySQL server to store the result of the query in memory—much faster than accessing from disk.</p>
<p>The actual size of this cache and number of query result sets cached is dependent on the amount of memory available to your MySQL database server.</p>
<p>In a hosting environment with 1 GB RAM, such as Magento Containers, this allows for a query cache size of 64 MB or larger depending on other memory use factors, such as other services running on the server.</p>
<p>This allows 64 MB of queries to be stored in the very fast RAM, or memory of your hosting environment, as opposed to having to access the disk each time this query is executed or each time the page is loaded. This is an extremely large amount of data.</p>
<p>Now is a good time to point out a bug in MySQL query cache that proves bigger is not always better:</p>
<blockquote><p>Invaldating a subset of a sufficiently large query cache can take a long time. During this time the server is efficiently frozen and no other operation can be executed. This patch addresses this problem by moving the locks which cause the freezing and also by temporarily disable the query cache while the invalidation takes place.</p></blockquote>
<p>Extremely large query cache sizes should <strong>not</strong> be used. The larger the query cache size, the greater the impact of the data validation MySQL performs on the cache when a table has changed, and the resulting set of data in the cache is no longer valid. The bottom line is not to use a query cache size larger than what you need.</p>
<p>On a Magento installation with over 80,000 products, we have found 64 MB to provide <strong>10x the performance improvement</strong> over disabled query cache. The actual use or capacity of the cache is less than 50 percent, which provides room for continued cache growth up to 64 MB.</p>
<p>The performance increase you should see from this single configuration enhancement will be in the order of 100-1000% depending on the query executed and the disk being accessed.</p>
<h2>Shared vs. Dedicated</h2>
<p>MySQL query cache is <strong>disabled by default</strong> and tells MySQL how much RAM to use for this cache and ultimately how many queries we can cache. This cache is cleared each time the MySQL server is restarted and must be rebuilt query by query after each restart of the MySQL server.</p>
<p>In a product database containing over 80,000 items, our test results show a non-cached query returning in just over 11 seconds.</p>
<p>This same query performed a second time results in using the cached query and produces the same result set in just over <strong>1 second</strong>.</p>
<p>This further demonstrates <strong>the necessity of a dedicated</strong> or application specific hosting environment for production ecommerce websites, which provide a far more stable MySQL database service, among many other advantages, to the less expensive shared hosting.</p>
<p>Contrast this performance enhancement with shared hosting, where a database server could be bounced daily, or even hourly in some cases.</p>
<p>Each time the MySQL server is restarted you lose your cached queries and each new query performed will result in a significantly longer wait for page load. That is, if cached queries ared even enabled on your shared host.</p>
<h2>How To Check If Query Caching Is Enabled</h2>
<p>To check if your host has query caching enabled in the MySQL server, you can issue the following command from your MySQL command prompt:</p>
<blockquote><p><code>mysql&gt; SHOW VARIABLES LIKE 'have_query_cache';<br />
+------------------+-------+<br />
| Variable_name | Value    |<br />
+------------------+-------+<br />
| have_query_cache | YES   |<br />
+------------------+-------+</code></p></blockquote>
<p>If you are using a standard MySQL binary this value is always <strong>YES</strong>, even if query caching is disabled so it’s not time for great joy, yet.</p>
<p>To verify that query cache is actually operational, you can issue the following command to the MySQL server:</p>
<blockquote><p><code>mysql&gt; SHOW VARIABLES LIKE 'query_cache_size';<br />
+------------------+----------+<br />
| Variable_name | Value       |<br />
+------------------+----------+<br />
| query_cache_size | 67108864 |<br />
+------------------+----------+<br />
1 row in set (0.00 sec)</code></p></blockquote>
<p>This shows that we have 64 MB available to our query cache size, a very respectable amount of memory.</p>
<p>The following demonstrates a server that has MySQL query cache disabled by setting the value to zero:</p>
<blockquote><p><code>mysql&gt; SHOW VARIABLES LIKE 'query_cache_size';<br />
+------------------+-------+<br />
| Variable_name | Value    |<br />
+------------------+-------+<br />
| query_cache_size | 0     |<br />
+------------------+-------+<br />
1 row in set (0.00 sec)</code></p></blockquote>
<p>If you have root access, making a change to this value is trivial. Simply add the following line to your <strong>my.conf</strong> file in the <code>[mysqld]</code> section and restart your MySQL server:</p>
<blockquote><p><code>query_cache_size=32M</code></p></blockquote>
<p>Query caching is an extremely effective and simple method that can use to improve your Magento performance in minutes. Query caching offers several other configuration parameters that should also be carefully considered when configuring your MySQL server, including:</p>
<blockquote><p><code>query_cache_type<br />
query_cache_min_res_unit<br />
query_cache_limit</code></p></blockquote>
<p>I <strong>highly</strong> recommend that you review these additional configuration parameters prior to implementing your query cache configuration.</p>
<p>Not only will this provide you with even better performance, but you’ll also have a deeper understanding of how your MySQL configuration can enhance the performance and increase the speed of Magento.</p>
<p style="text-align: right;"><em>From Crucialwebhost.com</em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/boost-the-speed-of-your-magento-by-235/' rel='bookmark' title='Permanent Link: Boost the speed of your Magento by ~235%'>Boost the speed of your Magento by ~235%</a></li><li><a href='http://asia-connect.com.vn/2009/09/magento-mysql-database-diagram/' rel='bookmark' title='Permanent Link: Magento MySQL database diagram'>Magento MySQL database diagram</a></li><li><a href='http://asia-connect.com.vn/2009/10/remove-sid-query-from-magento-urls/' rel='bookmark' title='Permanent Link: Remove SID query from Magento URLs'>Remove SID query from Magento URLs</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/improving-magento-speed-performance-with-mysql-query-cache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Boost the speed of your Magento by ~235%</title>
		<link>http://asia-connect.com.vn/2009/07/boost-the-speed-of-your-magento-by-235/</link>
		<comments>http://asia-connect.com.vn/2009/07/boost-the-speed-of-your-magento-by-235/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 08:46:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=531</guid>
		<description><![CDATA[One of the drawbacks of Magento is currently its speed if default configuration is used. There are certain ways of making it run faster. The best one is to enable GZip compression by changing .htaccess file a little. You just need to uncomment part of the code. In my case, the speed increase was exactly 235%.
 
Find the following lines in your Magento .htaccess file and replace them with the following code.
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/improving-magento-speed-performance-with-mysql-query-cache/' rel='bookmark' title='Permanent Link: Improving Magento Speed &#038; Performance With MySQL Query Cache'>Improving Magento Speed &#038; Performance With MySQL Query Cache</a></li><li><a href='http://asia-connect.com.vn/2009/10/magento-custom-emails/' rel='bookmark' title='Permanent Link: Magento custom emails'>Magento custom emails</a></li><li><a href='http://asia-connect.com.vn/2009/09/add-new-reference-in-magento/' rel='bookmark' title='Permanent Link: Add New Reference in Magento'>Add New Reference in Magento</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>One of the drawbacks of <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> is currently its speed if default configuration is used. There are certain ways of making it run faster. The best one is to enable GZip compression by changing .htaccess file a little. You just need to uncomment part of the code. In my case, the speed increase was exactly <strong>235%</strong>.</p>
<p><span id="more-15"> </span></p>
<p>Find the following lines in your Magento .htaccess file and replace them with the following code.</p>
<p>############################################<br />
## enable apache served files compression<br />
## http://developer.yahoo.com/performance/rules.html#gzip</p>
<p># Insert filter<br />
SetOutputFilter DEFLATE</p>
<p># Netscape 4.x has some problems…<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html</p>
<p># Netscape 4.06-4.08 have some more problems<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip</p>
<p># MSIE masquerades as Netscape, but it is fine<br />
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html<br />
# Don’t compress images<br />
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary</p>
<p># Make sure proxies don’t deliver the wrong content<br />
Header append Vary User-Agent env=!dont-vary</p>
<p># enable resulting html compression<br />
php_flag zlib.output_compression on</p>
<p style="text-align: right;"><em>From</em> <em><a rel="nofollow" href="http://inchoo.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inchoo.net');"  class="alinks_links" onclick="return alinks_click(this);" title="inchoo.net"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Inchoo.net</a></em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/improving-magento-speed-performance-with-mysql-query-cache/' rel='bookmark' title='Permanent Link: Improving Magento Speed &#038; Performance With MySQL Query Cache'>Improving Magento Speed &#038; Performance With MySQL Query Cache</a></li><li><a href='http://asia-connect.com.vn/2009/10/magento-custom-emails/' rel='bookmark' title='Permanent Link: Magento custom emails'>Magento custom emails</a></li><li><a href='http://asia-connect.com.vn/2009/09/add-new-reference-in-magento/' rel='bookmark' title='Permanent Link: Add New Reference in Magento'>Add New Reference in Magento</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/boost-the-speed-of-your-magento-by-235/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento Menu Customization with Product List</title>
		<link>http://asia-connect.com.vn/2009/07/magento-menu-customization-with-product-list/</link>
		<comments>http://asia-connect.com.vn/2009/07/magento-menu-customization-with-product-list/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 18:33:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Customization]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=492</guid>
		<description><![CDATA[Magento main menu is construed based on the hierarchy like,
Root Category → Category → Sub-Category
We will customise the menu to show the Products of a category/su-bcategory along with its hierarchy in dropdown menu as seen below.

This is a good feature if you have less products in a website.
In order to implement the above structure, we need to modify the navigation.php file of drawItem() function like below. The navigation.php is available in the following location,
app/code/core/Mage/Catalog/Block/Navigation.php 
The code is,


&#60;code&#62;Public function drawItem($category, $level=0, $last=false){
$html = '';
if (!$category-&#62;getIsActive()) {
return $html;
}
$children = $category-&#62;getChildren();
$hasChildren = $children ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/some-custom-blocks-to-help-you-show-products/' rel='bookmark' title='Permanent Link: Some custom Blocks to help you show products'>Some custom Blocks to help you show products</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> main menu is construed based on the hierarchy like,</p>
<p>Root Category → Category → Sub-Category</p>
<p>We will customise the menu to show the Products of a category/su-bcategory along with its hierarchy in dropdown menu as seen below.</p>
<p><img src="http://www.hastentechnologies.com/blog/image.axd?picture=Hasten-Magento+Category+Product+Menu+List.gif" alt="" /></p>
<p>This is a good feature if you have less products in a website.</p>
<p>In order to implement the above structure, we need to modify the <strong>navigation.php</strong> file of <strong>drawItem()</strong> function like below. The <strong>navigation.php</strong> is available in the following location,</p>
<p><code>app/code/core/Mage/Catalog/Block/Navigation.php </code></p>
<p>The code is,</p>
<pre class="brush: php;">

&lt;code&gt;Public function drawItem($category, $level=0, $last=false){
$html = '';
if (!$category-&gt;getIsActive()) {
return $html;
}
$children = $category-&gt;getChildren();
$hasChildren = $children &amp;&amp; $children-&gt;count();
/***** Getting Product List Start ******/
$cur_category = Mage::getModel('catalog/category')-&gt;load($category-&gt;getId());
$_productCollection =
Mage::getResourceModel('catalog/product_collection')-&gt;addCategoryFilter($cur_category)-&gt;setOrder('position',
'ASC');
$cnt=1;
$hasProduct1=$_productCollection-&gt;count();
$phtmlChildren='';
if($hasProduct1&gt;=1){
$l=$level+1;
foreach ($_productCollection AS $_product){
$cur_product = Mage::getModel('catalog/product')-&gt;load($_product-&gt;getId());
if ($cur_product-&gt;getStatus()){
$phtmlChildren.= '&lt;li';
if($cnt==$hasProduct1) {
$phtmlChildren.= ' class=&quot;level'.$l;
$phtmlChildren.= ' nav-'.$this-&gt;htmlEscape($cur_product-&gt;getName()).' last';
}
else {
$phtmlChildren.= ' class=&quot;level'.$l;
$phtmlChildren.= ' nav-'.$this-&gt;htmlEscape($cur_product-&gt;getName());
}
$phtmlChildren.= '&quot;&gt;'.&quot;\n&quot;;
$phtmlChildren.= ' &lt;a href=&quot;/'.$cur_product-&gt;getUrlPath() .
'.html&quot;&gt;'. $this-&gt;htmlEscape($cur_product-&gt;getName()) .
'&lt;/a&gt;'.&quot;\n&quot;;
$phtmlChildren.= '&lt;/li&gt;';
$cnt=$cnt+1;
}
}
}
/***** Getting Product List End ******/
$html.= '&lt;li';
if ($hasChildren || (!empty($phtmlChildren)))
$html.= ' onmouseover=&quot;toggleMenu(this,1)&quot; onmouseout=&quot;toggleMenu(this,0)&quot;';
$html.= ' class=&quot;level'.$level;
$html.= ' nav-'.str_replace('/', '-', $category-&gt;getRequestPath());
if ($this-&gt;isCategoryActive($category))
$html.= ' active';
if ($last)
$html .= ' last';
if ($hasChildren || (!empty($phtmlChildren))) {
$cnt = 0;
foreach ($children as $child)
if ($child-&gt;getIsActive())
$cnt++;
$html .= ' parent';
}
$html.= '&quot;&gt;'.&quot;\n&quot;;
$html.= '&lt;a
href=&quot;'.$this-&gt;getCategoryUrl($category).'&quot;&gt;&lt;span&gt;'.$this-&gt;htmlEscape($category-&gt;getName()).'&lt;/span&gt;&lt;/a&gt;'.&quot;\n&quot;;
$htmlChildren = '';
if ($hasChildren) {
$j = 0;
foreach ($children as $child)
if ($child-&gt;getIsActive())
$htmlChildren.= $this-&gt;drawItem($child, $level+1, ++$j &gt;= $cnt);
}
if ((!empty($htmlChildren)) || (!empty($phtmlChildren)))
$html.= '&lt;ul class=&quot;level' . $level . '&quot;&gt;'.&quot;\n&quot; .$htmlChildren .$phtmlChildren .'&lt;/ul&gt;';
$html.= '&lt;/li&gt;'.&quot;\n&quot;;
return $html;
}&lt;/code&gt;
</pre>
<p>The below lines in <strong>drawItem()</strong> function will fetch the current sub-category&#8217;s product list based on the sub-category id. The <strong>$_productCollection</strong> has the list of product of selected subcategory by getting the id as <strong>$category-&gt;getId()</strong> function.</p>
<pre class="brush: php;">

&lt;code&gt; $cur_category = Mage::getModel('catalog/category')-&gt;load($category-&gt;getId());
$_productCollection =
Mage::getResourceModel('catalog/product_collection')-&gt;addCategoryFilter($cur_category)-&gt;setOrder('position',
'ASC'); &lt;/code&gt;
</pre>
<p>We will loop through them and generate the menu structure using <strong>&lt;li&gt;&lt;/li&gt;</strong> tag.</p>
<p style="text-align: right;"><em>From Hastentechnologies.com</em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/some-custom-blocks-to-help-you-show-products/' rel='bookmark' title='Permanent Link: Some custom Blocks to help you show products'>Some custom Blocks to help you show products</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/magento-menu-customization-with-product-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Links to Magento Menu Bar</title>
		<link>http://asia-connect.com.vn/2009/07/adding-links-to-magento-menu-bar/</link>
		<comments>http://asia-connect.com.vn/2009/07/adding-links-to-magento-menu-bar/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 18:27:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Customization]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=487</guid>
		<description><![CDATA[Look for the top.phtml corresponding to your menu.
You can find the top.phtml files using SSH shell with this command.
Come to the app/ folder
find -name top.phtml

./design/frontend/default/iphone/template/catalog/navigation/top.phtml
./design/frontend/default/default/template/catalog/navigation/top.phtml
./design/frontend/default/blank/template/catalog/navigation/top.phtml
./design/frontend/default/modern/template/catalog/navigation/top.phtml

From above you should be able to locate your themes top.phtml
now edit the top.phtml
nano design/frontend/default/modern/template/catalog/navigation/top.phtml

&#60;ul id=”nav”&#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;?php foreach ($this-&#62;getStoreCategories() as $_category): ?&#62;
&#60;?php echo $this-&#62;drawItem($_category) ?&#62;
&#60;?php endforeach ?&#62;

&#60;li&#62;&#60;a href=”&#60;?php echo $this-&#62;getUrl(’about-magento-demo-store’)?&#62;”&#62;&#60;?php echo $this-&#62;__(’About Us’) ?&#62;&#60;/a&#62;&#60;/li&#62;

&#60;/ul&#62;

I have added two links “Home” and “About Us” in the above code (colored yellow)
&#8211;
Not happy with where your site shows up in the search engines? Our clients ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/06/adding-links-to-your-top-menu/' rel='bookmark' title='Permanent Link: Adding Links to your Top Menu'>Adding Links to your Top Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-menu-navigation-in-magento/' rel='bookmark' title='Permanent Link: Custom category menu navigation in Magento'>Custom category menu navigation in Magento</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Look for the top.phtml corresponding to your menu.</p>
<p>You can find the top.phtml files using SSH shell with this command.</p>
<p>Come to the app/ folder<br />
find -name <strong>top.phtml</strong></p>
<pre class="brush: php;">
./design/frontend/default/iphone/template/catalog/navigation/top.phtml
./design/frontend/default/default/template/catalog/navigation/top.phtml
./design/frontend/default/blank/template/catalog/navigation/top.phtml
./design/frontend/default/modern/template/catalog/navigation/top.phtml
</pre>
<p>From above you should be able to locate your themes top.phtml</p>
<p>now edit the top.phtml</p>
<p>nano design/frontend/default/modern/template/catalog/navigation/top.phtml</p>
<pre class="brush: html;">
&lt;ul id=”nav”&gt;
&lt;li&gt;&lt;a href=”&lt;?php echo $this-&gt;getUrl(”)?&gt;”&gt;&lt;?php echo $this-&gt;__(’Home’) ?&gt;&lt;/a&gt;&lt;/li&gt;

&lt;?php foreach ($this-&gt;getStoreCategories() as $_category): ?&gt;
&lt;?php echo $this-&gt;drawItem($_category) ?&gt;
&lt;?php endforeach ?&gt;

&lt;li&gt;&lt;a href=”&lt;?php echo $this-&gt;getUrl(’about-<a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">magento</a>-demo-store’)?&gt;”&gt;&lt;?php echo $this-&gt;__(’About Us’) ?&gt;&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
</pre>
<p>I have added two links “Home” and “About Us” in the above code (colored yellow)</p>
<p>&#8211;</p>
<p><a rel="nofollow" title="Search Engine Optimization" href="http://www.SearchPlacementPros.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.SearchPlacementPros.com');" target="_blank">Not happy with where your site shows up in the search engines? Our clients are on page ONE of Google for their keywords. Let us show you how we can help you too.</a></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/06/adding-links-to-your-top-menu/' rel='bookmark' title='Permanent Link: Adding Links to your Top Menu'>Adding Links to your Top Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-menu-navigation-in-magento/' rel='bookmark' title='Permanent Link: Custom category menu navigation in Magento'>Custom category menu navigation in Magento</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/adding-links-to-magento-menu-bar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Top 3 Solutions when your Magento Categories are not displaying</title>
		<link>http://asia-connect.com.vn/2009/07/top-3-solutions-when-your-magento-categories-are-not-displaying/</link>
		<comments>http://asia-connect.com.vn/2009/07/top-3-solutions-when-your-magento-categories-are-not-displaying/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 16:02:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Customization]]></category>
		<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[Magento Developer]]></category>
		<category><![CDATA[Magento Development]]></category>
		<category><![CDATA[Magento How To]]></category>
		<category><![CDATA[Magento Programming]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=478</guid>
		<description><![CDATA[Here are 3 quick solutions to try if you do not see your Magento store categories after a fresh install of Magento or an upgrade to the latest version. I wanted to post this because I just recently helped install Magento for someone and experienced this. The installation version was the latest Magento version, 1.2.1.2 and product categories did not show up on the frontend after they were added in the administration interface.
The top 3 solutions to this in my experience are:

The categories not added as sub-categories of the Default, ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-images-listing-block-tutorial/' rel='bookmark' title='Permanent Link: Custom Category Images Listing Block Tutorial'>Custom Category Images Listing Block Tutorial</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Here are 3 quick solutions to try if you do not see your <a rel="nofollow" href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.magentocommerce.com');"  class="alinks_links" onclick="return alinks_click(this);" title="Magento eCommerce"  style="padding-right: 13px; background: url(http://asia-connect.com.vn/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Magento</a> store categories after a fresh install of Magento or an upgrade to the latest version. I wanted to post this because I just recently helped install Magento for someone and experienced this. The installation version was the latest Magento version, 1.2.1.2 and product categories did not show up on the frontend after they were added in the administration interface.</p>
<p>The top 3 solutions to this in my experience are:</p>
<ol>
<li>The categories not added as sub-categories of the Default, Root category.</li>
<li>The Magento store configuration has no default category set.</li>
<li>The category cache requires a refresh.</li>
</ol>
<p>I’ll cover each of these points in more detail with screenshots, so that if you are having trouble with your categories not showing up you can hopefully solve the problem.</p>
<h2>Categories must be sub-categories of the default (root) category</h2>
<p>This one seems to catch most new Magento users, basically all new categories you add to your store should be children of your default category. If you accidentally delete your default root category, then you need to make a new default category that can be the root category of all your other store categories.</p>
<p>The screenshot below illustrates this configuration as it appears in the administration interface. Be sure to check the lines that connect you new categories with your original default category, they should show as sub-categories and be indented accordingly.</p>
<div id="attachment_227" class="wp-caption aligncenter" style="width: 553px;"><img class="size-full wp-image-227" title="Default Root category as the parent of all new store categories." src="http://www.aschroder.com/wp-content/uploads/2009/03/picture-9.png" alt="Ths screenshot shows the Default Root category as the parent of all new store categories." width="543" height="234" /></p>
<p class="wp-caption-text">Ths screenshot shows the Default Root category as the parent of all new store categories.</p>
</div>
<p>The reason for this notion of root categories is so that you can have entirely parallel category structures, made up of products from a shared inventory. These parallel category hierarchies can then be used for different store fronts. Each store has it’s own root category. What a pertinent segue into our next section…</p>
<h2>Default (root) category must be specified for your Store</h2>
<p>If you get a bit eager with your Magento store configuration and end up deleting the default root category, never fear, you can simply make a new Root category using the menu option. However you may also then need to re-associate that category with your default store (or any other store for which that category was the root). To do this you go the System &gt; Manage Stores menu and drill-down to the Edit store screen as shown below.</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 556px;"><img class="size-full wp-image-228" title="The edit store screen where you configure your default root category." src="http://www.aschroder.com/wp-content/uploads/2009/03/picture-13.png" alt="This screenshot shows the Edit Store screen (accessed via the System -&gt; Manage Stores menu). The Edit Store screen is where you configure your default root category." width="546" height="274" /></p>
<p class="wp-caption-text">This screenshot shows the Edit Store screen (accessed via the System -&gt; Manage Stores menu). The Edit Store screen is where you configure your default root category.</p>
</div>
<p>If your root category is not set, then you simply select your root category from the drop down and save the configuration. You should now be able to see your categories on your Magento store front.</p>
<h2>Category cache may require a refresh</h2>
<p>If you are still reading, things are getting a little grim I’m afraid. This solution is seldom required, and in turn, is rarely the solution. However, it’s worth a try right, otherwise you’ll end up kissing goodbye the next 30 minutes while you trawl the internet and the Magento forums searching for some other obscure solution.</p>
<p>Access the Cache Management screen (System &gt; Cache Management) and tick all the boxes (for good measure), yes even the one labelled ‘beta’. Then choose Refresh from the drop down and save. You can see this in the screenshot below.</p>
<div id="attachment_229" class="wp-caption aligncenter" style="width: 507px;"><img class="size-full wp-image-229" title="Tick all the boxes and refresh the Magento cache." src="http://www.aschroder.com/wp-content/uploads/2009/03/picture-14.png" alt="Tick all the boxes and refresh the Magento cache." width="497" height="447" /></p>
<p class="wp-caption-text">Tick all the boxes and refresh the Magento cache.</p>
</div>
<p>Also one last thing, try refreshing the layered navigation too, this is a button further down the Cache Management screen, shown below.</p>
<div id="attachment_230" class="wp-caption aligncenter" style="width: 619px;"><img class="size-full wp-image-230" title="One last thing to try: refresh the layered navigation cache." src="http://www.aschroder.com/wp-content/uploads/2009/03/picture-12.png" alt="One last thing to try: refresh the layered navigation cache." width="609" height="73" /></p>
<p class="wp-caption-text">One last thing to try: refresh the layered navigation cache.</p>
</div>
<p>If all of these options have failed you and you still cannot see your Magento store categories, the please post below and we can try and solve the problem together. Hopefully we can add any of the obscure reasons for failure and save others struggling with this frustrating initial hurdle to Magento installation and configuration.</p>
<p style="text-align: right;"><em>From Aschroder.com</em></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/magento-vertical-category-menu/' rel='bookmark' title='Permanent Link: Magento Vertical Category Menu'>Magento Vertical Category Menu</a></li><li><a href='http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/' rel='bookmark' title='Permanent Link: Tips For Creating Dynamic Category Landing Pages'>Tips For Creating Dynamic Category Landing Pages</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-images-listing-block-tutorial/' rel='bookmark' title='Permanent Link: Custom Category Images Listing Block Tutorial'>Custom Category Images Listing Block Tutorial</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/top-3-solutions-when-your-magento-categories-are-not-displaying/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tips For Creating Dynamic Category Landing Pages</title>
		<link>http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/</link>
		<comments>http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 15:55:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento Customization]]></category>
		<category><![CDATA[Magento Development]]></category>
		<category><![CDATA[Magento Programming]]></category>
		<category><![CDATA[Magento Tips]]></category>
		<category><![CDATA[Magento Tricks]]></category>
		<category><![CDATA[Magento Tutorials]]></category>

		<guid isPermaLink="false">http://asia-connect.com.vn/?p=474</guid>
		<description><![CDATA[This is quite a common want, so I thought I would put together a quick tutorial with some ideas and pointers. My main goal will be to give you a starting point for building a static block and PHTML file that can be applied to top level categories to dynamically create a block with of all the subcategories.
The first thing to do is create a new static block (CMS → Static Blocks), lets call it ‘Dynamic Landing Pages’. Within the content paste this:
{{block type="catalog/navigation" name="catalog.category" template="catalog/category/list.phtml"}} 
If you’ve not seen ...


Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/how-to-add-dynamic-content-to-magento-static-blocks-and-pages/' rel='bookmark' title='Permanent Link: How to Add Dynamic Content to Magento Static Blocks and Pages?'>How to Add Dynamic Content to Magento Static Blocks and Pages?</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-menu-customization-with-product-list/' rel='bookmark' title='Permanent Link: Magento Menu Customization with Product List'>Magento Menu Customization with Product List</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-images-listing-block-tutorial/' rel='bookmark' title='Permanent Link: Custom Category Images Listing Block Tutorial'>Custom Category Images Listing Block Tutorial</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This is quite a common want, so I thought I would put together a quick tutorial with some ideas and pointers. My main goal will be to give you a starting point for building a static block and PHTML file that can be applied to top level categories to dynamically create a block with of all the subcategories.</p>
<p>The first thing to do is create a new static block (CMS → Static Blocks), lets call it ‘Dynamic Landing Pages’. Within the content paste this:</p>
<p><code>{{block type="catalog/navigation" name="catalog.category" template="catalog/category/list.phtml"}} </code></p>
<p>If you’ve not seen one of these before, then basically it loads the list.phtml into the block allowing you to include dynamic content in your site.</p>
<p>Next create list.phtml in app/design/frontend/default/your_theme/template/catalog/category/</p>
<p>Then go to ‘Manage Categories’ select the relevant category and then choose ‘Static Block Only’ in the ‘Display Mode’ dropdown and then choose the ‘Dynamic Landing Pages’ static block we’ve just created from the ‘CMS Block’ dropdown.</p>
<p>Now to look at some coding to put in list.phtml, to get the category id of the current category and an array containing the ids of its child categories, use the following:</p>
<pre class="brush: php;">

$current = $this-&gt;getCurrentCategory()-&gt;getId();
$category = Mage::getModel('catalog/category')-&gt;load((int)$current);
$children = $category-&gt;getChildren();
$children = explode(&quot;,&quot;,$children);
</pre>
<p>This leaves you with:<br />
<code>$current</code>, your current category id.<br />
<code>$category</code>, which is an instance of <code>Mage_Catalog_Model_Category</code>.<br />
<code>$children</code>, is an array of the child category ids.</p>
<p>Then cycle through each of the child categories by loading the category object using the id from the array. We check first that the first value is not just an empty string (as it will be if there are no categories):</p>
<pre class="brush: php;">

if (strlen($children[0]) &gt; 0)
{
foreach($children as $child)
{
$_child = Mage::getModel('catalog/category')-&gt;load($child);
// then use the $_child object to pull out category properties
}
}
</pre>
<p>Some of the key methods that I then subsequently used to create the landing pages were:</p>
<ul>
<li><code>$_child-&gt;getName()</code></li>
<li><code>$_child-&gt;getUrl()</code></li>
<li><code>$_child-&gt;getImageUrl()</code></li>
<li><code>$_child-&gt;getProductCount()</code></li>
</ul>
<p>The Image URL is based on the image that is uploaded in the ‘General Information’ tab in ‘Manage Categories’ but be aware that if you use this functionality you will probably want to edit <code>frontend/default/your_theme/template/catalog/category/view.phtml</code> so that it doesn’t load that image at the top of the subcategory.</p>
<p>To view the methods of the <code>Mage_Catalog_Model_Category</code> class look at the file: <code>app/code/core/Mage/Catalog/Model/Category.php</code>.</p>
<p>Comments and questions welcome <img class="wp-smiley" src="http://magentoexpert.co.uk/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>


<p>Related posts:<ol><li><a href='http://asia-connect.com.vn/2009/07/how-to-add-dynamic-content-to-magento-static-blocks-and-pages/' rel='bookmark' title='Permanent Link: How to Add Dynamic Content to Magento Static Blocks and Pages?'>How to Add Dynamic Content to Magento Static Blocks and Pages?</a></li><li><a href='http://asia-connect.com.vn/2009/07/magento-menu-customization-with-product-list/' rel='bookmark' title='Permanent Link: Magento Menu Customization with Product List'>Magento Menu Customization with Product List</a></li><li><a href='http://asia-connect.com.vn/2009/07/custom-category-images-listing-block-tutorial/' rel='bookmark' title='Permanent Link: Custom Category Images Listing Block Tutorial'>Custom Category Images Listing Block Tutorial</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://asia-connect.com.vn/2009/07/tips-for-creating-dynamic-category-landing-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
