<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Magento &#8211; Filter by multiple categories</title>
	<atom:link href="http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/feed/" rel="self" type="application/rss+xml" />
	<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/</link>
	<description>The place for connecting you to the success</description>
	<lastBuildDate>Sat, 15 Oct 2011 11:00:40 +0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<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>By: modra ideja</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-3993</link>
		<dc:creator>modra ideja</dc:creator>
		<pubDate>Thu, 04 Aug 2011 22:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-3993</guid>
		<description>absolutely brilliant! exactly what i needed :)</description>
		<content:encoded><![CDATA[<p>absolutely brilliant! exactly what i needed <img src='http://asia-connect.com.vn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allan Brown</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-3764</link>
		<dc:creator>Allan Brown</dc:creator>
		<pubDate>Thu, 25 Mar 2010 13:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-3764</guid>
		<description>The custom SQL code (ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection) is not required, and infact it makes the collection class less useful.

Insead you should simply use the existing addAttributeToFilter function, passing in the following:

$$categoryId1 = 10;
$$categoryId1 = 12;
$this-&gt;_productCollection-&gt;addAttributeToFilter(
	\&#039;category_ids\&#039;,array(
		array(\&#039;finset\&#039;=&gt;array($categoryId1)), 
		array(\&#039;finset\&#039;=&gt;array($categoryId2))
	)
);

This has the advantage of working even if products are assigned to more than one category.  And can filter collections which have already been filtered by a seperate category.</description>
		<content:encoded><![CDATA[<p>The custom SQL code (ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection) is not required, and infact it makes the collection class less useful.</p>
<p>Insead you should simply use the existing addAttributeToFilter function, passing in the following:</p>
<p>$$categoryId1 = 10;<br />
$$categoryId1 = 12;<br />
$this-&gt;_productCollection-&gt;addAttributeToFilter(<br />
	\&#8217;category_ids\&#8217;,array(<br />
		array(\&#8217;finset\&#8217;=&gt;array($categoryId1)),<br />
		array(\&#8217;finset\&#8217;=&gt;array($categoryId2))<br />
	)<br />
);</p>
<p>This has the advantage of working even if products are assigned to more than one category.  And can filter collections which have already been filtered by a seperate category.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-3741</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Wed, 24 Feb 2010 09:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-3741</guid>
		<description>Try this:
&lt;code&gt;
ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
&lt;/code&gt;

if not, can u post the error to see what happen?</description>
		<content:encoded><![CDATA[<p>Try this:<br />
<code><br />
ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection<br />
</code></p>
<p>if not, can u post the error to see what happen?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remco</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-3106</link>
		<dc:creator>Remco</dc:creator>
		<pubDate>Thu, 21 Jan 2010 15:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-3106</guid>
		<description>Hi,

I&#039;ve also implemented (or tried to anyway) your code, but I can&#039;t get it to work.
I&#039;ve already tried putting this line ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection

on a single line, but that didn&#039;t help.
I&#039;m running magento 1.3.2.4

Any suggestions?

Thx in advance</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;ve also implemented (or tried to anyway) your code, but I can&#8217;t get it to work.<br />
I&#8217;ve already tried putting this line ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection</p>
<p>on a single line, but that didn&#8217;t help.<br />
I&#8217;m running magento 1.3.2.4</p>
<p>Any suggestions?</p>
<p>Thx in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-914</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Wed, 30 Sep 2009 08:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-914</guid>
		<description>Hi toutouille, because there is a bug in Magento, try to put the rewrite tags in just one line in the file: config.xml.</description>
		<content:encoded><![CDATA[<p>Hi toutouille, because there is a bug in Magento, try to put the rewrite tags in just one line in the file: config.xml.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toutouille</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-695</link>
		<dc:creator>toutouille</dc:creator>
		<pubDate>Mon, 07 Sep 2009 18:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-695</guid>
		<description>I&#039;m sorry but i run magento 1.3.2 and your script doesn&#039;t work.

First : in magento 1.3.2 i use Mage instead ModuleName...

Can you please explain better your function it will be great because i need this to work !!!!

Help me my friend ! ;-)</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry but i run magento 1.3.2 and your script doesn&#8217;t work.</p>
<p>First : in magento 1.3.2 i use Mage instead ModuleName&#8230;</p>
<p>Can you please explain better your function it will be great because i need this to work !!!!</p>
<p>Help me my friend ! <img src='http://asia-connect.com.vn/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-501</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Thu, 20 Aug 2009 11:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-501</guid>
		<description>sorry:
&lt;code&gt;

ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>sorry:<br />
<code></p>
<p>ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://asia-connect.com.vn/2009/07/magento-filter-by-multiple-categories/comment-page-1/#comment-500</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Thu, 20 Aug 2009 11:54:36 +0000</pubDate>
		<guid isPermaLink="false">http://asia-connect.com.vn/?p=357#comment-500</guid>
		<description>Because a Magento&#039;s bug if you put 
[...]


ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection


[...]
in two lines is not going to work.
Leave as follow:

ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection


By the way, really useful code! I love it!</description>
		<content:encoded><![CDATA[<p>Because a Magento&#8217;s bug if you put<br />
[...]</p>
<p>ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection</p>
<p>[...]<br />
in two lines is not going to work.<br />
Leave as follow:</p>
<p>ModuleName_Catalog_Model_Resource_Eav_Mysql4_Product_Collection</p>
<p>By the way, really useful code! I love it!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

