<?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>EYEMAGINE &#187; magento</title>
	<atom:link href="http://www.eyemaginetech.com/blog/category/magento/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eyemaginetech.com/blog</link>
	<description>Discover the latest news in Web Design, Online Marketing, and Magento Development at EYEMAGINE&#039;s blog. For more information visit eyemaginetech.com</description>
	<lastBuildDate>Sat, 04 Feb 2012 01:49:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Magento CloudSponge Extension</title>
		<link>http://www.eyemaginetech.com/blog/extension/magento-cloudsponge-extension</link>
		<comments>http://www.eyemaginetech.com/blog/extension/magento-cloudsponge-extension#comments</comments>
		<pubDate>Sun, 16 Oct 2011 22:17:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[online store]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[CloudSponge]]></category>
		<category><![CDATA[Forward to a Friend]]></category>
		<category><![CDATA[Viral Marketing]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/blog/?p=350</guid>
		<description><![CDATA[This week, EYEMAGINE is announcing the very first Magento CloudSponge Extension. This extension is a full native integration with CloudSponge, a leader in online address book importing. This extension will fully install the CloudSponge address book service and will enable &#8230; <a href="http://www.eyemaginetech.com/blog/extension/magento-cloudsponge-extension">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This week, EYEMAGINE is announcing the very first <a title="Magento CloudSponge Extension" href="/store/cloudsponge-integration.html" target="_blank">Magento CloudSponge Extension</a>. This extension is a full native integration with CloudSponge, a leader in online address book importing.<br />
<span id="more-350"></span></p>
<p>This extension will fully install the CloudSponge address book service and will enable your users to import their contacts from the most popular email services: Yahoo!, MSN, Hotmail, Live, Google, AOL, Plaxo, and Apple Address Book.</p>
<p>With <a title="CloudSponge" href="https://www.cloudsponge.com/product?utm_source=eyemagine&amp;utm_medium=partner&amp;utm_campaign=integrator" target="_blank">CloudSponge</a>, your users can share your products with friends, family, and coworkers quickly and efficiently. Manually typing address book contents into a web form is definitely a thing of the past now that CloudSponge allows quick and easy address book import.</p>
<p>The true beauty of the integration is that CloudSponge let&#8217;s your customers import from multiple address book sources, online and locally.</p>
<p>Create a <a title="CloudSponge" href="https://www.cloudsponge.com/product?utm_source=eyemagine&amp;utm_medium=partner&amp;utm_campaign=integrator" target="_blank">CloudSponge</a> account today and download the <a title="Magento CloudSponge Extension" href="/store/cloudsponge-integration.html" target="_blank">Magento CloudSponge Extension</a> to enhance your Magento store&#8217;s viral-ness.</p>
<p>This module is completely free. The first 20 users to <a title="Contact Us" href="/contact-us/" target="_blank">contact us</a> will receive a free installation.</p>
<p><a title="CloudSponge Magento Extension" href="/store/cloudsponge-integration.html" target="_blank" class="pink-btn">Download Now</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/extension/magento-cloudsponge-extension/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X.commerce and the future of Magento</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/x-commerce-and-the-future-of-magento</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/x-commerce-and-the-future-of-magento#comments</comments>
		<pubDate>Sun, 16 Oct 2011 22:00:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[innovate]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[x.commerce]]></category>
		<category><![CDATA[Dickie Ochoa]]></category>
		<category><![CDATA[The Shins]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/blog/?p=329</guid>
		<description><![CDATA[X.commerce welcomed Magento as the latest addition to the global online commerce movement initiated by eBay. At the X.commerce Innovate conference last week (October 12-14), eBay announced ground-breaking integration across multiple platforms that will ultimately benefit Magento store owners by &#8230; <a href="http://www.eyemaginetech.com/blog/ecommerce/x-commerce-and-the-future-of-magento">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>X.commerce welcomed Magento as the latest addition to the global online commerce movement initiated by eBay.<br />
<span id="more-329"></span></p>
<p>At the X.commerce Innovate conference last week (October 12-14), eBay announced ground-breaking integration across multiple platforms that will ultimately benefit Magento store owners by tighter integration with PayPal and eBay, increased sales channels, additional tools for payment processing and online marketing, and much more.</p>
<p>We are excited about the announcement because merchants on the Magento platform will be fully integrated with eBay, PayPal, and other sales channels without making a single investment in integration software; it will all be included.</p>
<div id="attachment_344" class="wp-caption alignleft" style="width: 282px"><a href="https://www.x.com/corporate"><img class="size-full wp-image-344" title="We took the X.commerce Pledge" src="http://www.eyemaginetech.com/blog/wp-content/uploads/2011/10/pledge_0.jpg" alt="We took the X.commerce Pledge" width="272" height="256" /></a><p class="wp-caption-text">We took the X.commerce Pledge</p></div>
<p>We are so excited about X.commerce, we took the pledge to optimize customer experience across the entire commerce ecosystem.</p>
<p>Along with powerful new developments in commerce, The Shins played an amazing set to bring the first night of the conference to a close.</p>
<p>Stay tuned for more developments regarding Magento, x.commerce, eBay, and PayPal.</p>
<div id="attachment_332" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-332 " title="The tunnel into the evening's festivities" src="http://www.eyemaginetech.com/blog/wp-content/uploads/2011/10/innovate_tunnel-300x204.jpg" alt="The tunnel into the evening's festivities" width="300" height="204" /><p class="wp-caption-text">The tunnel into the evening&#39;s festivities</p></div>
<div id="attachment_333" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-333 " title="Developers and Merchants Mingling at Innovate" src="http://www.eyemaginetech.com/blog/wp-content/uploads/2011/10/innovate_party-300x125.jpg" alt="Developers and Merchants Mingling at Innovate" width="300" height="125" /><p class="wp-caption-text">Developers and Merchants Mingling at Innovate</p></div>
<div id="attachment_335" class="wp-caption alignleft" style="width: 650px"><img class="size-full wp-image-335  " title="The Shins were the Headliners at this year's x.commerce Innovate Conference" src="http://www.eyemaginetech.com/blog/wp-content/uploads/2011/10/innovate_the_shins1.jpg" alt="The Shins were the Headliners at this year's x.commerce Innovate Conference" width="640" height="416" /><p class="wp-caption-text">The Shins were the Headliners at this year&#39;s x.commerce Innovate Conference</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/x-commerce-and-the-future-of-magento/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FREE Magento Enterprise Installation</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/free-magento-enterprise-installation</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/free-magento-enterprise-installation#comments</comments>
		<pubDate>Wed, 12 Oct 2011 03:45:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/blog/?p=324</guid>
		<description><![CDATA[That&#8217;s right.  Free Magento Enterprise Edition installation. EYEMAGINE is offering free installation of the latest stable release of Magento Enterprise Edition to customers that purchase or upgrade Magento Enterprise Edition. Contact us to find out how.]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s right.  Free Magento Enterprise Edition installation.</p>
<p>EYEMAGINE is offering free installation of the latest stable release of Magento Enterprise Edition to customers that purchase or upgrade Magento Enterprise Edition. <a title="Contact Us" href="/contact-us/">Contact us</a> to find out how.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/free-magento-enterprise-installation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Enterprise Edition and Customer Segmenting</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/magento-enterprise-edition-and-customer-segmenting</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/magento-enterprise-edition-and-customer-segmenting#comments</comments>
		<pubDate>Thu, 28 Apr 2011 02:02:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/blog/?p=308</guid>
		<description><![CDATA[In Magento's latest release of its Enterprise Edition software, customer records can be segmented based on customer attributes (name, address, gender, etc.) as well as purchase behavior. <a href="http://www.eyemaginetech.com/blog/ecommerce/magento-enterprise-edition-and-customer-segmenting">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In Magento&#8217;s latest release of its Enterprise Edition software, version 1.10, customer records can be segmented based on customer attributes (name, address, gender, etc.) as well as purchase behavior.</p>
<p><span id="more-308"></span></p>
<p>As you can imagine, this level of control over customer lists can be incredibly powerful for targeted email campaigns.</p>
<p>In addition to being able to separate lists of customers with Magento Enterprise Edition, customers can be provided with targeted content based on their customer attributes and/or past purchase behavior.  If you want to promote a certain product to a customer that has not yet purchased it, Magento Enterprise Edition makes it easy as a few mouse-clicks.</p>
<p><a title="Contact Us" href="/contact-us">Contact us</a> to find out how Magento Enterprise can help your business target customers accurately and effectively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/magento-enterprise-edition-and-customer-segmenting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EYEMAGINE Releases First Magento iPhone App</title>
		<link>http://www.eyemaginetech.com/blog/iphone/eyemagine-releases-first-magento-iphone-app</link>
		<comments>http://www.eyemaginetech.com/blog/iphone/eyemagine-releases-first-magento-iphone-app#comments</comments>
		<pubDate>Wed, 15 Dec 2010 06:45:54 +0000</pubDate>
		<dc:creator>Andy Etemadi</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=270</guid>
		<description><![CDATA[Magento Magnate is the world’s first iPhone app that gives you access to your Magento store right out of the box. <a href="http://www.eyemaginetech.com/blog/iphone/eyemagine-releases-first-magento-iphone-app">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Magento Magnate is the world’s first iPhone app that gives you access to your Magento store right out of the box.</p>
<p>• No complicated modules to install in your Magento store<br />
• No development required<br />
• See new store orders as they are placed in your store<br />
• Invoice orders from your iPhone<br />
• Ship orders from your iPhone<br />
• Cancel orders from your iPhone<br />
• Magento Magnate can give you access to an unlimited number of stores</p>
<p>Why would I want it?</p>
<p>• Check on store activity while you’re out of the office<br />
• Continue operations during network outages or power outages<br />
• Allow your support staff to help customers while they’re in or out of the office<br />
• Send shipment updates while you’re waiting for your table at the restaurant or while waiting in line at the movies<br />
• Process invoices… from the beach<br />
• Reduce or ELIMINATE losses caused by computer hardware failures</p>
<p><a href="http://itunes.apple.com/us/app/magento-magnate-lite/id381416144?mt=8&amp;ls=1" target="_blank"><img class="alignnone size-full wp-image-297" title="itunes" src="http://www.eyemaginetech.com/blog/wp-content/uploads/2010/12/itunes.png" alt="Download on iTunes" width="129" height="47" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/iphone/eyemagine-releases-first-magento-iphone-app/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Invoiced Sales Report for Magento v 1.4</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/magento-invoiced-sales-report-for-magento-v-14</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/magento-invoiced-sales-report-for-magento-v-14#comments</comments>
		<pubDate>Thu, 11 Nov 2010 23:16:58 +0000</pubDate>
		<dc:creator>Andy Etemadi</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[sales invoice]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=264</guid>
		<description><![CDATA[Have you ever needed a report of the actual sales that your Magento store has completed? <a href="http://www.eyemaginetech.com/blog/ecommerce/magento-invoiced-sales-report-for-magento-v-14">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed a report of the actual sales that your Magento store has completed?</p>
<p>Would you like to see all of your closed/completed sales in a single Magento report that includes: Order ID, Order Date, Shipping Date, Merchandise Amount, Tax Amount, Shipping Amount, Tracking Number, Refunded Amount, Net Amount?<span id="more-264"></span></p>
<p>We have created a custom Magento report that includes all of the information above for each report within a time frame that you can specify.</p>
<p>Now available for Magento v1.4.</p>
<p style="overflow:hidden;"><a class="pink-btn" title="Magento Invoiced Sales Report for Magento v 1.4" href="/store/invoiced-sales-reports.html" style="float:left; display:block;">Buy Now</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/magento-invoiced-sales-report-for-magento-v-14/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Product Merchandising Made Easy</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/magento-product-merchandising-made-easy</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/magento-product-merchandising-made-easy#comments</comments>
		<pubDate>Thu, 30 Sep 2010 06:04:52 +0000</pubDate>
		<dc:creator>Andy Etemadi</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[merchandising]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=238</guid>
		<description><![CDATA[Product merchandising is an art form mastered by top notch e-commerce managers.  Now there is a new way to easily merchandise products in Magento that makes merchandising quick, easy, and effective. <a href="http://www.eyemaginetech.com/blog/ecommerce/magento-product-merchandising-made-easy">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Product merchandising is an art form mastered by top notch e-commerce managers. Now there is a new way to merchandise products in Magento that is quick, easy, and effective.<span id="more-238"></span></p>
<p>If you have lots of products to manage in a single category, this module is going to save you hours of sorting and organizing. Instead of tediously tracking position values, simply drag and drop the product to automatically change the position and see instant results. View the screencast below for a visual demo.</p>
<p>Merchandising Made Easy: <strong>$299 USD</strong></p>
<p style="overflow:hidden;"><a class="pink-btn" href="/store/merchandising-made-easy.html" style="float:left; display:block;">BUY NOW</a></p>
<p><script type="text/javascript">// <![CDATA[
$(document).ready(function(){
$(".lightbox").colorbox();
});
// ]]&gt;</script></p>
<p><a href="#video-popup" id="video-popup-btn"><img src="http://www.eyemaginetech.com/blog/wp-content/uploads/2010/09/thumb_merchandisingvideo.jpg" width="645" height="308" alt="Merchandising Made Easy" /></a></p>
<div id="video-popup">
<span class="gotham jqmClose">CLOSE X</span><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="1400" height="737" id="mymoviename"><param name="movie" value="http://c3025642.cdn.cloudfiles.rackspacecloud.com/assets/flash/merchandising.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://c3025642.cdn.cloudfiles.rackspacecloud.com/assets/flash/merchandising.swf" quality="high" bgcolor="#ffffff" width="1400" height="737" name="mymoviename" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/magento-product-merchandising-made-easy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OneStepCheckout</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/onestepcheckout</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/onestepcheckout#comments</comments>
		<pubDate>Tue, 31 Aug 2010 21:24:19 +0000</pubDate>
		<dc:creator>Andy Etemadi</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[online store]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=234</guid>
		<description><![CDATA[Everybody is doing it. <a href="http://www.eyemaginetech.com/blog/ecommerce/onestepcheckout">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>OneStepCheckout is a Magento module that enhances the customer shopping experience by combining multiple steps during checkout into a single, well-formatted checkout page.</p>
<p>EyeMagine is an authorized OneStepCheckout partner and we highly recommend the OSC to all our clients. The OSC is the new must-have Magento extension that is taking the market by storm.</p>
<p>OSC is a total revamp of the standard checkout process in Magento. The core feature is that it reduces the six standard Magento checkout steps down to one. Totals and prices are dynamically updated via AJAX when shipping/payment method is selected. The user simply fills in their address and chooses delivery/payment methods on the same page, rather than having to do a separate step for each.</p>
<p>Improving the checkout process results in more customers completing their sales, and this has an immediate impact on your bottom line. It is the single most effective technical change you can make to reduce shopping cart abandonment.</p>
<p><a href="/contact-us/">Contact us</a> to find out how to add OneStepCheckout to your Magento store today!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/onestepcheckout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Tax By City</title>
		<link>http://www.eyemaginetech.com/blog/ecommerce/magento-tax-by-city</link>
		<comments>http://www.eyemaginetech.com/blog/ecommerce/magento-tax-by-city#comments</comments>
		<pubDate>Wed, 14 Apr 2010 18:59:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=183</guid>
		<description><![CDATA[Tax rules can be complicated; they can be even more complicated if you need tax rules based on the city while your online store tax rules are based on postal codes. <a href="http://www.eyemaginetech.com/blog/ecommerce/magento-tax-by-city">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tax rules can be complicated; they can be even more complicated if you need tax rules based on the city while your online store tax rules are based on postal codes.<span id="more-183"></span> For example, districts in California have a higher sales tax rate than the state base tax rate.  Magento&#8217;s built-in tax rate system supports tax rates by country, state/region, and postal code. This will suffice for most stores, but the California Board Of Equalization advises against tax rate rules based on a mailing address because postal codes may cross district boundaries.  As suggested in <a title="Magento  - Tax per city - Can Magento Do... - eCommerce Software for Growth" href="http://www.magentocommerce.com/boards/viewthread/11641/" target="_blank">this Magento message board discussion</a>, store owners need another way to calculate taxes.</p>
<p>Calculating taxes based on city instead of postal code can be a straightforward process as we show in this article. We will take advantage of the tax_postcode column in the tax_calculation_rate table. This is a relatively quick and simple solution for creating a new database column and modifying the Admin HTML blocks.</p>
<h2>Directory Structure:</h2>
<pre>app/
  code/
    local/
      Eyemagine/
        Taxbycity/
          etc/
            config.xml
          Model/
            Calculation.php
            Mysql4/
              Calculation.php
          sql/
            taxbycity_setup/
              mysql-install-0.1.0.php</pre>
<h2>Configuration</h2>
<p>File: app/code/local/Eyemagine/Taxbycity/etc/config.xml</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;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Eyemagine_Taxbycity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Eyemagine_Taxbycity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taxbycity_setup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;module<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Eyemagine_Taxbycity<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/module<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;connection<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;use<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>core_setup<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/use<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/connection<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taxbycity_setup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;models<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tax<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calculation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Eyemagine_Taxbycity_Model_Calculation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calculation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tax<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tax_mysql4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;calculation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Eyemagine_Taxbycity_Model_Mysql4_Calculation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/calculation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tax_mysql4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/models<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Mage_Tax_Model_Calculation and Mage_Tax_Model_Mysql4_Calculation are the one two classes we will overload. This module will affect how the tax rate is queried from the database and the criteria used to search for the tax rate.</p>
<h2>The Setup</h2>
<p>File: app/code/local/Eyemagine/Taxbycity/sql/taxbycity_setup/mysql-install-0.1.0.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * mysql-install-0.1.0.php
 * @author EyeMagine
 */</span>
<span style="color: #666666; font-style: italic;">/* @var $this Mage_Core_Model_Resource_Setup */</span>
<span style="color: #000088;">$installer</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span>         <span style="color: #339933;">=</span> <span style="color: #000088;">$installer</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$installer</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>startSetup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$installer</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>run<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
ALTER TABLE {<span style="color: #006699; font-weight: bold;">$installer</span>-&amp;gt;getTable('tax_calculation_rate')} CHANGE `tax_postcode` `tax_postcode` VARCHAR( 32 ) NOT NULL
&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The tax_postcode column by default has a 12-character limit, which presents problems for city names such as &#8220;Rancho Santa Margarita.&#8221; The setup for this module simply increases the limit to 32 characters.</p>
<h2>The Request</h2>
<p>File: app/code/local/Eyemagine/Taxbycity/Mode/Calculation.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Calculation.php
 * @author EyeMagine
 *
 */</span>
<span style="color: #009933; font-style: italic;">/**
 * Overload the tax calculation class
 * @author EyeMagine
 *
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> Eyemagine_Taxbycity_Model_Calculation <span style="color: #000000; font-weight: bold;">extends</span> Mage_Tax_Model_Calculation
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * override the getRateRequest to add the city information to the request
     * @see Mage_Tax_Model_Calculation::getRateRequest
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getRateRequest<span style="color: #009900;">&#40;</span><span style="color: #000088;">$shippingAddress</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$billingAddress</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$customerTaxClass</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Varien_Object<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$session</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;">'customer/session'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span>Mage_Tax_Model_Config<span style="color: #339933;">::</span><span style="color: #004000;">CONFIG_XML_PATH_BASED_ON</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shippingAddress</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'shipping'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$billingAddress</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'billing'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$billingAddress</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">||</span> <span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$billingAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$billingAddress</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'billing'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shippingAddress</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">||</span> <span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shippingAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$shippingAddress</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'shipping'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>isLoggedIn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$defBilling</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCustomer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getDefaultBillingAddress<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$defShipping</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCustomer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getDefaultShippingAddress<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;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'billing'</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$defBilling</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$defBilling</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$billingAddress</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$defBilling</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$basedOn</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'shipping'</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$defShipping</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$defShipping</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$shippingAddress</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$defShipping</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$basedOn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$basedOn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'billing'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$billingAddress</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'shipping'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$address</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$shippingAddress</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'origin'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$address</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setCountryId<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shipping/origin/country_id'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setRegionId<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shipping/origin/region_id'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setPostcode<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shipping/origin/postcode'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$address</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setCountryId<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span>Mage_Tax_Model_Config<span style="color: #339933;">::</span><span style="color: #004000;">CONFIG_XML_PATH_DEFAULT_COUNTRY</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setRegionId<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span>Mage_Tax_Model_Config<span style="color: #339933;">::</span><span style="color: #004000;">CONFIG_XML_PATH_DEFAULT_REGION</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setPostcode<span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span>Mage_Tax_Model_Config<span style="color: #339933;">::</span><span style="color: #004000;">CONFIG_XML_PATH_DEFAULT_POSTCODE</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$customerTaxClass</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>isLoggedIn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$customerTaxClass</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCustomer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getTaxClassId<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: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$customerTaxClass</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$session</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>isLoggedIn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$defaultCustomerGroup</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getStoreConfig</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'customer/create_account/default_group'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$customerTaxClass</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;">'customer/group'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getTaxClassId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$defaultCustomerGroup</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Varien_Object<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$request</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setCountryId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setRegionId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getRegionId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setPostcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getPostcode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setStore<span style="color: #009900;">&#40;</span><span style="color: #000088;">$store</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setCustomerClassId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$customerTaxClass</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setCity<span style="color: #009900;">&#40;</span><span style="color: #000088;">$address</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$request</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The calculation method, getRateRequest(), is nearly identical to the core method.  We will add the city to the request object from the address object.</p>
<h2>The Look Up</h2>
<p>File: app/code/local/Eyemagine/Taxbycity/Mode/Mysql4/Calculation.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Calculation.php
 * @author EyeMagine
 *
 */</span>
<span style="color: #009933; font-style: italic;">/**
 * Overload the mysql4 calculation class
 * @author EyeMagine
 *
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> Eyemagine_Taxbycity_Model_Mysql4_Calculation <span style="color: #000000; font-weight: bold;">extends</span> Mage_Tax_Model_Mysql4_Calculation
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * override getRates method to add city to where clause
     * @see Mage_Tax_Model_Mysql4_Calculation::_getRates
     */</span>
    protected <span style="color: #000000; font-weight: bold;">function</span> _getRates<span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$storeId</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;">-&amp;</span>gt<span style="color: #339933;">;</span>getStore<span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getStore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$select</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_getReadAdapter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>select<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$select</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>from<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'main_table'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getMainTable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'customer_tax_class_id = ?'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCustomerClassId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product_tax_class_id = ?'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getProductClassId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>join<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rule'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getTable<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tax/tax_calculation_rule'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rule.tax_calculation_rule_id = main_table.tax_calculation_rule_id'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rule.priority'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rule.position'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>join<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rate'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getTable<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tax/tax_calculation_rate'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_calculation_rate_id = main_table.tax_calculation_rate_id'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'value'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'rate.rate'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_country_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_region_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_postcode'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_calculation_rate_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.code'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$select</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;rate.tax_country_id = ?&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCountryId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;rate.tax_region_id in ('*', '', ?)&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getRegionId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$city</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$city</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//add city only if we know we have it, default to old behavior otherwise</span>
            <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LOWER(rate.tax_postcode) in ('*', '', ?)&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getPostcode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getCity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</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: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>where<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;rate.tax_postcode in ('*', '', ?)&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getPostcode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>joinLeft<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_table'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getTable<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tax/tax_calculation_rate_title'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rate.tax_calculation_rate_id = title_table.tax_calculation_rate_id AND title_table.store_id = '<span style="color: #006699; font-weight: bold;">{$storeId}</span>'&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'IFNULL(title_table.value, rate.code)'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$order</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rule.priority ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rule.tax_calculation_rule_id ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_country_id DESC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_region_id DESC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.tax_postcode DESC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rate.rate DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$select</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>order<span style="color: #009900;">&#40;</span><span style="color: #000088;">$order</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_getReadAdapter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>fetchAll<span style="color: #009900;">&#40;</span><span style="color: #000088;">$select</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Minor modifications to the _getRates() method, in the Mysql Calculation Model, will be required. In this method, we will ensure that the city has been set in the request and add it to the list of values to search for in the tax_postcode column.</p>
<p>A side affect of this is that the Estimated Shipping and Tax result will no longer be as accurate. The input for this form is a postal code, which is passed to the shipping module. Taking advantage of Magento&#8217;s flexibility makes it simple to enhance its core functionality without too much code modification.</p>
<p>If this article was helpful or if you would like assistance with your customizations, please feel free to <a title="Contact Us" href="/contact-us/">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/ecommerce/magento-tax-by-city/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Listen to Magento</title>
		<link>http://www.eyemaginetech.com/blog/cdn/listen-to-magento</link>
		<comments>http://www.eyemaginetech.com/blog/cdn/listen-to-magento#comments</comments>
		<pubDate>Fri, 22 Jan 2010 18:11:59 +0000</pubDate>
		<dc:creator>Andy Etemadi</dc:creator>
				<category><![CDATA[cdn]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[online store]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.eyemaginetech.com/our-thoughts/?p=162</guid>
		<description><![CDATA[EyeMagine is proud to have partnered with Staccato Creative in the development of this momentous online presence overhaul. <a href="http://www.eyemaginetech.com/blog/cdn/listen-to-magento">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>EyeMagine is proud to have partnered with Staccato Creative in the development of this momentous online presence overhaul.<span id="more-162"></span></p>
<p>Listen Technologies has a rich history and a track record pregnant with innovation, growth, and excellence.</p>
<blockquote><p>Founded in 1998 by Russell Gentner, Keldon Paxman, Cory Schaeffer and Kelli Lundgren, Listen Technologies is a leading provider of sound solutions for a diverse range of organizations.</p>
<p>Listen started by offering just two transmitters and two personal receivers. These early trend-setters included a built-in LCD display, 57 tunable channels, charging circuitry (SmartChargeTM), and the best audio quality in the industry. After those first few years, growth happened fast.</p></blockquote>
<p><span style="text-decoration: underline;">History</span>. January 11, 2010. Listen Technologies &lt;<a title="Listen Technologies - About Us" href="http://www.listentech.com/about-us-history" target="_blank">http://www.listentech.com/about-us-history</a>&gt;.</p>
<p>The new website was developed using Magento and Zend Framework with the future in mind.  We customized Magento with new modules that enhanced the content management feature set.</p>
<h3>Content Delivery Network</h3>
<p>A powerful content delivery network was integrated into the Magento CMS, allowing non-technical staff to add content that is distributed to servers around the world.  The distribution of cached content allows for an incredibly efficient user experience and decreased page load time.</p>
<h3>Catalog Management</h3>
<p>Most online catalogs need more than descriptions and photos.  The catalog management system was enhanced to allow for the simple attachment of documents, images, videos, MP3 files, and other files to both products and pages, giving the staff power to generate dynamic content with easy-to-use tools.</p>
<h3>Find Out More</h3>
<p>To find out more about EyeMagine and how we can help your online presence, <a title="Contact EyeMagine" href="/contact-us/">contact us</a> today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eyemaginetech.com/blog/cdn/listen-to-magento/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

