<?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>Thu, 19 Jan 2012 15:29:37 +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>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_syntax517" 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_syntax517');"><a href="javascript://select_all">select all</a></span>
<p>you shoud utilize this code on the controller level ideally:</p>

<div id="wp_syntax827" 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_syntax827');"><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_syntax579" 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_syntax579');"><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_syntax853" 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_syntax853');"><a href="javascript://select_all">select all</a></span>
<p>event, and create this observer function:</p>

<div id="wp_syntax488" 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_syntax488');"><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_syntax386" 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_syntax386');"><a href="javascript://select_all">select all</a></span>
<p>In Magento&#8217;s language, that looks like this:</p>

<div id="wp_syntax739" 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_syntax739');"><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_syntax539" 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_syntax539');"><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>
		<item>
		<title>Print collection MySQL query in Magento</title>
		<link>http://www.netismine.com/magento/print-collection-mysql-query-in-magento</link>
		<comments>http://www.netismine.com/magento/print-collection-mysql-query-in-magento#comments</comments>
		<pubDate>Sat, 09 Apr 2011 17:19:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=338</guid>
		<description><![CDATA[When working with collections, it's always useful to be able to have a peak at the actual MySQL code that gets executed, especially if you're doing some filtering, sorting etc. ]]></description>
			<content:encoded><![CDATA[<p>When working with collections, it&#8217;s always useful to be able to have a peak at the actual MySQL code that gets executed, especially if you&#8217;re doing some filtering, sorting, or some other custom development. You can see the actual query by executing this code on your collection object:</p>

<div id="wp_syntax481" 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;">getSelect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assemble</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax481');"><a href="javascript://select_all">select all</a></span>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/print-collection-mysql-query-in-magento/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento SQL conditionals</title>
		<link>http://www.netismine.com/magento/magento-sql-conditionals</link>
		<comments>http://www.netismine.com/magento/magento-sql-conditionals#comments</comments>
		<pubDate>Tue, 05 Apr 2011 10:13:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=336</guid>
		<description><![CDATA[I found a helpful post that lists available Magento SQL conditionals for managing collections. It maybe shows that Magento doesn't have a broad support for SQL collection filtering? ]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I found a helpful post that lists available <a href="http://www.knowmagento.com/available-conditionals-for-addattributetofilter/" target="_blank">Magento SQL conditionals</a> for managing collections. It maybe shows that Magento doesn&#8217;t have a broad support for SQL collection filtering? Anyway it&#8217;s linked above <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/magento-sql-conditionals/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add image to product programatically</title>
		<link>http://www.netismine.com/magento/add-image-to-product-programatically</link>
		<comments>http://www.netismine.com/magento/add-image-to-product-programatically#comments</comments>
		<pubDate>Sun, 03 Apr 2011 12:30:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=330</guid>
		<description><![CDATA[Today I found a neat little method inside Magento's API, the one that will allow you to assign an image to catalog product through code, wherever that image may sit in your filesystem.]]></description>
			<content:encoded><![CDATA[<p>Today I found a neat little method inside Magento&#8217;s API, the one that will allow you to assign an image to catalog product through code, wherever that image may sit in your filesystem. This is particularly useful if you are custom developing product importer or updater and you need to update product image with the one from the feed. This function is called addImageToMediaGallery() and can be run even if the product has not been saved yet. Here&#8217;s an example:</p>

<div id="wp_syntax262" class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addImageToMediaGallery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ABSOLUTE_PATH'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><span class="note" onclick="SelectText('wp_syntax262');"><a href="javascript://select_all">select all</a></span>
<p>This snippet will add an image residing in ABSOLUTE_PATH to product, assign it to &#8220;image&#8221; attribute, move it from original location (true), and uncheck the &#8220;Exclude&#8221; option (false). Here&#8217;s Magento documentation on the method:</p>
<p>void addImageToMediaGallery (string $file, [string|array $mediaAttribute = null], [boolean $move = false], [boolean $exclude = true])</p>
<p>string $file: file path of image in file system<br />
string|array $mediaAttribute: code of attribute with type &#8216;media_image&#8217;, leave blank if image should be only in gallery<br />
boolean $move: if true, it will move source file<br />
boolean $exclude: mark image as disabled in product page view</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/add-image-to-product-programatically/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Update to Magento 1.5 using shell</title>
		<link>http://www.netismine.com/magento/update-to-magento-1-5-using-shell</link>
		<comments>http://www.netismine.com/magento/update-to-magento-1-5-using-shell#comments</comments>
		<pubDate>Wed, 16 Mar 2011 14:04:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.netismine.com/?p=324</guid>
		<description><![CDATA[Ok, since Varien did a brilliant job of screwing up Magento upgrade using Downloader (so far I haven't found a way of doing it - Mage All Latest returns "already installed"), only reasonable way to do it is using shell.]]></description>
			<content:encoded><![CDATA[<p>Ok, since Varien did a brilliant job of screwing up Magento upgrade using Downloader (so far I haven&#8217;t found a way of doing it &#8211; Mage All Latest returns &#8220;already installed&#8221;), only reasonable way to do it is using shell. But there are quirks. First you have to edit file &#8220;mage&#8221; that sits in your installation root, otherwise you&#8217;re likely to get a memory limit problem. Edit your php location from this:</p>

<div id="wp_syntax928" class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"># REPLACE with your PHP5 binary path (example: /usr/local/php5/bin/php )
#MAGE_PHP_BIN=&quot;php&quot;</pre></div></div><span class="note" onclick="SelectText('wp_syntax928');"><a href="javascript://select_all">select all</a></span>
<p>to this, in my case, in yours it&#8217;s more likely different (<a href="http://4rapiddev.com/linux/linux-find-out-php-mysql-mysqld-httpd-command-file-location/">this page</a> might help you locate php):</p>

<div id="wp_syntax893" class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"># REPLACE with your PHP5 binary path (example: /usr/local/php5/bin/php )
MAGE_PHP_BIN=&quot;/opt/lampp/bin/php&quot;</pre></div></div><span class="note" onclick="SelectText('wp_syntax893');"><a href="javascript://select_all">select all</a></span>
<p>after that, execute this line:</p>

<div id="wp_syntax242" class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force</pre></div></div><span class="note" onclick="SelectText('wp_syntax242');"><a href="javascript://select_all">select all</a></span>
<p>That should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netismine.com/magento/update-to-magento-1-5-using-shell/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 7/14 queries in 0.023 seconds using disk: basic

Served from: www.netismine.com @ 2012-02-22 18:15:38 -->
