<?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 custom development and freelance programming</title>
	<atom:link href="http://www.netismine.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.netismine.com</link>
	<description>Magento custom development and freelance programming</description>
	<lastBuildDate>Fri, 18 May 2012 10:31:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>addAttributeToFilter not working?</title>
		<link>http://www.netismine.com/magento/addattributetofilter-not-working</link>
		<comments>http://www.netismine.com/magento/addattributetofilter-not-working#comments</comments>
		<pubDate>Thu, 17 May 2012 16:34:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=388</guid>
		<description><![CDATA[If you are wondering why your addAttributeToFilter is not filtering the collection properly, that's because the attribute is not set to Yes in Admin, on "Used in product listing?" field.]]></description>
			<content:encoded><![CDATA[<p>If you are wondering why your</p>

<div id="wp_syntax476" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttributeToFilter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'color'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'24'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax476');"><a href="javascript://select_all">select all</a></span>
<p>is not filtering the collection properly, that&#8217;s because the attribute is not set to Yes in Admin, on &#8220;Used in product listing?&#8221; field. Oddly enough, Magento only adds such attributes to its catalog_product_flat table, so if your attribute is not in it, no filtering is gonna happen. So, put your attribute to yes for &#8220;Used in product listing?&#8221; and try again.</p>
<p>Edit: don&#8217;t forget to reindex Flat product data after you&#8217;re done (thanks Igor!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/addattributetofilter-not-working/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magic variables not parsing on frontend</title>
		<link>http://www.netismine.com/magento/magic-variables-not-parsing-on-frontend</link>
		<comments>http://www.netismine.com/magento/magic-variables-not-parsing-on-frontend#comments</comments>
		<pubDate>Wed, 18 Apr 2012 13:53:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=385</guid>
		<description><![CDATA[You created a new custom attribute for your product or category in Magento, but when you add magic variables, such as: &#60;img src=&#34;{{media url=&#34;logo.png&#34;}}&#34; alt=&#34;image&#34; /&#62;select all whole thing messes up formatting and HTML, and your image is not visible &#8230;]]></description>
			<content:encoded><![CDATA[<p>You created a new custom attribute for your product or category in Magento, but when you add magic variables, such as:</p>

<div id="wp_syntax866" class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;{{media url=&quot;logo.png&quot;}}&quot; alt=&quot;image&quot; /&gt;</pre></div></div><span class="note" onclick="SelectText('wp_syntax866');"><a href="javascript://select_all">select all</a></span>
<p>whole thing messes up formatting and HTML, and your image is not visible on frontend. Seems like Magento doesn&#8217;t transform {{}} to image URL &#8211; reason is simple &#8211; you didn&#8217;t set your attribute&#8217;s is_html_allowed_on_front value to Yes (or &#8220;1&#8243;). Set it to true, and Magento starts parsing those magic variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/magic-variables-not-parsing-on-frontend/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add category attribute in module installation</title>
		<link>http://www.netismine.com/magento/add-category-attribute-in-module-installation</link>
		<comments>http://www.netismine.com/magento/add-category-attribute-in-module-installation#comments</comments>
		<pubDate>Thu, 15 Mar 2012 10:09:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=382</guid>
		<description><![CDATA[It's often required during custom development of a module to add an attribute to category. You could always hack your client's database, but that's not the right way to do it, especially 'cause Magento has support for it in it's API.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s often required during custom development of a module to add an attribute to category. You could always hack your client&#8217;s database, but that&#8217;s not the right way to do it, especially &#8217;cause Magento has support for it in it&#8217;s API. So the best way to do it is to install it during module&#8217;s DB installation. Here&#8217;s a code that will generate a new category attribute when put into install-* or update-* file in *_setup folder.</p>

<div id="wp_syntax224" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$installer</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$installer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span>Mage_Catalog_Model_Category<span style="color: #339933;">::</span><span style="color: #004000;">ENTITY</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'size_chart'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'type'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'backend'</span>           <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'frontend'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'label'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Size Chart'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'input'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'textarea'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'class'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'source'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'global'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'visible'</span>           <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'required'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'user_defined'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'default'</span>           <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'searchable'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'filterable'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'comparable'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'visible_on_front'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'used_in_product_listing'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'unique'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'wysiwyg_enabled'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'apply_to'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'is_configurable'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$installer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttributeToSet</span><span style="color: #009900;">&#40;</span>Mage_Catalog_Model_Category<span style="color: #339933;">::</span><span style="color: #004000;">ENTITY</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'4'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'size_chart'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'6'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$installer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttributeToGroup</span><span style="color: #009900;">&#40;</span>Mage_Catalog_Model_Category<span style="color: #339933;">::</span><span style="color: #004000;">ENTITY</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'4'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'size_chart'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'6'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax224');"><a href="javascript://select_all">select all</a></span>
<p>Now, I&#8217;m not sure if you need both addAttributeToSet and addAttributeToGroup calls, and am also pretty sure that there&#8217;s a more clever way to mark attribute set id and attribute group id than  &#8217;3&#8242; and &#8217;4&#8242;, so if you find it, do leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/add-category-attribute-in-module-installation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customers who bought this</title>
		<link>http://www.netismine.com/work/customers-who-bought-this</link>
		<comments>http://www.netismine.com/work/customers-who-bought-this#comments</comments>
		<pubDate>Wed, 07 Mar 2012 12:09:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=377</guid>
		<description><![CDATA["Customers who bought this also bought" is a rather common requirement for store owners. And while there are many modules out there doing this, it's surprising to know that this is, in essence, actually a very simple SQL query. ]]></description>
			<content:encoded><![CDATA[<p>&#8220;Customers who bought this also bought&#8221; is a rather common requirement for store owners. And while there are many modules out there doing this, it&#8217;s surprising to know that this is, in essence, actually a very simple SQL query. Most of the work is just displaying the list on frontend and creating correct structure. First you need to fetch all order ids that have a specific product id in them, then select all product ids from that subset, exclude the product id of current product and sort it by number of times product id appeared in the sales table &#8211; and it all fits into a single query. So if someone is trying to sell you a story that this is a huge feature, know that it&#8217;s actually only 3-5 hours of work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/work/customers-who-bought-this/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simulate / fake a module</title>
		<link>http://www.netismine.com/magento/simulate-fake-a-module</link>
		<comments>http://www.netismine.com/magento/simulate-fake-a-module#comments</comments>
		<pubDate>Wed, 18 Jan 2012 13:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=369</guid>
		<description><![CDATA[I found that I needed to trick Magento into thinking it's using one of it's own core modules instead of a custom one, when I needed to retain certain URL-s instead of using my own module's controller.]]></description>
			<content:encoded><![CDATA[<p>I found that I needed to trick Magento into thinking it&#8217;s using one of it&#8217;s own core modules instead of a custom one, when I needed to retain certain URL-s instead of using my own module&#8217;s controller. So, to hack Magento so that it returns it&#8217;s own core module with</p>

<div id="wp_syntax125" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*/*/*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax125');"><a href="javascript://select_all">select all</a></span>
<p>you shoud utilize this code on the controller level ideally:</p>

<div id="wp_syntax499" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRouteName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax499');"><a href="javascript://select_all">select all</a></span>
<p>Where &#8220;catalog&#8221; is the core module you want to fake.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/simulate-fake-a-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Only 3 products on Wishlist page</title>
		<link>http://www.netismine.com/magento/only-3-products-on-wishlist-page</link>
		<comments>http://www.netismine.com/magento/only-3-products-on-wishlist-page#comments</comments>
		<pubDate>Fri, 28 Oct 2011 10:20:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=365</guid>
		<description><![CDATA[I just finished debugging an issue where wishlist page in my account would only display 3 products.]]></description>
			<content:encoded><![CDATA[<p>I just finished debugging an issue where wishlist page in my account would only display 3 products.</p>
<p>Here’s how it goes.</p>
<p>Wishlist collection is being cached during runtime. When the parser reaches sidebar, Mage_Wishlist_Block_Customer_Sidebar class will limit this collection to only three results. Which is fine in default magento, since the wishlist sidebar is parsed only after the content part ends.</p>
<p>BUT, if you have something like this in your header:</p>

<div id="wp_syntax288" class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;wishlist/customer_sidebar&quot;</span> <span style="color: #000066;">as</span>=<span style="color: #ff0000;">&quot;wishlist&quot;</span> <span style="color: #000066;">before</span>=<span style="color: #ff0000;">&quot;cart_sidebar&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;wishlist/sidebar.phtml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><span class="note" onclick="SelectText('wp_syntax288');"><a href="javascript://select_all">select all</a></span>
<p>Translated, if you call the wishlist sidebar block in the header, header being parsed before the content area, collection will be limited to three products, hence causing the bug list in the content area to show only three products.</p>
<p>So, if something similar happens to you, you know where to look.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/only-3-products-on-wishlist-page/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove head block from page</title>
		<link>http://www.netismine.com/magento/remove-head-block-from-page</link>
		<comments>http://www.netismine.com/magento/remove-head-block-from-page#comments</comments>
		<pubDate>Fri, 26 Aug 2011 08:12:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=357</guid>
		<description><![CDATA[When developing a Magento custom module that should use an AJAX response of a page that's bigger then a few blocks, you'd probably like to have all those script files removed from head.]]></description>
			<content:encoded><![CDATA[<p>When developing a Magento custom module that should use an AJAX response of a page that&#8217;s bigger then a few blocks, you&#8217;d probably like to have all those script files removed from head. Now, you can either unset head block entirely, or just remove the script files. What you need to do is to create an observer on</p>

<div id="wp_syntax856" class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">controller_action_layout_render_before</pre></div></div><span class="note" onclick="SelectText('wp_syntax856');"><a href="javascript://select_all">select all</a></span>
<p>event, and create this observer function:</p>

<div id="wp_syntax289" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> removeHead<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getModuleName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;lazyload&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//put your module/controller/action name here so you don't remove head for every single page</span>
		<span style="color: #000088;">$layout</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core/layout'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$layout</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">unsetBlock</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/* second level of destruction - because this block has two lives .. like a final queen in an arcade */</span>
&nbsp;
		<span style="color: #000088;">$head</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$layout</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBlock</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'root'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$head</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$head</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setData</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'items'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$layout</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBlock</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'root'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'head'</span><span style="color: #339933;">,</span><span style="color: #000088;">$head</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/* third level of destruction - if the bitch respawns */</span>
		<span style="color: #666666; font-style: italic;">//$layout-&gt;getBlock('root')-&gt;setChild('head', new Mage_Core_Block_Template);</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax289');"><a href="javascript://select_all">select all</a></span>
<p>take a look at what it does, might give you some more ideas on how to battle the pest.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/remove-head-block-from-page/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Layered navigation not showing up on search results</title>
		<link>http://www.netismine.com/magento/layered-navigation-not-showing-up-on-search-results</link>
		<comments>http://www.netismine.com/magento/layered-navigation-not-showing-up-on-search-results#comments</comments>
		<pubDate>Fri, 05 Aug 2011 06:23:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=352</guid>
		<description><![CDATA[If you're having this error in Magento, that's probably because number of your search results exceeded 2000.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having this error in Magento, that&#8217;s probably because number of your search results exceeded 2000. Magento has a setting in admin that disables layered navigation if there are more than 2000 search results. You can remove this threshold here:<br />
System -> Configuration -> Catalog -> Catalog Search -> Apply Layered Navigation if Search Results are Less Than</p>
<p>But beware that this might impact your search result page performance. I did some minor benchmarking and it turned out it took my server about 300-400ms more to display search page with 3500 results if this limit is removed and layered navigation displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/layered-navigation-not-showing-up-on-search-results/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Bestsellers collection</title>
		<link>http://www.netismine.com/magento/get-bestsellers-collection</link>
		<comments>http://www.netismine.com/magento/get-bestsellers-collection#comments</comments>
		<pubDate>Thu, 23 Jun 2011 08:41:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=348</guid>
		<description><![CDATA[It&#8217;s actually pretty easy to get up to date list of bestselling products from your database. It all fits into just one sql query: SELECT `e`.*, `bs`.* FROM `catalog_product_entity` AS `e` INNER JOIN &#40;SELECT `sales_flat_order_item`.`product_id`, SUM&#40;`qty_ordered`&#41; AS `count` FROM `sales_flat_order_item` &#8230;]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s actually pretty easy to get up to date list of bestselling products from your database. It all fits into just one sql query:</p>

<div id="wp_syntax275" class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #008000;">`e`</span>.<span style="color: #CC0099;">*</span><span style="color: #000033;">,</span> <span style="color: #008000;">`bs`</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #008000;">`catalog<span style="color: #008080; font-weight: bold;">_</span>product<span style="color: #008080; font-weight: bold;">_</span>entity`</span> <span style="color: #990099; font-weight: bold;">AS</span> <span style="color: #008000;">`e`</span> <span style="color: #990099; font-weight: bold;">INNER</span> <span style="color: #990099; font-weight: bold;">JOIN</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #008000;">`sales<span style="color: #008080; font-weight: bold;">_</span>flat<span style="color: #008080; font-weight: bold;">_</span>order<span style="color: #008080; font-weight: bold;">_</span>item`</span>.<span style="color: #008000;">`product<span style="color: #008080; font-weight: bold;">_</span>id`</span><span style="color: #000033;">,</span> <span style="color: #000099;">SUM</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`qty<span style="color: #008080; font-weight: bold;">_</span>ordered`</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">AS</span> <span style="color: #008000;">`count`</span> <span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #008000;">`sales<span style="color: #008080; font-weight: bold;">_</span>flat<span style="color: #008080; font-weight: bold;">_</span>order<span style="color: #008080; font-weight: bold;">_</span>item`</span> <span style="color: #990099; font-weight: bold;">GROUP BY</span> <span style="color: #008000;">`product<span style="color: #008080; font-weight: bold;">_</span>id`</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">AS</span> <span style="color: #008000;">`bs`</span> <span style="color: #990099; font-weight: bold;">ON</span> bs.product_id <span style="color: #CC0099;">=</span> e.entity_id <span style="color: #990099; font-weight: bold;">ORDER BY</span> <span style="color: #008000;">`bs`</span>.<span style="color: #008000;">`count`</span> <span style="color: #990099; font-weight: bold;">DESC</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax275');"><a href="javascript://select_all">select all</a></span>
<p>In Magento&#8217;s language, that looks like this:</p>

<div id="wp_syntax651" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$select</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core/resource'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getConnection</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core_read'</span><span style="color: #009900;">&#41;</span>
        	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sales_flat_order_item'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'count'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'SUM(`qty_ordered`)'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product_id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$collection</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/product'</span><span style="color: #009900;">&#41;</span>
	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$collection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSelect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">join</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bs'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$select</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'bs.product_id = e.entity_id'</span><span style="color: #009900;">&#41;</span>
	<span style="color: #339933;">-&gt;</span><span style="color: #004000;">order</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bs.count DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax651');"><a href="javascript://select_all">select all</a></span>
<p>So, it suddenly became suprisingly easy to make that bestsellers custom module? <img src='http://www.netismine.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This is just for demonstration purposes, so make sure you replace the statics such as &#8216;sales_flat_order_item&#8217; with appropriate Magento&#8217;s API calls.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/get-bestsellers-collection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Magento SEO rewrite to your link</title>
		<link>http://www.netismine.com/magento/add-magento-seo-rewrite-to-your-link</link>
		<comments>http://www.netismine.com/magento/add-magento-seo-rewrite-to-your-link#comments</comments>
		<pubDate>Tue, 10 May 2011 08:31:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=344</guid>
		<description><![CDATA[I recently built a custom module whose controller extends Magento Catalog module, and I wanted it to use same rewrites as Catalog does on AJAX calls I was doing. ]]></description>
			<content:encoded><![CDATA[<p>I recently built a custom module whose controller extends Magento Catalog module, and I wanted it to use same rewrites as Catalog does on AJAX calls I was doing. So only thing I needed to do is this:</p>

<div id="wp_syntax373" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'_use_rewrite'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'standard/category/view/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax373');"><a href="javascript://select_all">select all</a></span>
<p>This will transform your native URL (in this case www.website.com/standard/category/view/) to the name of the actual category you&#8217;re calling. Of course, you also need to provide category ID in get <img src='http://www.netismine.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/add-magento-seo-rewrite-to-your-link/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic

Served from: www.netismine.com @ 2012-05-19 23:26:16 -->
