<?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>NY INTERACTIVE AGENCY « iFUEL INTERACTIVE / AGENCY212 &#187; Development</title>
	<atom:link href="http://blogs.ifuelinteractive.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.ifuelinteractive.com</link>
	<description>A NY INTERACTIVE AGENCY</description>
	<lastBuildDate>Fri, 02 Jul 2010 15:38:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FIX Google Analytics _gaq is not defined In Magento 1.4.0.1</title>
		<link>http://blogs.ifuelinteractive.com/2010/07/02/fix-google-analytics-_gaq-is-not-defined-in-magento-1-4-0-1/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/07/02/fix-google-analytics-_gaq-is-not-defined-in-magento-1-4-0-1/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 15:33:18 +0000</pubDate>
		<dc:creator>Robert Nicklin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=259</guid>
		<description><![CDATA[Locate: /app/design/frontend/base/default/layout/googleanalytics.xml
Replace With:


&#60;default&#62;
&#60;!-- Mage_GoogleAnalytics --&#62;
&#60;reference name=&#34;before_body_end&#34;&#62;
&#60;block type=&#34;googleanalytics/ga&#34; name=&#34;google_analytics&#34; as=&#34;google_analytics&#34; /&#62;
&#60;/reference&#62;
&#60;/default&#62;
&#60;/layout&#62;


^ This will move the Google Analytics code to before the closing of the HTML &#60;/body&#62; tag (for faster page load times)
Locate: /app/code/core/Mage/GoogleAnalytics/Block/ga.php
Replace at around LINE 171: 


&#60;!-- BEGIN GOOGLE ANALYTICS CODE --&#62;
&#60;script type=&#34;text/javascript&#34;&#62;
//&#60;![CDATA[
var _gaq = _gaq &#124;&#124; [];
_gaq.push([&#34;_setAccount&#34;, &#34;&#039; . $this-&#62;getAccount() . &#039;&#34;]);
_gaq.push([&#34;_trackPageview&#34;, &#34;&#039;.$this-&#62;getPageName().&#039;&#34;]);
(function() {
var [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Locate: /app/design/frontend/base/default/layout/googleanalytics.xml</strong></p>
<p>Replace With:</p>
<pre>
<pre class="brush: php">
&lt;default&gt;
&lt;!-- Mage_GoogleAnalytics --&gt;
&lt;reference name=&quot;before_body_end&quot;&gt;
&lt;block type=&quot;googleanalytics/ga&quot; name=&quot;google_analytics&quot; as=&quot;google_analytics&quot; /&gt;
&lt;/reference&gt;
&lt;/default&gt;
&lt;/layout&gt;
</pre>
</pre>
<p>^ This will move the Google Analytics code to before the closing of the HTML &lt;/body&gt; tag (for faster page load times)</p>
<p><strong>Locate: /app/code/core/Mage/GoogleAnalytics/Block/ga.php</strong></p>
<p>Replace at around LINE 171: </p>
<pre>
<pre class="brush: php">
&lt;!-- BEGIN GOOGLE ANALYTICS CODE --&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[
var _gaq = _gaq || [];
_gaq.push([&quot;_setAccount&quot;, &quot;&#039; . $this-&gt;getAccount() . &#039;&quot;]);
_gaq.push([&quot;_trackPageview&quot;, &quot;&#039;.$this-&gt;getPageName().&#039;&quot;]);
(function() {
var ga = document.createElement(\&#039;script\&#039;); ga.type = \&#039;text/javascript\&#039;; ga.async = true;
ga.src = (\&#039;https:\&#039; == document.location.protocol ? \&#039;https://ssl\&#039; : \&#039;http://www\&#039;) + \&#039;.google-analytics.com/ga.js\&#039;;
(document.getElementsByTagName(\&#039;head\&#039;)[0] || document.getElementsByTagName(\&#039;body\&#039;)[0]).appendChild(ga);
})();

//]]&gt;
&lt;/script&gt;
&lt;!-- END GOOGLE ANALYTICS CODE --&gt;
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/07/02/fix-google-analytics-_gaq-is-not-defined-in-magento-1-4-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice Regular Expression Tool</title>
		<link>http://blogs.ifuelinteractive.com/2010/04/06/nice-regular-expression-tool/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/04/06/nice-regular-expression-tool/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 22:02:36 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=252</guid>
		<description><![CDATA[While working on some ASP.NET form validation today, I came across a great  regex tester / builder called Regex Hero.  The main feature is their .NET Regex Tester,  a Silverlight app, and while it requires registration (Google, Yahoo, AOL,  OpenID, etc.), this gives you the ability save your regular expressions to your  personal [...]]]></description>
			<content:encoded><![CDATA[<p>While working on some ASP.NET form validation today, I came across a great  regex tester / builder called <a href="http://regexhero.net/" target="_blank">Regex Hero</a>.  The main feature is their <a href="http://regexhero.net/tester/" target="_blank">.NET Regex Tester</a>,  a Silverlight app, and while it requires registration (Google, Yahoo, AOL,  OpenID, etc.), this gives you the ability save your regular expressions to your  personal library on the site.  You can also use the site’s public library, but contributions  are a little anemic at this point.  The app has a few other nice features,  including real-time expression matching, a built-in regular expression  reference, .NET code generation, and performance benchmarking.</p>
<p>The app is free for basic use, but it will nag you every 5 minutes to buy the  paid version.  The full version is $20 and comes with the nice addition of  Intellisense-like code completion and a desktop version of the app.  Future  upgrades are free for the full version.</p>
<p><a href="http://blogs.ifuelinteractive.com/wp-content/uploads/2010/04/sshot-5.png"><img class="alignnone size-medium wp-image-251" title="Regex Hero" src="http://blogs.ifuelinteractive.com/wp-content/uploads/2010/04/sshot-5-300x198.png" alt="Regex Hero" width="300" height="198" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/04/06/nice-regular-expression-tool/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tips and Tricks: Developing with Magento</title>
		<link>http://blogs.ifuelinteractive.com/2010/04/05/tips-and-tricks-developing-with-magento/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/04/05/tips-and-tricks-developing-with-magento/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:54:05 +0000</pubDate>
		<dc:creator>Robert Nicklin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[file structure]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[Magento Guide]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=227</guid>
		<description><![CDATA[Things you Should Know Before Developing With Magento
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
Now being more experienced with Magento we definitely feel the need to share our findings with the masses. We only wish we knew these things prior to trying to the hack the crap out of magento to make it do what we want.
Turning on Template Path Hints
If you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight:bold;color:#3a3a3a;">Things you Should Know Before Developing With Magento</span></p>
<p><span style="color:DarkGray;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p>Now being more experienced with Magento we definitely feel the need to share our findings with the masses. We only wish we knew these things prior to trying to the hack the crap out of magento to make it do what we want.</p>
<p><span style="font-weight:bold;">Turning on Template Path Hints</span><br />
If you&#8217;re new to Magento you will realize that it is quite a hassle to understand the logic behind the file structure and block structure of a magento layout when trying to customize your storefront. There is a very under-publicized built-in magento feature that we&#8217;d like to share with you that should help you on your journey. Magento actually has the ability to display hints showing where the different files of your layout is contained so that you can edit it. </p>
<p><a href="http://blogs.ifuelinteractive.com/wp-content/uploads/2010/04/template-path-hints.jpg"><img src="http://blogs.ifuelinteractive.com/wp-content/uploads/2010/04/template-path-hints.jpg" alt="Magento&#039;s Built-In Template Path Hints" title="template-path-hints" width="600" height="178" /></a></p>
<p>To achieve this, Follow these simple steps&#8230;</p>
<ul>
<li>Log in to your administration panel. Go to Sytem > Configuration.</li>
<li>From the left navigation column on top there will be &#8220;Current Configuration Scope&#8221;. In the drop down menu select &#8220;Main Website&#8221;</li>
<li>Then navigate to Developer > Advance, also in the left navigation column.</li>
<li>Under &#8220;Debug&#8221; you&#8217;ll see Template Path Hints. Select Yes and click the Save Config button.</li>
</ul>
<p>Now when you navigate to your storefront you&#8217;ll see a bunch of red boxes displaying the underlying structure of the pages regarding templates and blocks. </p>
<p><span style="font-style: italic;font-size:11px;color:#707070;">Note: This should only be used in a development environment, considering this will make your storefront look hideous with big red blocks everywhere.</span></p>
<p><span style="color:DarkGray;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p><span style="font-weight:bold;">Never edit core files</span><br />
Problem: When developing with Magento you will find it necesary to edit core files to achieve certain functionality. However, By editting a core file you are basically blocking yourself into a corner. DON&#8217;T DO IT! If you ever wish to upgrade at any point in the future you will not be able to because any changes that you have made in the core files will be overwritten. Never fear, there is a way around this. </p>
<p>Solution: The &#8220;local&#8221; folder (\app\code\local\) is your saviour. Say you need to edit the &#8220;Shipping.php&#8221; file located at &#8220;\app\code\core\Mage\Shipping\Model\Shipping.php&#8221; you can create the same basic directory structure in the local folder and copy and paste the Shipping.php file into the new directory. So, your new &#8220;local&#8221; Shipping.php file will be located at \app\code\local\Mage\Shipping\Model\Shipping.php. You will be able to safely edit anything and everything within that local file and never have to worry about it being overwritten during an upgrade. This trick works because Magento will look for files in a local directory before looking for a file in the core directory. </p>
<p><span style="font-style: italic;font-size:11px;color:#707070;">Note: The above solution will only overpower files that exist within the \app\code\core\ or \app\code\community\ directories. Also note that any files within your magento theme (\app\design\frontend\default\YOURTHEME\) or (\skin\frontend\default\YOURTHEME\) are not considered core files and you are free to edit them as you please. </span></p>
<p>These are just to name a few&#8230; <a href="http://blogs.ifuelinteractive.com/feed/rss/">Follow our blog to read more!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/04/05/tips-and-tricks-developing-with-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using .htaccess Force Adding www. to URL for SSL Certificate Authentication</title>
		<link>http://blogs.ifuelinteractive.com/2010/03/09/using-htaccess-force-adding-www-to-url-for-ssl-certificate-authentication/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/03/09/using-htaccess-force-adding-www-to-url-for-ssl-certificate-authentication/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:43:09 +0000</pubDate>
		<dc:creator>Robert Nicklin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=184</guid>
		<description><![CDATA[In this day and age of many online scams it is necessary for every successful eCommerce storefront to have SSL Authentication for online purchases. These SSL Certificates are usually only good for one specific URL and are very picky as to whether or not the URL has to have &#8220;www.&#8221; attached to it. Here is [...]]]></description>
			<content:encoded><![CDATA[<p>In this day and age of many online scams it is necessary for every successful eCommerce storefront to have SSL Authentication for online purchases. These SSL Certificates are usually only good for one specific URL and are very picky as to whether or not the URL has to have &#8220;www.&#8221; attached to it. Here is a simple solution that we&#8217;ve created to force appending &#8220;www.&#8221; to the URL when trying to access a &#8220;https://&#8221; (http secure) address.</p>
<p><strong><em>Some things you must know:</em></strong></p>
<ul>
<li>This will only work on an Apache server</li>
<li>You must have mod_rewrite installed under Apache</li>
</ul>
<p>First, Create an .htaccess file if you don&#8217;t already have one. Then enter one of the following solutions based on your needs.</p>
<h3>Force appending www. to only http secure (https://) requests</h3>
<pre>
<pre class="brush: php">

# Redirect non-www to www

	Options +FollowSymLinks
	# turn mod_rewrite on
	RewriteEngine On

	# If https send to https://www.
	RewriteCond %{HTTP_HOST} ^YOURDOMAIN.COM$ [NC]
	RewriteCond %{HTTPS} on
	RewriteRule ^(.*)$ https://www.YOURDOMAIN.COM/$1 [R=301,L]
</pre>
</pre>
<h3>Force appending www. to both http (http://) and http secure (https://) requests</h3>
<pre>
<pre class="brush: php">

# Redirect non-www to www

	Options +FollowSymLinks
	# turn mod_rewrite on
	RewriteEngine On

	# If https send to https://www.
	RewriteCond %{HTTP_HOST} ^YOURDOMAIN.COM$ [NC]
	RewriteCond %{HTTPS} on
	RewriteRule ^(.*)$ https://www.YOURDOMAIN.COM/$1 [R=301,L]

	# If http send to http://www.
	RewriteCond %{HTTP_HOST} ^YOURDOMAIN.COM$ [NC]
	RewriteCond %{HTTPS} off
	RewriteRule ^(.*)$ http://www.YOURDOMAIN.COM/$1 [R=301,L]
</pre>
</pre>
<p>With these examples it is necesary for you to make sure that you replace &#8220;YOURDOMAIN.COM&#8221; to reflect the actual domain name of the website you will be using this on. Once you have done this, save your .htaccess file and upload it to the base directory of your website.</p>
<p>Believe it or not a few search engines distinguish your website as two different websites <strong>http://www.</strong>yourdomain.com and <strong>http://</strong>yourdomain.com. It is often considered good practice to add this htaccess rewrite to any website you create so that you can rest assured that your website is not being indexed as two different websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/03/09/using-htaccess-force-adding-www-to-url-for-ssl-certificate-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Compression on a Magento Site on OpenSuse</title>
		<link>http://blogs.ifuelinteractive.com/2010/01/26/enabling-compression-on-a-magento-site-on-opensuse/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/01/26/enabling-compression-on-a-magento-site-on-opensuse/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:18:39 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSuse]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=174</guid>
		<description><![CDATA[If you&#8217;re running Magento on OpenSuse (or any platform for that matter), you can really benefit from turning on http compression, especially to remote areas or from hosts that have limited bandwidth.
There are a lot of references out there on this, but you have to sort of pull it all together on your own for [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running Magento on OpenSuse (or any platform for that matter), you can really benefit from turning on http compression, especially to remote areas or from hosts that have limited bandwidth.</p>
<p>There are a lot of references out there on this, but you have to sort of pull it all together on your own for this particular combination.</p>
<p><strong>Verify that mod_deflate has been installed in Apache:<br />
</strong><br />
1. Open /etc/sysconfig/apache2.</p>
<p>2. Find the line that starts:</p>
<p>APACHE_MODULES=&#8230;</p>
<p>3. Verify that &#8220;deflate&#8221; is one of the modules listed (may not be in alphabetical order).</p>
<p><strong>Now, enable compression in the virtual host file for your site:</strong></p>
<p>1. Open /etc/apache2/vhosts.d/.conf.</p>
<p>2. Add the following lines inside the  tag:</p>
<pre>
<pre class="brush: php">

    &lt;IfModule mod_deflate.c&gt;
	DeflateBufferSize 32768
	DeflateCompressionLevel 5

	&lt;Location /&gt;
		SetOutputFilter DEFLATE
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
		SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|tiff)$ no-gzip dont-vary
		# Header append Vary User-Agent env=!dont-vary
	&lt;/Location&gt;
    &lt;/IfModule&gt;
</pre>
</pre>
<p><strong>Now restart Apache using:</strong></p>
<p>sudo /etc/init.d/apache2 restart</p>
<p>and you should be in business!</p>
<p><strong>Validate that compression is working</strong></p>
<p>A great, handy online site that you can use to validate that compression is working is <a href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">http://www.gidnetwork.com/tools/gzip-test.php</a>.</p>
<p>=============================<em><br />
“e-commerce done right</em>”<br />
<a href="http://www.ifuelinteractive.com/" target="_blank">http://www.ifuelinteractive.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/01/26/enabling-compression-on-a-magento-site-on-opensuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Test Data From Magento</title>
		<link>http://blogs.ifuelinteractive.com/2009/11/02/clearing-test-data-from-magento/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/11/02/clearing-test-data-from-magento/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 19:46:45 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[reset database]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=134</guid>
		<description><![CDATA[On many occasions we&#8217;ve needed to clear out the test data from a Magento site in preparation for going live.  It&#8217;s not as trivial as you&#8217;d think, but I found a nice sql script thanks to Elias Interactive that was just what I needed.  I&#8217;ve removed a bit as I didn&#8217;t need to reset all [...]]]></description>
			<content:encoded><![CDATA[<p>On many occasions we&#8217;ve needed to clear out the test data from a Magento site in preparation for going live.  It&#8217;s not as trivial as you&#8217;d think, but I found a nice sql script thanks to <a href="http://eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/" target="_blank">Elias Interactive </a>that was just what I needed.  I&#8217;ve removed a bit as I didn&#8217;t need to reset all the order numbers, etc.</p>
<p><em>updated 6/30/2010 for Magento 1.4<br />
</em></p>
<pre>
<pre class="brush: sql">
-- Reset Magento TEST Data

SET FOREIGN_KEY_CHECKS=0;

-- reset dashboard search queries
TRUNCATE `catalogsearch_query`;
ALTER TABLE `catalogsearch_query` AUTO_INCREMENT=1;

-- reset sales order info
TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
</pre>
</pre>
<p>Just run this script against the Magento database (make a backup first!).</p>
<p>=============================<em><br />
“e-commerce done right</em>”<br />
<a href="http://www.ifuelinteractive.com/" target="_blank">http://www.ifuelinteractive.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/11/02/clearing-test-data-from-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging all SQL in Magento</title>
		<link>http://blogs.ifuelinteractive.com/2009/10/18/logging-all-sql-in-magento/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/10/18/logging-all-sql-in-magento/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:24:21 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=106</guid>
		<description><![CDATA[I&#8217;ve been looking for a way to log all the sql that Magento is running for debugging purposes.  There are a number of logging mechanisms built in to Magento, but none that would allow you to log all the sql that&#8217;s being run.  Finally, I&#8217;ve found a simple change that can be made [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a way to log all the sql that Magento is running for debugging purposes.  There are a number of logging mechanisms built in to Magento, but none that would allow you to log all the sql that&#8217;s being run.  Finally, I&#8217;ve found a simple change that can be made to a core file (I know, not ideal because it will get overwritten when you upgrade Magento &#8211; but it&#8217;s only a few lines in one file).</p>
<h3>The Change</h3>
<p>1. Open the file &lt;magentoroot&gt;/lib/Varien/Db/Adapter/Pdo/Mysql.php.</p>
<p>2. Add the following lines:</p>
<pre>
<pre class="brush: php">
$code = &#039;SQL: &#039; . $sql . &quot;\r\n&quot;;
if ($bind) {
     $code .= &#039;BIND: &#039; . print_r($bind, true) . &quot;\r\n&quot;;
}
$this-&gt;_debugWriteToFile(&quot;[&quot;.date(&#039;Y-m-d H:i:s&#039;).&quot;] &quot;.$code);
</pre>
</pre>
<p>Add it to the &#8220;query&#8221; function as shown below:</p>
<pre>
<pre class="brush: php">
public function query($sql, $bind = array())
{
     $this-&gt;_debugTimer();

     try {
          $sql = (string)$sql;
          if (strpos($sql, &#039;:&#039;) !== false || strpos($sql, &#039;?&#039;) !== false) {
               $this-&gt;_bindParams = $bind;
               $sql = preg_replace_callback(&#039;#(([\&#039;&quot;])((\\2)|((.*?[^\\\\])\\2)))#&#039;, array($this, &#039;proccessBindCallback&#039;), $sql);
               $bind = $this-&gt;_bindParams;
          }

          $code = &#039;SQL: &#039; . $sql . &quot;\r\n&quot;;
          if ($bind) {
               $code .= &#039;BIND: &#039; . print_r($bind, true) . &quot;\r\n&quot;;
          }
          $this-&gt;_debugWriteToFile(&quot;[&quot;.date(&#039;Y-m-d H:i:s&#039;).&quot;] &quot;.$code);

          $result = parent::query($sql, $bind);
     }
     catch (Exception $e) {
          $this-&gt;_debugStat(self::DEBUG_QUERY, $sql, $bind);
          $this-&gt;_debugException($e);
     }
     $this-&gt;_debugStat(self::DEBUG_QUERY, $sql, $bind, $result);
     return $result;
 }
</pre>
<p><span id="more-106"></span></pre>
<h3>The Log</h3>
<p>By default your sql will be logged to:</p>
<p>&lt;magentoroot&gt;/var/debug/sql.txt</p>
<h3>Limitations</h3>
<p>1. As mentioned above, the file will likely be overwritten during a Magento upgrade.</p>
<p>2. There&#8217;s nothing that will turn logging off (except a Magento upgrade).  So you need to be careful that this is a temporary setting for debugging only.</p>
<p>=============================<em><br />
“e-commerce done right</em>”<br />
<a href="http://www.ifuelinteractive.com/" target="_blank">http://www.ifuelinteractive.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/10/18/logging-all-sql-in-magento/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery, Magento and Ajax Add to Cart Redux</title>
		<link>http://blogs.ifuelinteractive.com/2009/10/15/jquery-magento-and-ajax-add-to-cart-redux/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/10/15/jquery-magento-and-ajax-add-to-cart-redux/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:49:16 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Add to Cart]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=81</guid>
		<description><![CDATA[My previous post on adding to the cart with ajax in Magento has generated enough interest &#8211; and pointed out enough flaws in my overly complex code &#8211; that I&#8217;ve decided to put together a simplified version, so here goes:
ajaxAddToCart.zip
Step 1: Create the server side script. 
My sample script is called &#8220;addToCartTest.php&#8221; and I put [...]]]></description>
			<content:encoded><![CDATA[<p>My previous post on adding to the cart with ajax in Magento has generated enough interest &#8211; and pointed out enough flaws in my overly complex code &#8211; that I&#8217;ve decided to put together a simplified version, so here goes:</p>
<p><a href="http://blogs.ifuelinteractive.com/wp-content/uploads/2009/10/ajaxAddToCart.zip">ajaxAddToCart.zip</a></p>
<p><strong>Step 1: Create the server side script. </strong><br />
My sample script is called &#8220;addToCartTest.php&#8221; and I put it in a /scripts folder in the root of my Magento installation.</p>
<pre>
<pre class="brush: php">

&lt;?php
include_once &#039;../app/Mage.php&#039;;
Mage::app();

try{
     // usage /scripts/addToCartTest.php?product_id=838&amp;amp;amp;amp;amp;amp;qty=1
     $product_id = &#039;&#039;;

     // get query string
     if (!isset($_GET[&#039;product_id&#039;])) { $product_id = &#039;&#039;; } else { $product_id = $_GET[&#039;product_id&#039;]; }
     if (!isset($_GET[&#039;qty&#039;])) { $qty = &#039;1&#039;; } else { $qty = $_GET[&#039;qty&#039;]; }

     $product = Mage::getModel(&#039;catalog/product&#039;)-&gt;load($product_id);

     $session = Mage::getSingleton(&#039;core/session&#039;, array(&#039;name&#039;=&gt;&#039;frontend&#039;));
     $cart = Mage::helper(&#039;checkout/cart&#039;)-&gt;getCart();

     $cart-&gt;addProduct($product, $qty);

     $session-&gt;setLastAddedProductId($product-&gt;getId());
     $session-&gt;setCartWasUpdated(true);

     $cart-&gt;save();

     $result = &quot;{&#039;result&#039;:&#039;success&#039;}&quot;;
     echo $result;

} catch (Exception $e) {
     $result = &quot;{&#039;result&#039;:&#039;error&#039;&quot;;
     $result .= &quot;, &#039;message&#039;: &#039;&quot;.$e-&gt;getMessage().&quot;&#039;}&quot;;
     echo $result;
}
</pre>
</pre>
<p><span id="more-81"></span><br />
<strong>Step 2: Create the &#8216;html&#8217; page<br />
</strong>Obviously, you&#8217;d be putting this code into your product detail page or wherever you&#8217;re trying to add the item to the cart from.</p>
<pre>
<pre class="brush: html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;
&lt;title&gt;Ajax add to cart sample&lt;/title&gt;
&lt;script src=&quot;/scripts/jquery-1.3.2.min-noconflict.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery(document).ready(function($) {
     $(&quot;#buyNowButton&quot;).click(function(){
          var qty = $(&quot;#qty&quot;).val();
          var product_id = $(&quot;#buyNowButton&quot;).attr(&quot;product_id&quot;);

          var params = &quot;product_id=&quot; + product_id + &quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;qty=&quot; + qty;        

          var result = $.getJSON(&quot;/scripts/addToCartTest.php&quot;, params, function(data, textStatus){
               if (textStatus == &quot;error&quot;){
                    alert(&quot;There was an error adding this item to your cart.  Please call customer service for assistance.&quot;, &quot;Error&quot;);
                    return;
               }

               if (data.result == &quot;error&quot;){
                    alert(&quot;Sorry, an error occurred while adding the item to your cart.  The error was: &#039;&quot; + data.message + &quot;&#039;&quot;);
                    return;
               }

               alert(&quot;Thanks!  The item has been added to your cart!&quot;)
          });
     });
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
     &lt;input type=&quot;text&quot; id=&quot;qty&quot; value=&quot;1&quot; /&gt;
     &lt;a id=&quot;buyNowButton&quot; product_id=&quot;972&quot; href=&quot;#&quot;&gt;Buy Now&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
</pre>
<p>That&#8217;s it!  </p>
<p>Prerequisites:<br />
1. jQuery (Because Magento uses prototype and scriptaculous, you have to use jQuery in &#8220;no conflict&#8221; mode);<br />
I&#8217;ve included the source code, along with the no-conflict version of jQuery in the zip file attached.</p>
<p>Let me know if you&#8217;re using this code (helps my ego)!</p>
<p>=============================<em><br />
 “e-commerce done right</em>”<br />
 <a href="http://www.ifuelinteractive.com/" target="_blank">http://www.ifuelinteractive.com</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/10/15/jquery-magento-and-ajax-add-to-cart-redux/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Creating a new Product Attribute and then using it on a page in Magento</title>
		<link>http://blogs.ifuelinteractive.com/2009/09/29/create-a-new-product-attribute-and-then-using-it-on-a-page-in-magento/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/09/29/create-a-new-product-attribute-and-then-using-it-on-a-page-in-magento/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 18:53:45 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Product Attributes]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=51</guid>
		<description><![CDATA[
Creating a new product attribute and using it when you&#8217;re displaying a product turns out to be fairly simple &#8211; but I know for us at iFuel &#8211; and I think for lots of others based on the posts you see around the net, it ends up not being as simple as it seems.
For this [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Creating a new product attribute and using it when you&#8217;re displaying a product turns out to be fairly simple &#8211; but I know for us at iFuel &#8211; and I think for lots of others based on the posts you see around the net, it ends up not being as simple as it seems.</p>
<p>For this example, we&#8217;ll create a new attribute called &#8220;ingredients&#8221;.  We need this to be a text field (text area to be exact) that Magento admins can enter the product ingredients.  Then we&#8217;ll need to be able to access this text when we display the product.</p>
<h3>Attributes</h3>
<p>Attributes are single pieces of information that can be assigned to any of the entities (models) in the Magento system.  There is an extensive user interface for creating and maintaining attributes and attribute sets for products.  But you can actually create attributes for other entity types, like categories, too.  (Creating an attribute for a category has to be done right in the database &#8211; I&#8217;ll try to cover that in a future post).</p>
<p>To create an attribute:</p>
<p><span id="more-51"></span></p>
<p>1. Select &#8220;Attributes&#8221; -&gt; &#8220;Manage Attributes&#8221; from the &#8220;Catalog&#8221; menu in the Magento admin panel.</p>
<p>2. Click &#8220;Add New Attribute&#8221;.</p>
<p><img src="file:///C:/Users/Andy/AppData/Local/Temp/moz-screenshot-1.png" alt="" /></div>
<div id="attachment_60" class="wp-caption alignnone" style="width: 671px"><img class="size-full wp-image-60" title="Adding an Attribute" src="http://blogs.ifuelinteractive.com/wp-content/uploads/2009/09/add-attribute1.jpg" alt="Adding an Attribute" width="661" height="737" /><p class="wp-caption-text">Adding an Attribute</p></div>
<p>3. Enter an attribute code &#8211; we&#8217;ve used &#8220;ingredients&#8221; here.</p>
<p>4. Select the scope &#8211; we&#8217;ve selected &#8220;global&#8221; but you could select store as well.</p>
<p>5. Select the attribute type &#8211; we&#8217;ve selected text area because we want the user to be able to enter free-form text (we&#8217;re using the wysiwig editor for Magento so they&#8217;re actually entering html).</p>
<p>6. Go to the &#8220;Manage Label/Options&#8221; tab and enter a label to be used for the new attribute.</p>
<p>7. Save the new attribute.</p>
<h3>Attribute Sets</h3>
<p>Once you&#8217;ve added the new attribute, you have to add it to the attribute set that you use for your products.  (If you have more than one attribute set for your products, you&#8217;ll have to add it to all of the sets you want it to appear in).</p>
<p>1. Select &#8220;Attributes&#8221; -&gt; &#8220;Manage Attribute Sets&#8221;</p>
<p>2. Select your attribute set (if you haven&#8217;t created new attribute sets, it&#8217;ll be called &#8220;Default&#8221;)</p>
<p>3. Drag your new attribute from the list of &#8220;unassigned attributes&#8221; on the right into the list on the left (where you drop it will be where the admin will see it)</p>
<div id="attachment_61" class="wp-caption alignnone" style="width: 596px"><img class="size-full wp-image-61" title="Adding and attribute to an attribute set in Magento" src="http://blogs.ifuelinteractive.com/wp-content/uploads/2009/09/add-attribute-to-set1.jpg" alt="Adding and attribute to an attribute set in Magento" width="586" height="581" /><p class="wp-caption-text">Adding and attribute to an attribute set in Magento</p></div>
<p>4. Save the attribute set.</p>
<h3>Using the new attribute in the page</h3>
<p>So, that&#8217;s the easy part.  Actually, using the attribute in the page is pretty easy, once you&#8217;ve got the right syntax!  Assuming the id of the product you are using is in $productid then:</p>
<pre class="brush: php">

&lt;?php

$productModel = Mage::getModel(&#039;catalog/product&#039;)-&gt;load($productid);

$ingredients = $productModel-&gt;getIngredients();

echo $ingredients;

?&gt;
</pre>
<p>Poof!</p>
<p>I kept trying $_product-&gt;getIngredients(), but that wasn&#8217;t working.  I think there&#8217;s a way to tell Magento to load that attribute when the product is being loaded.  If anyone knows, let me know!</p>
<p>=============================<em><br />
&#8220;e-commerce done right</em>&#8221;<br />
<a href="http://www.ifuelinteractive.com/" target="_blank">http://www.ifuelinteractive.com</a></p>
<p><img src="file:///C:/Users/Andy/AppData/Local/Temp/moz-screenshot.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/09/29/create-a-new-product-attribute-and-then-using-it-on-a-page-in-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IIS LogParser</title>
		<link>http://blogs.ifuelinteractive.com/2009/09/22/iis-logparser/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/09/22/iis-logparser/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 16:57:56 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Content Delivery Network]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=44</guid>
		<description><![CDATA[I recently had to analyze how much static data the web server was sending out on a daily basis.  We wanted to try to get a sense of what it would cost to host all this static content on the new Amazon Cloudfront CDN (content delivery network).
I knew there had to be something out there, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to analyze how much static data the web server was sending out on a daily basis.  We wanted to try to get a sense of what it would cost to host all this static content on the new <a title="Amazon Cloutfront" href="http://aws.amazon.com/cloudfront/" target="_blank">Amazon Cloudfront CDN</a> (content delivery network).</p>
<p>I knew there had to be something out there, but I didn&#8217;t know there was something right in the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=56FC92EE-A71A-4C73-B628-ADE629C89499&amp;displaylang=en" target="_blank">IIS 6 resource kit</a> called LogParser.</p>
<p>There are a bunch of options in log parser, but the one I thought was way cool was the ability to basically &#8220;query&#8221; the log.  For example:</p>
<p>LogParser &#8220;Select count(*), sum(sc-bytes) from d:\logs\w3svc1\ex090922.log where cs-uri-stem like &#8216;%.jpg&#8217; or cs-uri-stem like &#8216;%.gif&#8217; or cs-uri-stem like &#8216;%.swf&#8217; or cs-uri-stem like &#8216;%.css&#8217; or cs-uri-stem like &#8216;%.js&#8217; or cs-uri-stem like &#8216;%.pdf&#8217; or cs-uri-stem like &#8216;%.png&#8217; or cs-uri-stem like &#8216;%.cur&#8217;&#8221;<br />
returns:</p>
<p><span id="more-44"></span></p>
<p>COUNT(ALL *) SUM(ALL sc-bytes)<br />
&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
23977        53910768</p>
<p>Statistics:<br />
&#8212;&#8212;&#8212;&#8211;<br />
Elements processed: 34195<br />
Elements output:    1<br />
Execution time:     0.22 seconds</p>
<p>This tells me that there were 23K requests for these file types, for a total of about 53Mb.  The log in question only represents 1 hour from one of two servers hosting the site (I think you can process from multiple logs simultaneously &#8211; have to spend more time playing around).  And it was really fast &#8211; &lt; 1 second!</p>
<p>So kudos to whoever created this tool!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/09/22/iis-logparser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
