<?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>The Magento Expert</title>
	<atom:link href="https://www.the-mage-expert.com/tag/collection/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.the-mage-expert.com</link>
	<description>Your Magento Commerce Expert</description>
	<lastBuildDate>Thu, 05 Nov 2026 21:47:58 +0000</lastBuildDate>
	<language>de-DE</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.6</generator>
	<item>
		<title>Filtering product collections by category</title>
		<link>https://www.the-mage-expert.com/1731/filtering-product-collections-by-category/</link>
		<comments>https://www.the-mage-expert.com/1731/filtering-product-collections-by-category/#comments</comments>
		<pubDate>Fri, 26 Feb 2021 07:22:18 +0000</pubDate>
		<dc:creator><![CDATA[Mex]]></dc:creator>
				<category><![CDATA[Magento Solutions]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[Magento 2]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">https://www.the-mage-expert.com/?p=1731</guid>
		<description><![CDATA[If you want to filter a product collection by categories as well, the following code may help. Once the category filter is applied, the collection contains only products from the specified categories, in this example category IDs 123 and 456.&#8230;]]></description>
				<content:encoded><![CDATA[<p>If you want to filter a product collection by categories as well, the following code may help. Once the category filter is applied, the collection contains only products from the specified categories, in this example category IDs 123 and 456.</p><pre class="crayon-plain-tag">$_productCollection = $block-&gt;getLoadedProductCollection();
$_productCollection-&gt;clear();
$values = &quot;123,456&quot;; // Your category IDs
$conditionType = &quot;in&quot;;
$_productCollection-&gt;addCategoriesFilter([$conditionType =&gt; $values])-&gt;load();</pre><p></p>]]></content:encoded>
			<wfw:commentRss>https://www.the-mage-expert.com/1731/filtering-product-collections-by-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the size of a collection programmatically</title>
		<link>https://www.the-mage-expert.com/1271/setting-the-size-of-a-collection-programmatically/</link>
		<comments>https://www.the-mage-expert.com/1271/setting-the-size-of-a-collection-programmatically/#comments</comments>
		<pubDate>Thu, 16 Mar 2017 10:27:16 +0000</pubDate>
		<dc:creator><![CDATA[Mex]]></dc:creator>
				<category><![CDATA[Magento Solutions]]></category>
		<category><![CDATA[collection]]></category>

		<guid isPermaLink="false">https://www.the-mage-expert.com/?p=1271</guid>
		<description><![CDATA[Use this code to set the page size of a Magento collection programmatically: [crayon-6af33ffbb32d7/]]]></description>
				<content:encoded><![CDATA[<p>Use this code to set the page size of a Magento collection programmatically:</p><pre class="crayon-plain-tag">$orders = Mage::getResourceModel('sales/order_collection')-&gt;setPageSize(100);</pre><p></p>]]></content:encoded>
			<wfw:commentRss>https://www.the-mage-expert.com/1271/setting-the-size-of-a-collection-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading  a model without using IDs</title>
		<link>https://www.the-mage-expert.com/686/magento-loading-model-without-ids/</link>
		<comments>https://www.the-mage-expert.com/686/magento-loading-model-without-ids/#comments</comments>
		<pubDate>Thu, 09 Oct 2014 08:09:29 +0000</pubDate>
		<dc:creator><![CDATA[Mex]]></dc:creator>
				<category><![CDATA[Magento Solutions]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">https://www.the-mage-expert.com/?p=686</guid>
		<description><![CDATA[Sometimes there is no id available for loading a model. If thats the case, the following code might help out. It loads a collection by an attribute like name or sku. [crayon-6af33ffbb3722/] Afterwards, it is possible to iterate over the&#8230;]]></description>
				<content:encoded><![CDATA[<p>Sometimes there is no id available for loading a model. If thats the case, the following code might help out. It loads a collection by an attribute like name or sku.</p>
<p></p><pre class="crayon-plain-tag">$collectionData = Mage::getModel('modelname')-&gt;getCollection()-&gt;addFieldToFilter('attribute', 'attribute value');</pre><p></p>
<p>Afterwards, it is possible to iterate over the collection, get the id and load the model using that id.</p>]]></content:encoded>
			<wfw:commentRss>https://www.the-mage-expert.com/686/magento-loading-model-without-ids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the SQL of a collection</title>
		<link>https://www.the-mage-expert.com/358/magento-getting-sql-of-collection/</link>
		<comments>https://www.the-mage-expert.com/358/magento-getting-sql-of-collection/#comments</comments>
		<pubDate>Thu, 16 May 2013 10:12:56 +0000</pubDate>
		<dc:creator><![CDATA[Mex]]></dc:creator>
				<category><![CDATA[Magento Solutions]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">https://www.the-mage-expert.com/?p=358</guid>
		<description><![CDATA[Use the following code to get the underlying SQL of a Magento collection: [crayon-6af33ffbb3993/]]]></description>
				<content:encoded><![CDATA[<p>Use the following code to get the underlying SQL of a Magento collection:</p>
<p></p><pre class="crayon-plain-tag">$sql = (string)$collection-&gt;getSelect();</pre><p></p>]]></content:encoded>
			<wfw:commentRss>https://www.the-mage-expert.com/358/magento-getting-sql-of-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the SQL query of a collection</title>
		<link>https://www.the-mage-expert.com/66/getting-the-sql-query-of-a-collection/</link>
		<comments>https://www.the-mage-expert.com/66/getting-the-sql-query-of-a-collection/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 14:08:26 +0000</pubDate>
		<dc:creator><![CDATA[Mex]]></dc:creator>
				<category><![CDATA[Magento Solutions]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">https://www.the-mage-expert.com/?p=66</guid>
		<description><![CDATA[This short piece of code returns the SQL query behind a Magento collection. [crayon-6af33ffbb3c11/]]]></description>
				<content:encoded><![CDATA[<p>This short piece of code returns the SQL query behind a Magento collection.</p><pre class="crayon-plain-tag">$select = $collection-&gt;getSelect()-&gt;__toString();</pre><p></p>]]></content:encoded>
			<wfw:commentRss>https://www.the-mage-expert.com/66/getting-the-sql-query-of-a-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
