<?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>Manchester Magento web design, development, Magento hosting and aftercare :: sonassi</title>
	<atom:link href="http://www.sonassi.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sonassi.com</link>
	<description>Latest press releases, tutorials and thoughts on the world can be found here</description>
	<lastBuildDate>Thu, 02 Sep 2010 15:06:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento Sagepay Extension Ebizmarts faults and fixes</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-sagepay-extension-ebizmarts-faults-and-fixes/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-sagepay-extension-ebizmarts-faults-and-fixes/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 15:06:16 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[ebizmarts]]></category>
		<category><![CDATA[ebizmarts magento]]></category>
		<category><![CDATA[faulty sagepay]]></category>
		<category><![CDATA[magento sagepay]]></category>
		<category><![CDATA[magento sagepay ebizmarts]]></category>
		<category><![CDATA[magento sagepay extension faulty]]></category>
		<category><![CDATA[sagepay extension for magento]]></category>
		<category><![CDATA[sagepay magento]]></category>
		<category><![CDATA[sagepay not working magento]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1606</guid>
		<description><![CDATA[A client of ours needed to upgrade to a direct payment method for SagePay, so with Ebizmart&#8217;s Sagepay approved extension, we grabbed a copy and popped it on. Unfortunately, it wasn&#8217;t long before we started experiencing problems. We have contacted Pablo @ Ebizmarts who was relatively receptive about the issues, hopefully, they will be fixed [...]]]></description>
			<content:encoded><![CDATA[<p>A client of ours needed to upgrade to a direct payment method for SagePay, so with Ebizmart&#8217;s Sagepay approved extension, we grabbed a copy and popped it on. Unfortunately, it wasn&#8217;t long before we started experiencing problems. We have contacted Pablo @ Ebizmarts who was relatively receptive about the issues, hopefully, they will be fixed in the next release.</p>
<p>If we experience any other faults with the extension, we&#8217;ll be sure to update this post (although, for a &#8220;paid&#8221; extension, I&#8217;m hoping that isn&#8217;t the case).</p>
<h3>Incorrect processing status</h3>
<p>Even though there is an option to change the processing (after payment is authorised) status in <strong>System > Configuration > Payment Methods</strong>, it appears that this field is ignored. This is a quick fix thankfully.</p>
<p>Editing <code>./app/code/local/Ebizmarts/SagePayServer/controllers/PaymentController.php</code> on line +503, change</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> Mage_Sales_Model_Order<span style="color: #339933;">::</span><span style="color: #004000;">STATE_PROCESSING</span><span style="color: #339933;">;</span></pre></div></div>

<p>To</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span>‘payment<span style="color: #339933;">/</span>sagepayserver_moto<span style="color: #339933;">/</span>order_status’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then you also need to uncomment these lines,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*$order-&gt;setState(
  $status, false,
  Mage::helper('sagepayserver')-&gt;__('Invoice #%s created', $invoice-&gt;getIncrementId())
);*/</span></pre></div></div>

<h3>MOTO order creation in backend fails</h3>
<p>It is not possible to create an order in the backend (one of the main features of this extension), because of an incorrect class name. Fortunately, changing this is an easy fix.</p>
<p>Editing <code>./app/code/local/Ebizmarts/SagePayServer/controllers/PaymentController.php</code> on line +140, change</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Ebizmarts_SagePayServerDot_Helper_Data'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></div></div>

<p>To</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Ebizmarts_SagePayServer_Helper_Data'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-sagepay-extension-ebizmarts-faults-and-fixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Limitations on the Flat Catalogue in Magento</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mysql-limitations-on-the-flat-catalogue-in-magento/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mysql-limitations-on-the-flat-catalogue-in-magento/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 17:37:31 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Can't initialize indexer process]]></category>
		<category><![CDATA[magento flat catalog]]></category>
		<category><![CDATA[magento flat catalogue]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1598</guid>
		<description><![CDATA[We recently came across this problem with a customer who had painstakingly created every attribute possible for all his products. The result, a brilliantly user-friendly store, the downside, flat-catalogue product won&#8217;t work!
The error you are likely to see in Magento is as vague as
Can&#8217;t initialize indexer process.
A table in MySQL has a limitation of 65535 [...]]]></description>
			<content:encoded><![CDATA[<p>We recently came across this problem with a customer who had painstakingly created every attribute possible for all his products. The <em>result</em>, a brilliantly user-friendly store, the <em>downside</em>, flat-catalogue product won&#8217;t work!</p>
<p>The error you are likely to see in Magento is as vague as
<div class="mag_alert">Can&#8217;t initialize indexer process.</div>
<p>A table in MySQL has a limitation of 65535 bytes of overall row length, when you present a multitude of attributes (specifically drop-down/multiple select/text/image), they are allocated a 255 character limit, as per MySQL&#8217;s <code>varchar</code>. In Magento starting from 1.3 the products catalog in the &#8220;flat&#8221; mode suffers from this limitation depending on the number and combination of the product attributes that participate in the flat product index.</p>
<p>Depending on what our client wants to do, there will likely be an extension to bypass this fault and allow some intelligence to modify the SQL statement and the resulting flat table to allow more than the ~85 text field/multiple select/image limitation. </p>
<p>A quick workaround (but not necessarily ideal) is to hack (read: extend) some core functions and override the declarations. </p>
<p>In <code>Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer</code></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~530
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_isFlatTableExists<span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;CREATE TABLE <span style="color: #006699; font-weight: bold;">{$tableNameQuote}</span> (<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$fieldProp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #339933;">+</span>      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$fieldProp</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;varchar(255)&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">+</span>        <span style="color: #000088;">$fieldProp</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;varchar(64)&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;  <span style="color: #009933; font-weight: bold;">%s</span>,<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_sqlColunmDefinition<span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fieldProp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">...</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># ~633
</span>  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$addIndexes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$indexName</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$indexProp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' ADD %s,'</span><span style="color: #339933;">,</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_sqlIndexDefinition<span style="color: #009900;">&#40;</span><span style="color: #000088;">$indexName</span><span style="color: #339933;">,</span> <span style="color: #000088;">$indexProp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>  <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;varchar(255)&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;varchar(64)&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getWriteAdapter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In the example above, I just changed the 255 to 65 globally for testing purposes, it would be a perfect solution if your attribute values are less than 64 characters, otherwise, you&#8217;ll need to be clever with the assignment of <code>varchar</code> length and whether to assign <code>text/blob</code> instead.</p>
<p><strong>Read the white paper on the fault</strong> <a href='http://www.sonassi.com/wp-content/uploads/2010/08/SUP-MySQLLimitationsontheFlatCatalogProduct-29Jul10-0343PM-17.pdf'>SUP-MySQLLimitationsontheFlatCatalog(Product)-29Jul10-0343PM-17</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mysql-limitations-on-the-flat-catalogue-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Like our standard Magento Wordpress integration? Try the DELUXE version!</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/like-our-standard-magento-wordpress-integration-try-the-deluxe-version/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/like-our-standard-magento-wordpress-integration-try-the-deluxe-version/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 17:11:25 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[deluxe magento]]></category>
		<category><![CDATA[deluxe magento integration]]></category>
		<category><![CDATA[deluxe wordpress]]></category>
		<category><![CDATA[integrate wordpress admin magento]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[magento wordpress integration]]></category>
		<category><![CDATA[short tags magento]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1576</guid>
		<description><![CDATA[
After the success of the first release with over 4,000 downloads, the massive popularity of Magento and the outstanding usability of Wordpress, we thought we might release a slightly more advanced version of the Magento and Wordpress integration &#8230;
the Deluxe edition
You name it, it does it! Both applications have been completely merged. 

Standard Magento admin [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://deluxe-wordpress.sonassi.com/blog/" title="Deluxe Magento Wordpress Integration"><img src="http://www.sonassi.com/wp-content/uploads/2010/07/magento_wordpress_integration.png" alt="Deluxe Magento Wordpress Integration" title="Deluxe Magento Wordpress Integration" width="656" height="352" class="size-full wp-image-1580" /></a></p>
<p>After the success of the first release with over 4,000 downloads, the massive popularity of Magento and the outstanding usability of Wordpress, we thought we might release a slightly more advanced version of the Magento and Wordpress integration &#8230;</p>
<h3><a href="http://deluxe-wordpress.sonassi.com/" title="the Deluxe edition">the Deluxe edition</a></h3>
<p>You name it, it does it! Both applications have been completely merged. </p>
<ul>
<li>Standard Magento admin users are able to handle all administration tasks from the Magento control panel &#8211; or standalone users can use the Wordpress admin on its own.</li>
<li>Magento customers have their profiles directly lined to Wordpress allowing them to post comments and change profile information with ease.</li>
<li>Magento layout short-codes can be used within Wordpress posts and pages <em>(Eg. {{block type=&#8221;" &#8230; }}</em></li>
<li>The Wordpress theme is controlled directly by Magento&#8217;s MVC architecture, allowing infinite flexibility with XML layouts &#8230; <em>no more get_sidebar()!</em></li>
<li>Bundled with a number of starter widgets to get recent comments, latest posts or post tags.</li>
<li>Support for both Magento 1.3 and 1.4</li>
</ul>
<p>The deluxe edition will be available on the <a href="http://www.magentocommerce.com/magento-connect/developer/Sonassi+Hosting+%26+Design" title="Sonassi MagentoConnect">Sonassi MagentoConnect</a> profile &#8211; we&#8217;ll update this blog when it is released.</p>
<p><strong>What are you waiting for, take the <a href="http://deluxe-wordpress.sonassi.com/" title="the Deluxe edition">deluxe edition</a> for a test drive!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/like-our-standard-magento-wordpress-integration-try-the-deluxe-version/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Split your Magento sitemap into smaller chunks</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/split-your-magento-sitemap-into-smaller-chunks/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/split-your-magento-sitemap-into-smaller-chunks/#comments</comments>
		<pubDate>Thu, 13 May 2010 21:14:31 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento chunk sitemap]]></category>
		<category><![CDATA[magento sitemap chunks]]></category>
		<category><![CDATA[magento sitemap split]]></category>
		<category><![CDATA[magento split sitemap]]></category>
		<category><![CDATA[sonassi_sitemapchunk]]></category>
		<category><![CDATA[split sitemap magento]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1570</guid>
		<description><![CDATA[We deal with large scale e-commerce stores on a daily basis and a recent fix we had to implement was to allow the sitemap generated to be created in smaller chunks &#8211; so not to breach the 50,000 URL or 10MB limitation placed by Google Webmaster tools.
We have packaged up this little extension for you [...]]]></description>
			<content:encoded><![CDATA[<p>We deal with large scale e-commerce stores on a daily basis and a recent fix we had to implement was to allow the sitemap generated to be created in smaller chunks &#8211; so not to breach the 50,000 URL or 10MB limitation placed by Google Webmaster tools.</p>
<p>We have packaged up this little extension for you and popped it over on Magento connect. The extension is still pending at the moment, but we&#8217;ll update the link once it is live:</p>
<p><a href="http://www.magentocommerce.com/magento-connect/Sonassi%20Hosting%20&#038;%20Design/extension/3629/sonassi_sitemapchunk" title="Sonassi_SitemapChunk">Download Sonassi_SitemapChunk &#187;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/split-your-magento-sitemap-into-smaller-chunks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Network maintenance updates have moved&#8230;</title>
		<link>http://www.sonassi.com/server-maintenance/network-maintenance-updates-have-moved/</link>
		<comments>http://www.sonassi.com/server-maintenance/network-maintenance-updates-have-moved/#comments</comments>
		<pubDate>Mon, 10 May 2010 10:55:52 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Server Maintenance]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1561</guid>
		<description><![CDATA[&#8230;to sonassihosting.com
Our hosting division now has its own dedicated website which will report network status, updates and information. Unfortunately, we no longer will be providing server maintenance information via sonassi.com.
Visit sonassihosting.com now!
]]></description>
			<content:encoded><![CDATA[<h2>&#8230;to <a href="http://sonassihosting.com" title="sonassihosting.com">sonassihosting.com</a></h2>
<p>Our hosting division now has its own dedicated website which will report network status, updates and information. Unfortunately, we no longer will be providing server maintenance information via sonassi.com.</p>
<p>Visit <a href="http://sonassihosting.com" title="sonassihosting.com">sonassihosting.com</a> now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/server-maintenance/network-maintenance-updates-have-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMPORTANT: Network-wide repair required [SCHEDULED]</title>
		<link>http://www.sonassi.com/server-maintenance/network-wide-repair-required-downtime-will-be-incurred/</link>
		<comments>http://www.sonassi.com/server-maintenance/network-wide-repair-required-downtime-will-be-incurred/#comments</comments>
		<pubDate>Wed, 05 May 2010 21:08:04 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Server Maintenance]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1550</guid>
		<description><![CDATA[window.location.href="http://www.sonassihosting.com/blog/network-status/important-network-wide-repair-required/";
Front end node sms-sagat has suffered a hard drive failure causing its RAID array to temporarily run degraded. An engineer has been appointed to carry out the replacement, but at this point we do not have a confirmed time.
At this point we can confirm there has been no data loss and backups are being performed [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript">window.location.href="http://www.sonassihosting.com/blog/network-status/important-network-wide-repair-required/";</script></p>
<p>Front end node <strong>sms-sagat</strong> has suffered a hard drive failure causing its RAID array to temporarily run degraded. An engineer has been appointed to carry out the replacement, but at this point we do not have a confirmed time.</p>
<p>At this point we can confirm there has been no data loss and backups are being performed offsite more frequently to ensure a level of redundancy for any customer data stored on this machine.</p>
<p>The server will need to be powered down for approximately 25 minutes during the replacement. </p>
<p>Sms-sagat is the front node for our network (all internal/external traffic is filtered through this server), as a result, there will be network-wide downtime affecting <em>all customers</em></p>
<p><strong>UPDATE [Friday 7th May 17:19]</strong><br />
The replacement has now been scheduled for <strong>Monday 10th May 8:00am > 9:00am</strong>. Between these hours, ALL services will be unavailable.</p>
<p>Please check back for latest updates. We apologise for any inconvinience this may cause. As always, we reccomend you follow our twitter updates for any network related issues <a href="http://search.twitter.com/search?q=+%23sonassi_network+from%3Asonassihosting" title="follow our Twitter updates">http://search.twitter.com/search?q=+%23sonassi_network+from%3Asonassihosting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/server-maintenance/network-wide-repair-required-downtime-will-be-incurred/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mass delete products in Magento</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-delete-products-in-magento/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-delete-products-in-magento/#comments</comments>
		<pubDate>Sat, 01 May 2010 14:11:06 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[bulk product delete magento]]></category>
		<category><![CDATA[delete products magento]]></category>
		<category><![CDATA[magento delete admin crash]]></category>
		<category><![CDATA[magento delete admin hang]]></category>
		<category><![CDATA[magento product delete bulk]]></category>
		<category><![CDATA[mass delete magento]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1533</guid>
		<description><![CDATA[
Please note. This article applies to Magento 1.4 and greater only. Some elements of the code are compatible with 1.3, but it will not work in 1.3 and below without modification.

If you have a BIG catalogue &#8211; you soon find out that management via the admin can just become tedious. We performed a product import [...]]]></description>
			<content:encoded><![CDATA[<p class="mag_alert">
Please note. This article applies to Magento 1.4 and greater only. Some elements of the code are compatible with 1.3, but it will not work in 1.3 and below without modification.
</p>
<p>If you have a BIG catalogue &#8211; you soon find out that management via the admin can just become tedious. We performed a product import of 80,000 products which unfortunately was supplied with inaccurate information. </p>
<p>Because of the complexity of the products and sheer volume of attributes- it is quicker to delete then reimport. But deleting via the admin for 80k products is nigh on impossible.</p>
<p>The easiest way to pull this off is by means of a quick script. The key to this script is that the indexing functionality is disabled entirely for the process, then enabled again at the end &#8211; requiring a manual update at the end, or you could code in an index refresh using our article on <a href="http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/" title="refreshing catalogue indexes using a php script">refreshing catalogue indexes using a php script</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #990000;">ob_end_flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Started &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d/m/y h:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MAGENTO'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;/domains/example.com/http&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">require_once</span> MAGENTO <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/app/Mage.php'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">umask</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">setCurrentStore</span><span style="color: #009900;">&#40;</span>Mage_Core_Model_App<span style="color: #339933;">::</span><span style="color: #004000;">ADMIN_STORE_ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000088;">$products</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;">-&gt;</span><span style="color: #004000;">addFieldToFilter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'data_set'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1544</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$undoSql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;UPDATE index_process SET mode = 'manual' WHERE index_process.process_id =<span style="color: #006699; font-weight: bold;">$i</span> LIMIT 1;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$undoSql</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;UPDATE index_process SET mode = 'real_time' WHERE index_process.process_id =<span style="color: #006699; font-weight: bold;">$i</span> LIMIT 1;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$mysqli</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_write'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$total_products</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$products</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$products</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$product</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">++%</span><span style="color:#800080;">100</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$cur</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d/m/y h:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$time</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d/m/y h:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">/</span><span style="color: #000088;">$total_products</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">% d</span>eleted (<span style="color: #006699; font-weight: bold;">$count</span>/<span style="color: #006699; font-weight: bold;">$total_products</span>) &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">/</span><span style="color: #000088;">$cur</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; p/s &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;h:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Ended &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d/m/y h:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$undoSql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>In our case, we filtered the type of products by its &#8220;Data Set&#8221; &#8211; an attribute assigned to that batch of products, but you can change this to suit any means of filtering.</p>
<p>The above script runs at around 25 products deleted per second.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-delete-products-in-magento/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Catalog Search Index refresh running slow or halting/freezing</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 09:59:20 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[blank screen when refreshing indexes]]></category>
		<category><![CDATA[catalogsearch_fulltext]]></category>
		<category><![CDATA[index timeout error]]></category>
		<category><![CDATA[magento Catalog Search Index]]></category>
		<category><![CDATA[magento fulltext]]></category>
		<category><![CDATA[magento index blank screen]]></category>
		<category><![CDATA[magento index slow]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1525</guid>
		<description><![CDATA[
Please note. This article applies to Magento 1.4 and greater only.

A lot of people are starting to find that with large catalogues that the new indexing manager in Magento 1.4 may be starting to time out when generating Catalog Search Index &#8211; Rebuild Catalog product fulltext search index. This usually results in a blank screen [...]]]></description>
			<content:encoded><![CDATA[<p class="mag_alert">
Please note. This article applies to Magento 1.4 and greater only.
</p>
<p>A lot of people are starting to find that with large catalogues that the new indexing manager in Magento 1.4 may be starting to time out when generating <strong>Catalog Search Index &#8211; <em>Rebuild Catalog product fulltext search index</em></strong>. This usually results in a <em>blank screen when refreshing indexes</em> or a <em>index timeout error</em></p>
<p>This is largely due to a number of factors:</p>
<ul>
<li>the number of products in a catalogue</li>
<li>the number of store views</li>
<li>the apache/lighttpd timeout setting</li>
<li>the php.ini maximum execution time &#038; script input time</li>
<li>an already inflated <code>catalogsearch_fulltext</code> MySQL table</li>
<li>the lock file is still place from the previous time it ran preventing it running again</li>
</ul>
<p>To remedy this issue, you&#8217;ll need to know a few facts. The <code>catalogsearch_fulltext</code> table is essentially re-built entirely when running this command. BUT, if you once had multiple store views (or forgot the delete the default French/German views), the table will contact a record for each product PER store view. So it is always best to <strong>truncate catalogsearch_fulltext</strong> before starting. Either log in via MySQL command line and run</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">truncate</span> catalogsearch_fulltext<span style="color: #000033;">;</span></pre></div></div>

<p>or log into phpMyAdmin and hit the <strong>empty</strong> link.</p>
<p>For 1 store view with a dedicated server (2.5GHz Quad core), it takes an average of <strong>0.003</strong> minutes per product to insert the <code>fulltext</code> field. </p>
<p>So in our example, we have a store with 200,000 SKUs and a single store view, so</p>
<p><a name="calculate"></a><code>200,000 (skus) * 0.003 (time p/p) * 1 (store view) * 60 = 36000 seconds</code></p>
<p>Which means it would be silly to execute the command via the web server, it would be preferred to run a command line executable. The new index manager assigns a &#8220;process ID&#8221; to each type of index:</p>
<ol>
<li>Product Attributes  	 Index product attributes for layered navigation building</li>
<li>Product Prices 	Index product prices</li>
<li>Catalog Url Rewrites 	Index product and categories url rewrites </li>
<li>Product Flat Data 	Reorganize EAV product structure to flat structure</li>
<li>Category Flat Data 	Reorganize EAV category structure to flat structure </li>
<li>Category Products 	Indexed category/products association</li>
<li>Catalog Search Index 	Rebuild Catalog product fulltext search index</li>
<li>Stock status 	Index product stock status </li>
</ol>
<p>In our case, <strong>number 7</strong> is the offending (read: slow) command. So we can run this manually using a command line script instead. Change your php.ini for your <strong>php-cli</strong> installation to suit the maximum time out shown above <a href="#calculate">(36000 seconds for us)</a>. </p>
<p>Then create a file in the root directory of your Magento installation, we&#8217;ll call it <code>fulltext.php</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'app/Mage.php'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">umask</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Mage <span style="color: #339933;">::</span> <span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;default&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Mage<span style="color: #339933;">::</span><span style="color: #990000;">log</span><span style="color: #009900;">&#40;</span>”Started Rebuilding Search Index At<span style="color: #339933;">:</span> ” <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span>”d<span style="color: #339933;">/</span>m<span style="color: #339933;">/</span>y h<span style="color: #339933;">:</span>i<span style="color: #339933;">:</span>s”<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;truncate catalogsearch_fulltext;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysqli</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_write'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$process</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span>’index<span style="color: #339933;">/</span>process’<span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$process</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">reindexAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Mage<span style="color: #339933;">::</span><span style="color: #990000;">log</span><span style="color: #009900;">&#40;</span>”Finished Rebuilding Search Index At<span style="color: #339933;">:</span> ” <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span>”d<span style="color: #339933;">/</span>m<span style="color: #339933;">/</span>y h<span style="color: #339933;">:</span>i<span style="color: #339933;">:</span>s”<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then it is as simple as logging in through SSH and running:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#php fulltext.php</pre></div></div>

<p>Sit back and drink your coffee &#8211; as, on a large catalogue, <em>this can take a while!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Magento random block generator / block randomiser</title>
		<link>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-random-block-generator-block-randomiser/</link>
		<comments>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-random-block-generator-block-randomiser/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 10:49:10 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento ad rotate]]></category>
		<category><![CDATA[magento random]]></category>
		<category><![CDATA[magento random block]]></category>
		<category><![CDATA[magento rotate]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1522</guid>
		<description><![CDATA[This could be pretty useful if you want to combine XML block control with a random content display (eg. banner ads).
Very easily achieved, simply create 1 file in ./base/default/template/page/html/random_block.phtml

 &#60;?php 
&#160;
  $children = $this-&#62;getSortedChildren&#40;&#41;;
&#160;
  if&#40;is_array&#40;$children&#41;&#41; &#123;
    shuffle&#40;$children&#41;;
    echo $this-&#62;getChildHtml&#40;$children&#91;0&#93;&#41;; 
  &#125;
&#160;
 ?&#62;

Then in your relevant XML [...]]]></description>
			<content:encoded><![CDATA[<p>This could be pretty useful if you want to combine XML block control with a random content display (eg. banner ads).</p>
<p>Very easily achieved, simply create 1 file in <strong>./base/default/template/page/html/random_block.phtml</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
  <span style="color: #000088;">$children</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSortedChildren</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$children</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">shuffle</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$children</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getChildHtml</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$children</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Then in your relevant XML file &#8211; control the output by using:</p>

<div 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;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;core/template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;left.callout.random&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;page/html/random_block.phtml&quot;</span> <span style="color: #000066;">before</span>=<span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</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;core/template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;left.callout.random1&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;callouts/left_col.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;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgWidth&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>240<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/width<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgSrc&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;src<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>images/image1.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/src<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgAlt&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;alt&quot;</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;catalog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;alt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>some alt text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alt<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setLinkUrl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>link url<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<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 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;core/template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;left.callout.random2&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;callouts/left_col.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;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgWidth&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>240<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/width<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgSrc&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;src<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>images/image2.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/src<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setImgAlt&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;alt&quot;</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;catalog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;alt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>some alt text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alt<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setLinkUrl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>link url<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<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 style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/block<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You can add any type of block you want and it will just grab one at random.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/knowledge-base/magento-knowledge-base/magento-random-block-generator-block-randomiser/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Take Windows with you &#8230;</title>
		<link>http://www.sonassi.com/you-me-and-sonassi/take-windows-with-you/</link>
		<comments>http://www.sonassi.com/you-me-and-sonassi/take-windows-with-you/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:31:37 +0000</pubDate>
		<dc:creator>ben@sonassi.com</dc:creator>
				<category><![CDATA[You, me and Sonassi]]></category>
		<category><![CDATA[ht2 hd2]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.sonassi.com/?p=1505</guid>
		<description><![CDATA[
&#160;

&#8230; but feel free to come back&#8221;


HTC dropped by today as expected to give us the world-wind tour of the HTC HD2 Windows Mobile Smartphone. Given I&#8217;m a Nokia fanboy, it was a hard sale, but I have to say I was pleasantly impressed. If not a bit iPhone-esque with its pinch zooming and kinetic [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sonassi.com/wp-content/uploads/2010/03/twwy1.jpg" alt="Take windows with you" title="Take windows with you" class="left" /></p>
<p>&nbsp;</p>
<p>
&#8230; but feel free to come back&rdquo;
</p>
<p>
HTC dropped by today as expected to give us the world-wind tour of the HTC HD2 Windows Mobile Smartphone. Given I&#8217;m a Nokia fanboy, it was a hard sale, but I have to say I was pleasantly impressed. If not a bit iPhone-esque with its pinch zooming and kinetic scrolling, it worked well and didn&#8217;t feel slow or laggy at all. But given its 1GHz CPU &#8211; I should hope not! The photos were also particularly impressive with its touch-focus and 5MP camera.
</p>
<h3>But who cares about the phone</h3>
<p>
<strong>&#8230; what goodies did we get?</strong> Well, we can&#8217;t deny that bribery is the preferred method of business, and with food as the currency &#8211; you can&#8217;t go wrong with our team. Today&#8217;s bizarre gift from HTC was a Windows Mobile battenburg cake (<em>featured left</em>) &#8211; which I have to admit, was pretty creative. Also, one of the guys here are likely to win a free HTC HD2 just for participating!
</p>
<p>
All in all, it was a welcome break from the hard graft (don&#8217;t tell the clients though!) and nice to see a clever new gadget!
</p>
<p><br class="clear" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonassi.com/you-me-and-sonassi/take-windows-with-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>