<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Cutting Edge</title>
	<atom:link href="http://blogs.ifuelinteractive.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.ifuelinteractive.com</link>
	<description></description>
	<lastBuildDate>Tue, 09 Mar 2010 17:43:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>rob@ifuelinteractive.com</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>Agency212 on Facebook</title>
		<link>http://blogs.ifuelinteractive.com/2010/01/15/agency212-on-facebook/</link>
		<comments>http://blogs.ifuelinteractive.com/2010/01/15/agency212-on-facebook/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 22:00:18 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[iFuel Interactive]]></category>
		<category><![CDATA[agency212]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[ifuel]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=153</guid>
		<description><![CDATA[
Hey Everyone,
Be sure to check out our new Agency212 facebook page.
While you&#8217;re there, don&#8217;t forget to also visit the iFuel page.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.facebook.com/pages/Agency212/188810906625?v=app_4949752878"><img class="alignleft size-full wp-image-154" style="border: 0pt none;" title="Agency212" src="http://blogs.ifuelinteractive.com/wp-content/uploads/2010/01/212-facebook.jpg" alt="Agency212" width="103" height="116" /></a></p>
<p>Hey Everyone,</p>
<p>Be sure to check out our new <a title="Agency212 on facebook" href="http://www.facebook.com/pages/Agency212/188810906625?v=app_4949752878">Agency212 facebook page</a>.</p>
<p>While you&#8217;re there, don&#8217;t forget to also visit the <a title="iFuel" href="http://www.facebook.com/pages/iFUEL-Interactive-Agency212/72437327077?v=app_23798139265#/pages/iFUEL-Interactive-Agency212/72437327077?v=wall" target="_self">iFuel page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2010/01/15/agency212-on-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Holidays From iFuel</title>
		<link>http://blogs.ifuelinteractive.com/2009/12/24/happy-holidays-from-ifuel/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/12/24/happy-holidays-from-ifuel/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 16:13:26 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[iFuel Interactive]]></category>
		<category><![CDATA[ifuel]]></category>
		<category><![CDATA[interactive agency]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=139</guid>
		<description><![CDATA[We just wanted to take a minute and wish you all a happy and healthy holiday from everyone here at our interactive agency. 
]]></description>
			<content:encoded><![CDATA[<p><strong>We just wanted to take a minute and wish you all a <a title="Happy Holidays" href="http://www.ifuelinteractive.com/holiday/holiday.html" target="_blank">happy and healthy holiday</a> from everyone here at our <a href="http://www.ifuelinteractive.com">interactive agency</a>. </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.ifuelinteractive.com/2009/12/24/happy-holidays-from-ifuel/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>
<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`;

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>Finding Files in Vista by Date Range</title>
		<link>http://blogs.ifuelinteractive.com/2009/10/18/finding-files-in-vista-by-date-range/</link>
		<comments>http://blogs.ifuelinteractive.com/2009/10/18/finding-files-in-vista-by-date-range/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:30:39 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Vista]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://blogs.ifuelinteractive.com/?p=115</guid>
		<description><![CDATA[I had no idea you could find files in Vista by date range until I found this post:
http://www.howtogeek.com/howto/windows-vista/find-files-within-a-date-range-with-windows-vista-search/
Lots of options, but simply put:
modified: 10/1/2009 .. 10/10/2009
or
modified: &#62; 10/1/2009
That goes into the vista search box.  Not crazy about Vista, but I have to admit, that&#8217;s definitely handy!
=============================
“e-commerce done right”
http://www.ifuelinteractive.com
]]></description>
			<content:encoded><![CDATA[<p>I had no idea you could find files in Vista by date range until I found this post:</p>
<p><a href="http://www.howtogeek.com/howto/windows-vista/find-files-within-a-date-range-with-windows-vista-search/" target="_blank">http://www.howtogeek.com/howto/windows-vista/find-files-within-a-date-range-with-windows-vista-search/</a></p>
<p>Lots of options, but simply put:</p>
<p>modified: 10/1/2009 .. 10/10/2009</p>
<p>or</p>
<p>modified: &gt; 10/1/2009</p>
<p>That goes into the vista search box.  Not crazy about Vista, but I have to admit, that&#8217;s definitely handy!</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/finding-files-in-vista-by-date-range/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>2</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;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;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>9</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>0</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>
