<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ecommerce Consulting and Development on Fontis</title><link>https://fontis.au/</link><description>Recent content in Ecommerce Consulting and Development on Fontis</description><generator>Hugo</generator><language>en-au</language><copyright>Copyright © {year} Fontis Pty Ltd</copyright><lastBuildDate>Wed, 25 Nov 2026 10:43:23 +1100</lastBuildDate><atom:link href="https://fontis.au/index.xml" rel="self" type="application/rss+xml"/><item><title>Shopify Custom App Security Deadlines: What to Check</title><link>https://fontis.au/blog/shopify-custom-app-security-deadlines/</link><pubDate>Wed, 25 Nov 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/shopify-custom-app-security-deadlines/</guid><description>Shopify has set app security deadlines for 1 December 2026 and 1 January 2027, and they apply to the custom apps that agencies and developers install on stores, which is how many ERP, POS and email integrations connect. The developer makes the changes, but you need to know which of your apps are in scope and who owns each one.</description></item><item><title>Ecommerce Replatforming: When a Migration Goes Wrong</title><link>https://fontis.au/blog/ecommerce-replatforming-risks/</link><pubDate>Thu, 12 Nov 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/ecommerce-replatforming-risks/</guid><description>A replatform that goes wrong costs far more than the project. The platform fees keep running, fixing the delivered store becomes a second project, and advertising switched back on before the faults are found pays to send customers to a store that doesn&amp;rsquo;t work properly. Where migrations break, how to test each part before launch, and what to settle in the scope.</description></item><item><title>Shopify Script Tags Deprecation: How to Prepare Before March 1st 2027</title><link>https://fontis.au/blog/shopify-script-tags-deprecation/</link><pubDate>Fri, 30 Oct 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/shopify-script-tags-deprecation/</guid><description>From 1 March 2027, Shopify stops loading scripts that apps add to storefronts through script tags, and there&amp;rsquo;s no warning in the admin. You can find the affected apps from your page source in a few minutes. The replacements need you to switch them on, theme by theme.</description></item><item><title>Ecommerce Filtering UX: Why Customers Can't Narrow Results</title><link>https://fontis.au/blog/ecommerce-filtering-ux/</link><pubDate>Thu, 15 Oct 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/ecommerce-filtering-ux/</guid><description>Filters on a product listing page can only show the data behind them. When a filter is missing, lists the same colour four ways or hides half the products that qualify, the cause usually sits in the product data rather than the theme. This is what Baymard&amp;rsquo;s testing finds customers running into, and which fixes belong to the frontend and which to your systems.</description></item><item><title>Magento to Shopify Migration: What to Audit First</title><link>https://fontis.au/blog/magento-to-shopify-migration-audit/</link><pubDate>Sun, 11 Oct 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/magento-to-shopify-migration-audit/</guid><description>The brief for a Magento to Shopify migration usually lists SKU counts, extensions and integrations, but the scope is set by the questions underneath them. Four audits to run before the brief goes out, what each should produce, and which ones need a developer.</description></item><item><title>Shopify Hydrogen Development | Headless Storefronts on Oxygen</title><link>https://fontis.au/ecommerce-development/shopify/hydrogen/</link><pubDate>Mon, 14 Sep 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/ecommerce-development/shopify/hydrogen/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Hydrogen and Oxygen Development&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Shopify Hydrogen: storefronts without the theme ceiling&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; &lt;p class="mb-4"&gt;Hydrogen is Shopify's toolkit for building custom storefronts: a set of components, utilities, and patterns for working with the Storefront API, deployed to Oxygen on Shopify's global edge network. The storefront becomes a custom codebase instead of a theme, while checkout, payments, and the Shopify admin carry on exactly as they do today.&lt;/p&gt;&#10; &lt;p&gt;Fontis builds and supports Hydrogen storefronts for Australian retailers who have run out of room inside a theme.&lt;/p&gt;&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Talk to a Hydrogen Engineer&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;img src="https://fontis.au/assets/hero/web-development.svg" alt=""&gt;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;</description></item><item><title>Shopify Plus Development | Checkout, Functions and B2B</title><link>https://fontis.au/ecommerce-development/shopify/plus/</link><pubDate>Mon, 14 Sep 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/ecommerce-development/shopify/plus/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Shopify Plus Development&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;What is your Plus plan doing that standard Shopify couldn&amp;#39;t?&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; &lt;p class="mb-4"&gt;Checkout Extensibility, custom Shopify Functions, B2B, expansion stores and the higher API limits all come with the plan. Every one of them has to be built before it does anything for your customers.&lt;/p&gt;&#10; &lt;p&gt;Fontis is a Melbourne-based Shopify Partner. We write the extensions, Functions and integrations that turn the plan into a storefront.&lt;/p&gt;&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Talk to a Shopify Plus Engineer&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;img src="https://fontis.au/assets/hero/online-business-startup.svg" alt=""&gt;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;</description></item><item><title>Product Page UX: Stop Losing Customers to Unanswered Questions</title><link>https://fontis.au/blog/ecommerce-product-page-ux/</link><pubDate>Thu, 03 Sep 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/ecommerce-product-page-ux/</guid><description>A customer on your product page has questions: will it fit, what is it made of, what will delivery cost. Every question the page leaves unanswered gets answered in another tab, usually on a competitor&amp;rsquo;s site. Most of those gaps trace back to supplier feeds and ERP exports rather than lazy copywriting, which changes who has to fix them.</description></item><item><title>Why Your Ecommerce Category Navigation Confuses Customers</title><link>https://fontis.au/blog/ecommerce-category-navigation/</link><pubDate>Tue, 25 Aug 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/ecommerce-category-navigation/</guid><description>Almost nobody designs a category tree from scratch. Most stores inherit one from the ERP, the PIM or a supplier feed, and it sorts products the way the business buys them rather than the way customers look for them. This is what that looks like from the customer&amp;rsquo;s side, and where the fix belongs.</description></item><item><title>Adobe Commerce to Shopify Migration (Magento)</title><link>https://fontis.au/ecommerce-development/migration-services/magento-to-shopify-migration/</link><pubDate>Fri, 21 Aug 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/ecommerce-development/migration-services/magento-to-shopify-migration/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Adobe Commerce (Magento) to Shopify Migration&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Migrate From Adobe Commerce to Shopify Without Losing What Works&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; &lt;p class="mb-4"&gt;Most of the risk in an Adobe Commerce to Shopify migration sits in areas that a platform demonstration does not cover: the product data model, pricing rules, integrations, and the URLs carrying existing search traffic.&lt;/p&gt;&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Book a Migration Consultation&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;img src="https://fontis.au/assets/hero/server-branch.svg" alt=""&gt;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;</description></item><item><title>Ecommerce Site Search UX: Where Most Sites Fail</title><link>https://fontis.au/blog/ecommerce-site-search-ux/</link><pubDate>Wed, 19 Aug 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/ecommerce-site-search-ux/</guid><description>When search underperforms, most retailers replace the engine. That fixes speed, typo tolerance and ranking control, and leaves the larger problem untouched: queries that fail because the answer was never in the index. This is what those failures look like in a search log, and where the fixes actually sit.</description></item><item><title>Is Your Product Data Ready for AI Shopping Agents?</title><link>https://fontis.au/blog/product-data-ready-ai-shopping-agents/</link><pubDate>Thu, 06 Aug 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/product-data-ready-ai-shopping-agents/</guid><description>AI shopping agents evaluate your catalogue through structured data, not your storefront design. This post covers the building blocks an agent relies on, where the major platforms stand, and a practical readiness checklist, with the reassurance that the same data foundation also powers site search and AI visibility.</description></item><item><title>Core Web Vitals for Ecommerce: The Metrics That Matter</title><link>https://fontis.au/blog/core-web-vitals-ecommerce/</link><pubDate>Mon, 20 Jul 2026 10:38:28 +1000</pubDate><guid>https://fontis.au/blog/core-web-vitals-ecommerce/</guid><description>Google&amp;rsquo;s Core Web Vitals come down to three numbers that affect ranking and conversion: LCP, INP and CLS. This is what each one measures on a retail site, the targets worth aiming for, the usual culprits behind a failing score, and a diagnostic checklist your team can work through.</description></item><item><title>Introducing Deducto: A Promotions Engine for Ecommerce Teams</title><link>https://fontis.au/blog/announcing-deducto-smarter-promotions/</link><pubDate>Thu, 09 Jul 2026 00:00:00 +1000</pubDate><guid>https://fontis.au/blog/announcing-deducto-smarter-promotions/</guid><description>Deducto began as the discounting engine Fontis built on the Fontis Commerce Stack to solve a promotions problem no available tool handled well. After years powering promotions on large Australian and international retailer sites, we&amp;rsquo;re launching Deducto as a standalone service that any ecommerce business can use.</description></item><item><title>Integrating Shopify with Your ERP: Common Pitfalls to Avoid</title><link>https://fontis.au/blog/integrating-shopify-erp-common-pitfalls/</link><pubDate>Mon, 06 Jul 2026 12:33:31 +1000</pubDate><guid>https://fontis.au/blog/integrating-shopify-erp-common-pitfalls/</guid><description>Connecting Shopify to an ERP is rarely defeated by API limits. It is defeated by undefined data ownership, mismatched sync models and edge cases that connectors skip. This post walks through the failure modes that show up in production Shopify-ERP integrations, why they happen, and the practices that separate integrations that hold under peak load from those that break. Written for Australian retailers and the technical teams evaluating connectors, iPaaS and custom builds.</description></item><item><title>Do You Really Need a PIM? Signs It's Time to Integrate One</title><link>https://fontis.au/blog/do-you-need-pim/</link><pubDate>Mon, 22 Jun 2026 12:33:31 +1000</pubDate><guid>https://fontis.au/blog/do-you-need-pim/</guid><description>A PIM is the right investment for some retailers and the wrong one for others. This post makes the case against first, then walks through the diagnostic signals that indicate the threshold has been crossed, covering platform selection, integration complexity, partner evaluation, and a pre-decision checklist for teams assessing readiness.</description></item><item><title>Best Practices for Shopify to AP21 Workflows</title><link>https://fontis.au/blog/best-practices-for-shopify-to-ap21-workflows/</link><pubDate>Thu, 28 May 2026 12:33:31 +1000</pubDate><guid>https://fontis.au/blog/best-practices-for-shopify-to-ap21-workflows/</guid><description>Apparel21 is the operational backbone for apparel retailers; Shopify is the sales conversion layer. Neither was designed with the other in mind, and the integration between them is where most of the operational pain lives. A field guide to the architectural decisions, operational gotchas and best practices that separate production-grade AP21 Shopify integrations from brittle ones.</description></item><item><title>Shopify Performance Engineering | Fix Your Store Speed</title><link>https://fontis.au/ecommerce-development/shopify/performance/</link><pubDate>Tue, 12 May 2026 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/shopify/performance/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Shopify Performance Engineering&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Still chasing that promised Shopify speed?&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; Shopify stores with 10 or more apps average a mobile PageSpeed score of 39 out of 100. The platform is fast out of the box, but the apps you need to run your business are undoing that advantage, forcing you to choose either speed or functionality. You can have both.&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Book a Free Discovery Call&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &#10; &#10; &#10; &#10; &#10; &#10; &lt;img&#10; class="aspect-[1000/728]"&#10; width="1000"&#10; height="728"&#10; srcset="https://fontis.au/ecommerce-development/shopify/performance/shopify-performance_hu_f417a3751b774a3b.2f0c34bd5e6b5a7e281a19c56f432075917dff3735370d4d4721d2d9408ebd62.webp 350w,&#10; https://fontis.au/ecommerce-development/shopify/performance/shopify-performance_hu_ed79b1892fef87b.8736513011ff0d83095c5ed9447483cbd0fa1172b28f26d74f44994d92909067.webp 576w,&#10; https://fontis.au/ecommerce-development/shopify/performance/shopify-performance_hu_ba919d469b58c808.3d8dbb8e02f320a013e9b6e404b44b21b778ed180945308bb3afade9887ff3e9.webp 960w"&#10; sizes="(max-width: 414px) 350px,&#10; (max-width: 650px) 576px,&#10; (max-width: 1024px) 960px,&#10; 576px"&#10; src="https://fontis.au/ecommerce-development/shopify/performance/shopify-performance.0baceb2385d346d8e4bb3d68104edab846fcec28697671f5b9121d6af004f250.webp"&#10; alt=""&gt;&#10; &#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&lt;section id="features-gpc9wpgo8l2rpdj4" class="bg-white py-20 lg:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &#10; &lt;div class="pb-6"&gt;&#10; &#10; &lt;small class="pt-2 pb-6 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;The Problem&lt;/small&gt;&#10; &#10; &lt;h2 class="text-4xl font-bold text-gray-900"&gt;Shopify is not as fast as it can be&lt;/h2&gt;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;p class="text-gray-900 max-w-prose"&gt;Shopify&amp;#39;s infrastructure is genuinely fast. Server response times average under 18 milliseconds, assets are delivered through a global CDN, and the platform consistently outperforms competitors on raw speed benchmarks. When evaluating platforms, the performance story is compelling. Out of the box, Shopify is fast. So why is the average store running so poorly?&lt;/p&gt;&#10; &#10;&#10; &lt;div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 w-full overflow-auto gap-x-12 gap-y-12 lg:gap-y-12 mt-12 xl:mt-16"&gt;&#10; &#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="app--developer_1_" d="M3.254,9.254L2.746,8.746L3.991,7.5L2.746,6.254l0.509-0.509L5.009,7.5L3.254,9.254z M3,2&#10;&#9;C2.724,2,2.5,2.224,2.5,2.5S2.724,3,3,3s0.5-0.224,0.5-0.5S3.276,2,3,2z M5.5,2.5C5.5,2.776,5.276,3,5,3S4.5,2.776,4.5,2.5&#10;&#9;S4.724,2,5,2S5.5,2.224,5.5,2.5z M7.5,2.5C7.5,2.776,7.276,3,7,3S6.5,2.776,6.5,2.5S6.724,2,7,2S7.5,2.224,7.5,2.5z M18.5,6.5&#10;&#9;C18.5,6.776,18.276,7,18,7s-0.5-0.224-0.5-0.5S17.724,6,18,6S18.5,6.224,18.5,6.5z M20.5,6.5C20.5,6.776,20.276,7,20,7&#10;&#9;s-0.5-0.224-0.5-0.5S19.724,6,20,6S20.5,6.224,20.5,6.5z M22.5,6.5C22.5,6.776,22.276,7,22,7s-0.5-0.224-0.5-0.5S21.724,6,22,6&#10;&#9;S22.5,6.224,22.5,6.5z M5.5,24.5C5.5,24.776,5.276,25,5,25s-0.5-0.224-0.5-0.5S4.724,24,5,24S5.5,24.224,5.5,24.5z M13,14.36H1&#10;&#9;c-0.199,0-0.36-0.161-0.36-0.36V1c0-0.199,0.161-0.36,0.36-0.36h12c0.199,0,0.36,0.161,0.36,0.36v13&#10;&#9;C13.36,14.199,13.199,14.36,13,14.36z M12.64,4.36H1.36v9.28h11.28C12.64,13.64,12.64,4.36,12.64,4.36z M12.64,1.36H1.36v2.281&#10;&#9;h11.28C12.64,3.641,12.64,1.36,12.64,1.36z M31.36,5v17c0,0.199-0.161,0.36-0.36,0.36H19.691c-0.301,0.471-0.69,0.885-1.152,1.215&#10;&#9;c2.875,1.05,4.819,3.778,4.819,6.902l0.002,0.521L22.639,31l-0.002-0.522c0-3.078-2.09-5.729-5.083-6.45&#10;&#9;c-0.15-0.035-0.26-0.163-0.274-0.316s0.07-0.299,0.211-0.361c1.315-0.592,2.165-1.9,2.165-3.334c0-2.017-1.64-3.657-3.656-3.657&#10;&#9;c-2.018,0-3.66,1.64-3.66,3.657c0,1.434,0.85,2.742,2.166,3.334c0.141,0.062,0.225,0.208,0.211,0.361s-0.125,0.281-0.274,0.316&#10;&#9;c-2.993,0.721-5.084,3.372-5.084,6.449l0.001,0.521L8.64,31l-0.001-0.522c0-3.125,1.943-5.854,4.819-6.903&#10;&#9;c-1.138-0.812-1.838-2.134-1.838-3.559c0-2.292,1.772-4.178,4.02-4.362V5c0-0.199,0.161-0.36,0.36-0.36h15&#10;&#9;C31.199,4.64,31.36,4.801,31.36,5z M30.64,8.36H16.36v7.295c2.246,0.184,4.017,2.07,4.017,4.362c0,0.566-0.11,1.115-0.315,1.623&#10;&#9;H30.64V8.36z M30.64,5.36H16.36v2.28h14.28V5.36z M22,11.64h-4v0.72h4V11.64z M23.64,17.5c0-1.577,1.283-2.86,2.86-2.86&#10;&#9;s2.86,1.283,2.86,2.86s-1.283,2.86-2.86,2.86S23.64,19.077,23.64,17.5z M28.242,16.266l-1.383,1.383l-0.004,1.955&#10;&#9;c1.01-0.171,1.784-1.046,1.784-2.104C28.64,17.04,28.49,16.615,28.242,16.266z M24.36,17.5c0,1.055,0.769,1.928,1.774,2.103&#10;&#9;l0.006-2.253l1.592-1.593c-0.349-0.248-0.773-0.397-1.233-0.397C25.32,15.36,24.36,16.32,24.36,17.5z M8,9.64H5v0.72h3V9.64z&#10;&#9; M3.5,21.36h3v-0.72h-3V21.36z M3.5,19.36h3v-0.72h-3V19.36z M22,13.64h-4v0.72h4V13.64z M29,11.64h-4v0.72h4V11.64z M29,9.64h-4&#10;&#9;v0.72h4V9.64z M22,9.64h-4v0.72h4V9.64z M8.36,17.584v7.832c0,0.521-0.423,0.944-0.944,0.944H2.584&#10;&#9;c-0.521,0-0.944-0.424-0.944-0.944v-7.832c0-0.521,0.423-0.944,0.944-0.944h4.832C7.937,16.64,8.36,17.063,8.36,17.584z M7.64,23.36&#10;&#9;H2.36v2.056c0,0.123,0.101,0.224,0.224,0.224h4.832c0.124,0,0.224-0.101,0.224-0.224C7.64,25.416,7.64,23.36,7.64,23.36z&#10;&#9; M7.64,17.584c0-0.123-0.101-0.224-0.224-0.224H2.584c-0.124,0-0.224,0.101-0.224,0.224v5.056h5.28&#10;&#9;C7.64,22.64,7.64,17.584,7.64,17.584z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;App Accumulation&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Need email marketing? Klaviyo goes in. Need buy-now-pay-later? Afterpay gets added. Custom theme, reviews, loyalty programs, chat widgets, analytics tools, marketing pixels; each one addresses a real business need, and each one adds scripts that load on every page of the store, whether they're needed there or not.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;g id="data--processing_1_"&gt;&#10;&#9;&lt;circle cx="13.5" cy="4" r="0.5"/&gt;&#10;&#9;&lt;circle cx="13.5" cy="11" r="0.5"/&gt;&#10;&#9;&lt;circle cx="27.5" cy="20" r="0.5"/&gt;&#10;&#9;&lt;circle cx="27.5" cy="27" r="0.5"/&gt;&#10;&#9;&lt;path d="M16,7.36H2C1.801,7.36,1.64,7.199,1.64,7V2c0-0.199,0.161-0.36,0.36-0.36h14c0.199,0,0.36,0.161,0.36,0.36v5&#10;&#9;&#9;C16.36,7.199,16.199,7.36,16,7.36z M2.36,6.64h13.28V2.36H2.36V6.64z M10,3.64H4v0.72h6V3.64z M16,14.36H2&#10;&#9;&#9;c-0.199,0-0.36-0.161-0.36-0.36V9c0-0.199,0.161-0.36,0.36-0.36h14c0.199,0,0.36,0.161,0.36,0.36v5&#10;&#9;&#9;C16.36,14.199,16.199,14.36,16,14.36z M2.36,13.64h13.28V9.36H2.36V13.64z M10,10.64H4v0.72h6V10.64z M30,23.36H16&#10;&#9;&#9;c-0.199,0-0.36-0.161-0.36-0.36v-5c0-0.199,0.161-0.36,0.36-0.36h14c0.199,0,0.36,0.161,0.36,0.36v5&#10;&#9;&#9;C30.36,23.199,30.199,23.36,30,23.36z M16.36,22.64h13.28v-4.28H16.36V22.64z M24,19.64h-6v0.721h6V19.64z M30,30.36H16&#10;&#9;&#9;c-0.199,0-0.36-0.161-0.36-0.36v-5c0-0.199,0.161-0.36,0.36-0.36h14c0.199,0,0.36,0.161,0.36,0.36v5&#10;&#9;&#9;C30.36,30.199,30.199,30.36,30,30.36z M16.36,29.64h13.28v-4.28H16.36V29.64z M24,26.64h-6v0.721h6V26.64z M28.36,8&#10;&#9;&#9;c0-0.199-0.161-0.36-0.36-0.36H18v0.72h9.64V16h0.721L28.36,8L28.36,8z M14,23.64H4.36V16H3.64v8c0,0.199,0.161,0.36,0.36,0.36h10&#10;&#9;&#9;V23.64z"/&gt;&#10;&lt;/g&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;The Hidden Ads Penalty&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Merchants investing in Google Ads and Meta campaigns are often unaware that their site speed is directly inflating their cost per click. Google factors page experience into ad Quality Scores, which means a slow store pays more for the same traffic. The ad spend is visible; the speed penalty hidden inside it usually isn't.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="user--analytics_1_" d="M31,29.36H10c-0.199,0-0.36-0.161-0.36-0.36v-4.646c-4.995-0.19-9-4.313-9-9.354&#10;&#9;s4.005-9.163,9-9.353V3c0-0.199,0.161-0.36,0.36-0.36h21c0.199,0,0.36,0.161,0.36,0.36v26C31.36,29.199,31.199,29.36,31,29.36z&#10;&#9; M28.36,28.64h2.279V3.36H10.36v2.287c4.995,0.19,9,4.312,9,9.353c0,5.04-4.005,9.163-9,9.354v4.286h7.28V23&#10;&#9;c0-0.199,0.161-0.36,0.36-0.36h4c0.199,0,0.36,0.161,0.36,0.36v5.64h1.279V16c0-0.199,0.161-0.36,0.36-0.36h4&#10;&#9;c0.199,0,0.36,0.161,0.36,0.36L28.36,28.64L28.36,28.64z M24.36,28.64h3.279V16.36H24.36V28.64z M18.36,28.64h3.279v-5.28H18.36&#10;&#9;V28.64z M3.749,20.959C5.324,22.609,7.544,23.64,10,23.64s4.677-1.03,6.251-2.682c-1.041-1.782-2.864-3.067-4.924-3.457&#10;&#9;c-0.16-0.03-0.279-0.163-0.292-0.325s0.084-0.312,0.237-0.367c1.528-0.547,2.555-1.996,2.555-3.604c0-2.12-1.725-3.844-3.844-3.844&#10;&#9;s-3.844,1.725-3.844,3.844c0,1.609,1.026,3.058,2.554,3.604c0.153,0.055,0.25,0.205,0.237,0.367s-0.132,0.295-0.292,0.325&#10;&#9;C6.57,17.893,4.801,19.146,3.749,20.959z M12.427,17.041c1.783,0.577,3.333,1.773,4.321,3.349c1.183-1.479,1.891-3.354,1.891-5.39&#10;&#9;c0-4.764-3.875-8.64-8.64-8.64S1.36,10.236,1.36,15c0,2.036,0.708,3.91,1.892,5.39c0.994-1.599,2.507-2.777,4.286-3.35&#10;&#9;c-1.297-0.825-2.118-2.266-2.118-3.836c0-2.517,2.047-4.564,4.564-4.564s4.564,2.047,4.564,4.564&#10;&#9;C14.547,14.774,13.725,16.216,12.427,17.041z M28,13.36h-6v-0.72h6V13.36z M28,10.36h-6V9.64h6V10.36z M28,7.36h-6V6.64h6V7.36z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;The Data&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Across 10,000+ active Shopify stores, the average mobile PageSpeed score sits at 54 out of 100. Only about 2% of stores achieve 90 or above. About a third of stores score below 50. The average store loads 188 separate requests and nearly 5MB of data on mobile before the page becomes usable.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="accelerated-computing_1_" d="M19,29.36c-3.401,0-6.596-1.506-8.764-4.131l0.556-0.459c2.03,2.459,5.022,3.869,8.208,3.869&#10;&#9;c5.867,0,10.64-4.772,10.64-10.64c0-5.867-4.772-10.64-10.64-10.64c-3.186,0-6.177,1.411-8.208,3.87l-0.555-0.459&#10;&#9;c2.091-2.532,5.137-4.022,8.403-4.125V5.36H16c-0.199,0-0.36-0.161-0.36-0.36V3c0-0.199,0.161-0.36,0.36-0.36h6&#10;&#9;c0.199,0,0.36,0.161,0.36,0.36v2c0,0.199-0.161,0.36-0.36,0.36h-2.64v1.286c6.098,0.191,11,5.211,11,11.354&#10;&#9;C30.36,24.264,25.264,29.36,19,29.36z M16.36,4.64h5.28V3.36h-5.28V4.64z M14,23.36H4v-0.72h10V23.36z M12,18.36H2v-0.72h10V18.36z&#10;&#9; M19.179,18.312l-0.357-0.625l7-4l0.357,0.625L19.179,18.312z M14,13.36H4v-0.72h10V13.36z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;The Opportunity&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; The performance gap between a well-optimised Shopify store and an average one is a significant competitive opportunity. Google and Deloitte research found that a 0.1-second improvement in mobile load time increases retail conversion rates by 8%. A store that loads in under 3 seconds on mobile, while competitors take 10–15 seconds, captures more of the traffic it's already paying for.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &lt;/div&gt;&#10;&#10; &#10; &lt;div class="mt-12 xl:mt-16 pb-6"&gt;&#10; &lt;a href="#contact" class="button"&gt;Book a Free Discovery Call&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Advanced Ecommerce Conversion Rate Optimisation for Retail</title><link>https://fontis.au/blog/advanced-ecommerce-conversion-rate-optimisation/</link><pubDate>Fri, 08 May 2026 12:33:31 +1000</pubDate><guid>https://fontis.au/blog/advanced-ecommerce-conversion-rate-optimisation/</guid><description>Backend ecommerce integration quality has a measurable effect on ecommerce conversion rates. Learn which integration points drive the biggest gains. From inventory accuracy and payment orchestration to personalisation and how to evaluate the right approach for your commerce stack.</description></item><item><title>Middleware: Custom Home-Grown vs Off-the-Shelf</title><link>https://fontis.au/blog/middleware-custom-vs-off-shelf/</link><pubDate>Fri, 01 May 2026 04:14:54 +1000</pubDate><guid>https://fontis.au/blog/middleware-custom-vs-off-shelf/</guid><description>Custom vs off-the-shelf middleware is one of the highest-stakes decisions in modern retail architecture. This guide breaks down the real trade-offs—cost, speed, scalability, and risk—and shows how to choose the right approach for complex commerce stacks, with practical frameworks and real-world examples to guide your decision.</description></item><item><title>Fix AI-Generated Ecommerce Integration Code</title><link>https://fontis.au/ecommerce-development/ai-code-remediation/</link><pubDate>Mon, 27 Apr 2026 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/ai-code-remediation/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;AI Code Remediation&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Your AI-Built Integration Is Breaking Things. We Fix It.&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; ChatGPT wrote it. Cursor shipped it. GitHub Copilot suggested the rest. AI tools generate ecommerce integration code fast. Code that passes every test in staging and fails the moment real orders hit production. Fontis audits, hardens, and fixes AI-generated ecommerce integrations for Australian retailers. 20+ years. Independent. Vendor-agnostic.&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Book a Discovery Call&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &#10; &#10; &#10; &#10; &#10; &#10; &lt;img&#10; class="aspect-[2500/1752]"&#10; width="2500"&#10; height="1752"&#10; srcset="https://fontis.au/ecommerce-development/ai-code-remediation/ai-fix_hu_50f876340f9c1b72.5387fd4561a201b672498f8e6410a0d3844a71177d341423733d5f404125aa60.webp 350w,&#10; https://fontis.au/ecommerce-development/ai-code-remediation/ai-fix_hu_146d251e45e4fdfc.bf64aa2fb1cf7da3d464acccd6ec109de6653700d95c02ac5b3ef31f6d3c1b8a.webp 576w,&#10; https://fontis.au/ecommerce-development/ai-code-remediation/ai-fix_hu_c2cae4b74cf0a477.1a4094e2ef9ff38240af7f0ed40dd7b4f6606a743c5cce3c65cd689ad52f41bf.webp 960w"&#10; sizes="(max-width: 414px) 350px,&#10; (max-width: 650px) 576px,&#10; (max-width: 1024px) 960px,&#10; 576px"&#10; src="https://fontis.au/ecommerce-development/ai-code-remediation/ai-fix.e87a71a2affb6ce2d3eeaf8a5b56d85dd650f6ab82218e13fdfbbf3401d0fe2e.webp"&#10; alt=""&gt;&#10; &#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;&#10;&#10;&#10;&lt;!-- Scenario recognition section --&gt;&#10;&lt;section class="bg-gradient-to-t from-white to-blue-50 py-20 lg:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &lt;div class="pb-6"&gt;&#10; &lt;h2 class="text-4xl font-bold text-gray-900"&gt;&lt;small class="text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green block"&gt;Sound Familiar?&lt;/small&gt;The moment you realise the AI code isn't production-ready.&lt;/h2&gt;&#10; &lt;/div&gt;&#10; &lt;div class="grid grid-cols-1 md:grid-cols-2 gap-8 mt-12"&gt;&#10; &lt;div class="border-l-4 border-fontis-green pl-6"&gt;&#10; &lt;h3 class="text-lg font-bold text-gray-900 mb-2"&gt;Worked fine in staging. Failed on your first big trading day.&lt;/h3&gt;&#10; &lt;p class="text-gray-600"&gt;The integration looked solid in testing. Then real order volumes hit, concurrent requests stacked up, and it started dropping transactions. AI writes code that satisfies a use case. It can't account for your real concurrency, your order volumes, or the edge cases that only appear at scale.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;div class="border-l-4 border-fontis-green pl-6"&gt;&#10; &lt;h3 class="text-lg font-bold text-gray-900 mb-2"&gt;Inventory stopped syncing after a routine API update.&lt;/h3&gt;&#10; &lt;p class="text-gray-600"&gt;Your ERP vendor shipped an update. Your payment gateway changed its authentication flow. The AI-built connector had no error handling for version changes. It just silently stopped working.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;div class="border-l-4 border-fontis-green pl-6"&gt;&#10; &lt;h3 class="text-lg font-bold text-gray-900 mb-2"&gt;Orders were being lost for days before anyone noticed.&lt;/h3&gt;&#10; &lt;p class="text-gray-600"&gt;No alerts. No error logs your team could read. Just a gap in fulfilment that customers noticed before you did. AI-generated integrations rarely include the monitoring and alerting that production systems require.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;div class="border-l-4 border-fontis-green pl-6"&gt;&#10; &lt;h3 class="text-lg font-bold text-gray-900 mb-2"&gt;The developer who built it has moved on. No documentation. No tests.&lt;/h3&gt;&#10; &lt;p class="text-gray-600"&gt;The integration runs. Nobody on your team understands it well enough to change it safely. Any modification risks breaking something else, and there's no test coverage to tell you what that something is.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Shopify Apparel21 Integration | Semi-Custom AP21 Integration Service</title><link>https://fontis.au/ecommerce-development/shopify/apparel21/integration-service/</link><pubDate>Tue, 21 Apr 2026 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/shopify/apparel21/integration-service/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Integration for Australian fashion retailers&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Shopify-AP21 Integration Tuned For Your Business&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; &lt;p class="mb-4"&gt;$500/month. Cloud included. No hidden infrastructure costs.&lt;/p&gt;&#10; &lt;p&gt;A Shopify-AP21 integration customised for the needs of your business, supported by expert ecommerce engineers who specialise in both platforms.&lt;/p&gt;&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="https://fontis.au/book-appointment"&gt;Schedule a Consultation&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;img src="https://fontis.au/assets/hero/e-commerce-development.svg" alt=""&gt;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;</description></item><item><title>Fontis UX Audit. Find Where Your Store Is Losing Sales</title><link>https://fontis.au/ecommerce-development/ux-audit/</link><pubDate>Wed, 15 Apr 2026 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/ux-audit/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Baymard-Methodology UX Audit&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;Ecommerce UX Audit&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10;Stop losing sales you've already paid for. A Baymard-methodology UX audit shows you exactly where customers drop off and what to fix first to recover that revenue.&#10;&lt;p class="text-gray-400 text-sm mt-4"&gt;Packages from $2,500 AUD. Results from 15 business days. Backed by 200,000+ hours of usability testing.&lt;/p&gt;&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Book a free consultation&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &#10; &#10; &#10; &lt;img src="https://fontis.au/ecommerce-development/ux-audit/audit.e26944b0ad2e4fe78709351edab5e6ce369d1ca108bbaed17362a877d5b7da35.svg" alt=""&gt;&#10; &#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;</description></item><item><title>Backend Ecommerce Performance Specialists</title><link>https://fontis.au/ecommerce-development/backend-ecommerce-integration/</link><pubDate>Wed, 08 Apr 2026 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/backend-ecommerce-integration/</guid><description>&lt;section class="text-white bg-fontis-blue py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Ecommerce Performance Specialists&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-white font-bold text-4xl mb-4"&gt;When Ecommerce Systems Aren&amp;#39;t Optimised Your Revenue Is Paying the Price&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-white text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; Slow page loads, inventory errors, manual workarounds: these aren't separate problems. They're symptoms of an integration layer that wasn't built for the complexity of your business. Fontis engineers the backend connections that are optimised for speed, efficiency and revenue.&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="#contact"&gt;Book a Discovery Call Today&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &#10; &#10; &#10; &lt;img src="https://fontis.au/ecommerce-development/backend-ecommerce-integration/consult.4fd08e70c495e52edeac3dffb63b3e7d616a2883d3076b6c20f52bc3e51b3ec3.svg" alt=""&gt;&#10; &#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&lt;section id="features-ca8l3acjwvzgl2pg" class="bg-gradient-to-t from-white to-blue-50 py-20 lg:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &#10; &lt;div class="pb-6"&gt;&#10; &#10; &lt;small class="pt-2 pb-6 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;The Problem&lt;/small&gt;&#10; &#10; &lt;h2 class="text-4xl font-bold text-gray-900"&gt;Frontend Optimisation Only Scratches the Surface&lt;/h2&gt;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;p class="text-gray-900 max-w-prose"&gt;Your frontend team has already done everything they can. Images are compressed, scripts are minified, caching is configured. The easy wins are gone. But product pages are still sluggish, inventory counts don&amp;#39;t match, and your team is spending hours on manual workarounds. These problems share a common root: the integration layer between your storefront and your backend systems wasn&amp;#39;t engineered for the complexity your business runs on today.&lt;/p&gt;&#10; &#10;&#10; &lt;div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 w-full overflow-auto gap-x-12 gap-y-12 lg:gap-y-12 mt-12 xl:mt-16"&gt;&#10; &#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="accelerated-computing_1_" d="M19,29.36c-3.401,0-6.596-1.506-8.764-4.131l0.556-0.459c2.03,2.459,5.022,3.869,8.208,3.869&#10;&#9;c5.867,0,10.64-4.772,10.64-10.64c0-5.867-4.772-10.64-10.64-10.64c-3.186,0-6.177,1.411-8.208,3.87l-0.555-0.459&#10;&#9;c2.091-2.532,5.137-4.022,8.403-4.125V5.36H16c-0.199,0-0.36-0.161-0.36-0.36V3c0-0.199,0.161-0.36,0.36-0.36h6&#10;&#9;c0.199,0,0.36,0.161,0.36,0.36v2c0,0.199-0.161,0.36-0.36,0.36h-2.64v1.286c6.098,0.191,11,5.211,11,11.354&#10;&#9;C30.36,24.264,25.264,29.36,19,29.36z M16.36,4.64h5.28V3.36h-5.28V4.64z M14,23.36H4v-0.72h10V23.36z M12,18.36H2v-0.72h10V18.36z&#10;&#9; M19.179,18.312l-0.357-0.625l7-4l0.357,0.625L19.179,18.312z M14,13.36H4v-0.72h10V13.36z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Site Speed Is a Backend Problem&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Every product page triggers multiple API calls behind the scenes: checking inventory across warehouses, pulling customer-specific pricing from your ERP, fetching personalisation data from your CDP. If those calls are synchronous, unoptimised, or hitting overloaded endpoints, they add hundreds of milliseconds to every page load. A peer-reviewed Deloitte study found that a 0.1-second improvement in site speed produced an 8.4% increase in conversions and a 9.2% increase in average order value.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="networking--04_1_" d="M13,18.64H1c-0.199,0-0.36,0.161-0.36,0.36v12c0,0.199,0.161,0.36,0.36,0.36h12&#10;&#9;c0.199,0,0.36-0.161,0.36-0.36V19C13.36,18.801,13.199,18.64,13,18.64z M12.64,30.64H1.36V19.36h11.28&#10;&#9;C12.64,19.36,12.64,30.64,12.64,30.64z M25,0.64c-3.507,0-6.36,2.853-6.36,6.36s2.854,6.36,6.36,6.36s6.36-2.853,6.36-6.36&#10;&#9;S28.507,0.64,25,0.64z M25,12.64c-3.11,0-5.64-2.53-5.64-5.64S21.89,1.36,25,1.36S30.64,3.89,30.64,7S28.11,12.64,25,12.64z&#10;&#9; M9.36,26.5c0-0.615-0.3-1.161-0.761-1.5c0.461-0.339,0.761-0.885,0.761-1.5c0-1.025-0.834-1.86-1.86-1.86H4.641v6.721H7.5&#10;&#9;C8.525,28.36,9.36,27.525,9.36,26.5z M5.36,22.36H7.5c0.628,0,1.14,0.511,1.14,1.14s-0.512,1.14-1.14,1.14H5.36V22.36z M5.36,25.36&#10;&#9;H7.5c0.628,0,1.14,0.511,1.14,1.14s-0.512,1.14-1.14,1.14H5.36V25.36z M24.64,15h0.721v8c0,1.302-1.059,2.36-2.36,2.36H16.37&#10;&#9;l2.214,2.213l-0.51,0.51L14.991,25l3.083-3.083l0.51,0.51L16.37,24.64H23c0.904,0,1.64-0.735,1.64-1.64V15z M17.009,7l-3.083,3.083&#10;&#9;l-0.509-0.509l2.214-2.214H9C8.096,7.36,7.36,8.096,7.36,9v8H6.64V9c0-1.301,1.059-2.36,2.36-2.36h6.631l-2.214-2.214l0.509-0.509&#10;&#9;L17.009,7z M24.671,3.862l-2.386,6l0.67,0.266l0.705-1.773h2.691l0.705,1.773l0.67-0.266l-2.385-6&#10;&#9;C25.341,3.862,24.671,3.862,24.671,3.862z M23.946,7.635l1.06-2.666l1.059,2.666H23.946z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Inventory That Doesn&amp;#39;t Match&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; A Fluent Commerce survey found that 58% of retailers maintain inventory accuracy below 80%, meaning stock data is wrong one time in five. Only the top 7% update inventory across channels every five minutes or less. In a high-velocity retail environment where the same SKU is sold through a physical store, a website, and a marketplace, an hour of sync lag creates a large window for overselling, cancelled orders, and customers who don't come back.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="app--developer_1_" d="M3.254,9.254L2.746,8.746L3.991,7.5L2.746,6.254l0.509-0.509L5.009,7.5L3.254,9.254z M3,2&#10;&#9;C2.724,2,2.5,2.224,2.5,2.5S2.724,3,3,3s0.5-0.224,0.5-0.5S3.276,2,3,2z M5.5,2.5C5.5,2.776,5.276,3,5,3S4.5,2.776,4.5,2.5&#10;&#9;S4.724,2,5,2S5.5,2.224,5.5,2.5z M7.5,2.5C7.5,2.776,7.276,3,7,3S6.5,2.776,6.5,2.5S6.724,2,7,2S7.5,2.224,7.5,2.5z M18.5,6.5&#10;&#9;C18.5,6.776,18.276,7,18,7s-0.5-0.224-0.5-0.5S17.724,6,18,6S18.5,6.224,18.5,6.5z M20.5,6.5C20.5,6.776,20.276,7,20,7&#10;&#9;s-0.5-0.224-0.5-0.5S19.724,6,20,6S20.5,6.224,20.5,6.5z M22.5,6.5C22.5,6.776,22.276,7,22,7s-0.5-0.224-0.5-0.5S21.724,6,22,6&#10;&#9;S22.5,6.224,22.5,6.5z M5.5,24.5C5.5,24.776,5.276,25,5,25s-0.5-0.224-0.5-0.5S4.724,24,5,24S5.5,24.224,5.5,24.5z M13,14.36H1&#10;&#9;c-0.199,0-0.36-0.161-0.36-0.36V1c0-0.199,0.161-0.36,0.36-0.36h12c0.199,0,0.36,0.161,0.36,0.36v13&#10;&#9;C13.36,14.199,13.199,14.36,13,14.36z M12.64,4.36H1.36v9.28h11.28C12.64,13.64,12.64,4.36,12.64,4.36z M12.64,1.36H1.36v2.281&#10;&#9;h11.28C12.64,3.641,12.64,1.36,12.64,1.36z M31.36,5v17c0,0.199-0.161,0.36-0.36,0.36H19.691c-0.301,0.471-0.69,0.885-1.152,1.215&#10;&#9;c2.875,1.05,4.819,3.778,4.819,6.902l0.002,0.521L22.639,31l-0.002-0.522c0-3.078-2.09-5.729-5.083-6.45&#10;&#9;c-0.15-0.035-0.26-0.163-0.274-0.316s0.07-0.299,0.211-0.361c1.315-0.592,2.165-1.9,2.165-3.334c0-2.017-1.64-3.657-3.656-3.657&#10;&#9;c-2.018,0-3.66,1.64-3.66,3.657c0,1.434,0.85,2.742,2.166,3.334c0.141,0.062,0.225,0.208,0.211,0.361s-0.125,0.281-0.274,0.316&#10;&#9;c-2.993,0.721-5.084,3.372-5.084,6.449l0.001,0.521L8.64,31l-0.001-0.522c0-3.125,1.943-5.854,4.819-6.903&#10;&#9;c-1.138-0.812-1.838-2.134-1.838-3.559c0-2.292,1.772-4.178,4.02-4.362V5c0-0.199,0.161-0.36,0.36-0.36h15&#10;&#9;C31.199,4.64,31.36,4.801,31.36,5z M30.64,8.36H16.36v7.295c2.246,0.184,4.017,2.07,4.017,4.362c0,0.566-0.11,1.115-0.315,1.623&#10;&#9;H30.64V8.36z M30.64,5.36H16.36v2.28h14.28V5.36z M22,11.64h-4v0.72h4V11.64z M23.64,17.5c0-1.577,1.283-2.86,2.86-2.86&#10;&#9;s2.86,1.283,2.86,2.86s-1.283,2.86-2.86,2.86S23.64,19.077,23.64,17.5z M28.242,16.266l-1.383,1.383l-0.004,1.955&#10;&#9;c1.01-0.171,1.784-1.046,1.784-2.104C28.64,17.04,28.49,16.615,28.242,16.266z M24.36,17.5c0,1.055,0.769,1.928,1.774,2.103&#10;&#9;l0.006-2.253l1.592-1.593c-0.349-0.248-0.773-0.397-1.233-0.397C25.32,15.36,24.36,16.32,24.36,17.5z M8,9.64H5v0.72h3V9.64z&#10;&#9; M3.5,21.36h3v-0.72h-3V21.36z M3.5,19.36h3v-0.72h-3V19.36z M22,13.64h-4v0.72h4V13.64z M29,11.64h-4v0.72h4V11.64z M29,9.64h-4&#10;&#9;v0.72h4V9.64z M22,9.64h-4v0.72h4V9.64z M8.36,17.584v7.832c0,0.521-0.423,0.944-0.944,0.944H2.584&#10;&#9;c-0.521,0-0.944-0.424-0.944-0.944v-7.832c0-0.521,0.423-0.944,0.944-0.944h4.832C7.937,16.64,8.36,17.063,8.36,17.584z M7.64,23.36&#10;&#9;H2.36v2.056c0,0.123,0.101,0.224,0.224,0.224h4.832c0.124,0,0.224-0.101,0.224-0.224C7.64,25.416,7.64,23.36,7.64,23.36z&#10;&#9; M7.64,17.584c0-0.123-0.101-0.224-0.224-0.224H2.584c-0.124,0-0.224,0.101-0.224,0.224v5.056h5.28&#10;&#9;C7.64,22.64,7.64,17.584,7.64,17.584z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Manual Workarounds Everywhere&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Reconciling data between disconnected systems. Manually routing orders. Updating stock levels by hand. Each workaround introduces delays that show up as customer-facing problems: delayed order confirmations, incorrect availability, and inconsistent pricing across channels. Every hour your team spends on manual processes is an hour not spent on growth.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="new-financial-customer-experiences_00000028302724215578813900000002463464847943441289_" d="M4.5,25.509l-1.254-1.254&#10;&#9;l0.509-0.51L4.5,24.491l1.746-1.746l0.509,0.51L4.5,25.509z M23.192,29.305l-0.385-0.609C20.822,29.949,18.404,30.64,16,30.64&#10;&#9;c-2.467,0-4.821-0.672-6.806-1.942l-0.389,0.605c2.102,1.346,4.589,2.058,7.194,2.058C18.539,31.36,21.093,30.63,23.192,29.305z&#10;&#9; M31.36,23c0-2.404-1.956-4.36-4.36-4.36s-4.36,1.956-4.36,4.36s1.956,4.36,4.36,4.36S31.36,25.404,31.36,23z M30.64,23&#10;&#9;c0,2.007-1.633,3.64-3.64,3.64s-3.64-1.633-3.64-3.64s1.633-3.64,3.64-3.64S30.64,20.993,30.64,23z M8.36,27v-8&#10;&#9;c0-0.199-0.161-0.36-0.36-0.36H5c-0.096,0-0.187,0.038-0.254,0.105l-3,3C1.678,21.812,1.64,21.904,1.64,22v5&#10;&#9;c0,0.199,0.161,0.36,0.36,0.36h6C8.199,27.36,8.36,27.199,8.36,27z M2.36,22.36H5c0.199,0,0.36-0.161,0.36-0.36v-2.64h2.28v7.279&#10;&#9;H2.36V22.36z M4.64,19.869v1.771H2.869L4.64,19.869z M27.36,24.86h0.39c0.612,0,1.11-0.498,1.11-1.11s-0.498-1.11-1.11-1.11h-1.5&#10;&#9;c-0.215,0-0.39-0.175-0.39-0.39s0.175-0.39,0.39-0.39h2.25v-0.72h-1.14V20.5h-0.72v0.64h-0.39c-0.612,0-1.11,0.498-1.11,1.11&#10;&#9;s0.498,1.11,1.11,1.11h1.5c0.215,0,0.39,0.175,0.39,0.39s-0.175,0.39-0.39,0.39H25.5v0.721h1.14v0.64h0.721L27.36,24.86L27.36,24.86&#10;&#9;z M21.36,21.5c0-2.146-1.301-4.066-3.241-4.902c0.779-0.628,1.241-1.57,1.241-2.598c0-1.853-1.508-3.36-3.36-3.36&#10;&#9;s-3.36,1.507-3.36,3.36c0,1.028,0.461,1.969,1.241,2.598c-1.941,0.836-3.241,2.756-3.241,4.902V23h0.72v-1.5&#10;&#9;c0-2.079,1.412-3.913,3.434-4.46c0.145-0.039,0.25-0.165,0.264-0.314c0.014-0.15-0.066-0.292-0.202-0.358&#10;&#9;C13.934,15.921,13.36,15.014,13.36,14c0-1.456,1.185-2.64,2.64-2.64c1.456,0,2.64,1.185,2.64,2.64c0,1.014-0.573,1.921-1.497,2.368&#10;&#9;c-0.135,0.065-0.215,0.208-0.201,0.358c0.014,0.149,0.119,0.275,0.265,0.314c2.021,0.547,3.434,2.381,3.434,4.46V23h0.721v-1.5&#10;&#9;H21.36z M29.329,16.958c-0.319-4.184-2.649-8.02-6.231-10.263l-0.383,0.61c3.39,2.122,5.594,5.751,5.896,9.707&#10;&#9;c0.024,0.321,0.029,0.66,0.029,0.988h0.721C29.36,17.654,29.354,17.298,29.329,16.958z M3.404,17.013&#10;&#9;c0.301-3.956,2.505-7.584,5.895-9.708l-0.382-0.61c-3.583,2.244-5.913,6.081-6.231,10.263C2.66,17.297,2.64,17.654,2.64,18h0.72&#10;&#9;C3.36,17.672,3.38,17.334,3.404,17.013z M21.36,7V3c0-0.75-0.61-1.36-1.36-1.36h-8c-0.75,0-1.36,0.61-1.36,1.36v4&#10;&#9;c0,0.75,0.61,1.36,1.36,1.36h8C20.75,8.36,21.36,7.75,21.36,7z M20.64,6.36V7c0,0.353-0.287,0.64-0.64,0.64h-8&#10;&#9;c-0.353,0-0.64-0.287-0.64-0.64V6.36H20.64z M11.36,3c0-0.353,0.287-0.64,0.64-0.64h8c0.353,0,0.64,0.287,0.64,0.64v2.64h-9.28V3z"&#10;&#9;/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Personalisation Without Clean Data&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; A CDP that can't pull real-time transactional data from your POS, browsing behaviour from your storefront, and loyalty status from your CRM is generating recommendations based on fragments. McKinsey estimates that well-integrated personalisation delivers 5–15% revenue increases. Poorly integrated personalisation delivers noise.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &lt;/div&gt;&#10;&#10; &#10; &lt;div class="mt-12 xl:mt-16 pb-6"&gt;&#10; &lt;a href="#contact" class="button"&gt;Book a Discovery Call Today&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Headless Commerce and ERP Integration: What CTOs Need to Know</title><link>https://fontis.au/blog/headless-ecommerce-erp-integration/</link><pubDate>Thu, 02 Apr 2026 13:44:31 +1100</pubDate><guid>https://fontis.au/blog/headless-ecommerce-erp-integration/</guid><description>This article explores why headless commerce success depends on robust ERP integration, where the real complexity lies beneath the frontend. Aimed at CTOs and ecommerce leaders, it outlines the critical role of backend data integration, workflow stability, and enterprise resource planning systems in delivering scalable, omnichannel retail. It highlights the risks of poor ecommerce integration, compares architecture patterns (point-to-point vs middleware), and explains when to use an integration agency. Real-world examples and planning guidance help retailers avoid the “headless tax” and build a foundation for long-term digital transformation.</description></item><item><title>Custom eCommerce Integrations that Actually Improve Conversion Rates</title><link>https://fontis.au/blog/ecommerce-integrations-improve-conversions/</link><pubDate>Tue, 17 Mar 2026 12:33:31 -0800</pubDate><guid>https://fontis.au/blog/ecommerce-integrations-improve-conversions/</guid><description>Custom ecommerce integration can influence how reliably your commerce stack performs — and that reliability often affects the ecommerce conversion rate customers experience. This article explores how well-designed system integrations between platforms such as ERP, OMS, inventory, and shipping infrastructure can reduce operational friction that disrupts purchasing journeys. It examines both the benefits and risks of custom integrations, practical considerations for retail leaders, and where partnering with a specialist integration agency can help ensure ecommerce systems operate smoothly at scale.</description></item><item><title>How Ecommerce Integration for OMS and Inventory Systems Drive Better Outcomes</title><link>https://fontis.au/blog/ecommerce-integration-oms-inventory-systems-drive-better-outcomes/</link><pubDate>Wed, 11 Mar 2026 09:11:31 -0800</pubDate><guid>https://fontis.au/blog/ecommerce-integration-oms-inventory-systems-drive-better-outcomes/</guid><description>Explore how integrated ecommerce order management and inventory systems improve fulfilment, reduce overselling, and enable scalable ecommerce integration for growing retail brands.</description></item><item><title>Integrating Apparel21 with Shopify: Considerations for Ecommerce Leaders</title><link>https://fontis.au/blog/shopify-apparel21-integration/</link><pubDate>Mon, 23 Feb 2026 09:11:31 +1100</pubDate><guid>https://fontis.au/blog/shopify-apparel21-integration/</guid><description>A practical guide for Australian fashion retailers integrating Apparel21 with Shopify. Explore architecture options, inventory strategy, order lifecycle design, performance considerations, and what &amp;ldquo;good&amp;rdquo; looks like in a scalable ecommerce integration.</description></item><item><title>Adaptive vs Responsive Web Design: Which Is Better for Your eCommerce?</title><link>https://fontis.au/blog/adaptive-vs-responsive-design/</link><pubDate>Mon, 09 Feb 2026 09:11:31 -0800</pubDate><guid>https://fontis.au/blog/adaptive-vs-responsive-design/</guid><description>A practical breakdown of adaptive vs responsive design for eCommerce leaders. Explore performance, SEO, conversion, and scalability trade-offs for complex retail platforms.</description></item><item><title>PWA vs Native Apps for eCommerce: What CTOs Need to Know</title><link>https://fontis.au/blog/pwa-vs-native-app/</link><pubDate>Wed, 28 Jan 2026 09:11:31 -0800</pubDate><guid>https://fontis.au/blog/pwa-vs-native-app/</guid><description>A CTO-level analysis of progressive web apps vs native apps for eCommerce. Explores real-world trade-offs across performance, architecture, security, integration, and long-term cost, helping retail technology leaders decide what actually makes sense for their stack.</description></item><item><title>Headless vs Composable: Clearing Up the Confusion</title><link>https://fontis.au/blog/headless-composable-confusion/</link><pubDate>Sun, 11 Jan 2026 09:10:28 -0300</pubDate><guid>https://fontis.au/blog/headless-composable-confusion/</guid><description>Confused by the debate between headless and composable commerce? Discover the critical differences, understand the operational risks, and learn why the best path forward is often an incremental evolution rather than a total system overhaul.</description></item><item><title>When Headless Makes Sense on Commercetools</title><link>https://fontis.au/blog/when-headless-makes-sense-commercetools/</link><pubDate>Wed, 03 Dec 2025 09:11:31 -0800</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-commercetools/</guid><description>Commercetools offers unmatched flexibility for enterprise retailers, but it isn&amp;rsquo;t right for every team. This guide explains when headless Commercetools architecture works, where it struggles, and what organisations must consider before choosing a composable commerce strategy.</description></item><item><title>When Headless Makes Sense on WooCommerce</title><link>https://fontis.au/blog/when-headless-makes-sense-woocommerce/</link><pubDate>Sun, 30 Nov 2025 09:11:31 -0800</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-woocommerce/</guid><description>WooCommerce can scale with the right architecture. This article explains when headless WooCommerce delivers real benefits across performance, UX, content velocity, and omnichannel needs, and when backend constraints mean it’s time to replatform.</description></item><item><title>When Headless Makes Sense on Salesforce Commerce Cloud</title><link>https://fontis.au/blog/when-headless-makes-sense-salesforce/</link><pubDate>Sat, 22 Nov 2025 04:11:31 -0800</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-salesforce/</guid><description>Salesforce Commerce Cloud offers power and scale, but when should enterprise teams go headless? This guide explores how modern architecture, progressive web apps, and content delivery networks can transform performance, workflow, and customer experience.</description></item><item><title>When Headless Makes Sense on BigCommerce</title><link>https://fontis.au/blog/when-headless-makes-sense-bigcommerce/</link><pubDate>Fri, 07 Nov 2025 04:12:32 -0800</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-bigcommerce/</guid><description>BigCommerce gives retailers flexibility out of the box, but when does going headless make sense? Explore how headless commerce architecture can enhance user experience, scalability, and control for growing brands ready to decouple their frontend and backend.</description></item><item><title>When Headless Makes Sense on Adobe Commerce (Magento)</title><link>https://fontis.au/blog/when-headless-makes-sense-magento/</link><pubDate>Thu, 30 Oct 2025 04:12:32 +1000</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-magento/</guid><description>Headless commerce can unlock speed, flexibility, and better user experience for Adobe Commerce, but it isn&amp;rsquo;t right for every brand. This guide explains when to decouple your frontend and backend, what to expect from a headless architecture, and how to assess if it&amp;rsquo;s worth the investment.</description></item><item><title>When Headless Makes Sense on Shopify</title><link>https://fontis.au/blog/when-headless-makes-sense-shopify/</link><pubDate>Mon, 20 Oct 2025 00:14:54 -0800</pubDate><guid>https://fontis.au/blog/when-headless-makes-sense-shopify/</guid><description>Learn when going Shopify headless makes sense. Discover how the right Shopify agency or Shopify developer can help you unlock speed, scalability, and flexibility, without over-engineering your ecommerce stack or overspending on complexity.</description></item><item><title>Do You Actually Need Headless? A Decision Framework for Retail Teams</title><link>https://fontis.au/blog/do-you-need-headless/</link><pubDate>Fri, 10 Oct 2025 04:14:54 -0800</pubDate><guid>https://fontis.au/blog/do-you-need-headless/</guid><description>Discover if headless commerce is right for your retail team. Myths vs reality, a self-assessment checklist, and guidance from a trusted headless commerce agency.</description></item><item><title>Will Going Headless Hurt SEO? Preserving and Boosting Search Performance</title><link>https://fontis.au/blog/will-headless-hurt-seo/</link><pubDate>Mon, 29 Sep 2025 04:14:54 +1000</pubDate><guid>https://fontis.au/blog/will-headless-hurt-seo/</guid><description>Discover how headless commerce impacts SEO. Learn myths, risks, and strategies to protect rankings and boost organic growth.</description></item><item><title>How eCommerce Managers Can Get Buy-In for a Headless Rebuild</title><link>https://fontis.au/blog/how-ecommerce-managers-can-get-headless-buy-in/</link><pubDate>Tue, 23 Sep 2025 04:14:54 -0800</pubDate><guid>https://fontis.au/blog/how-ecommerce-managers-can-get-headless-buy-in/</guid><description>Discover how eCommerce managers can secure stakeholder buy-in for a headless rebuild. Learn frameworks, pitfalls to avoid, and real-world tactics to drive adoption of headless commerce and deliver measurable ROI.</description></item><item><title>Typesense vs Algolia: Which Site Search Engine Wins for eCommerce in 2025?</title><link>https://fontis.au/blog/typesense-vs-algolia-ecommerce-search/</link><pubDate>Sun, 14 Sep 2025 04:14:54 -0800</pubDate><guid>https://fontis.au/blog/typesense-vs-algolia-ecommerce-search/</guid><description>Explore Algolia vs Typesense in 2025 — from features and pricing to performance and platform fit. See which Algolia alternative delivers the most value for your ecommerce site search strategy.</description></item><item><title>How Headless Commerce Benefits Large Retailers</title><link>https://fontis.au/blog/how-headless-commerce-benefits-large-retailers/</link><pubDate>Wed, 03 Sep 2025 13:12:49 +1000</pubDate><guid>https://fontis.au/blog/how-headless-commerce-benefits-large-retailers/</guid><description>Headless commerce is reshaping enterprise eCommerce. Learn how major retailers like Woolworths, Salling Group, and Lowe’s achieved sales growth, cost savings, faster launches, and peak-season stability through composable, API-driven architectures built for scale and flexibility.</description></item><item><title>Data Silos, Manual Hacks &amp; Midnight Deploys: How Legacy ERPs Strangle eCommerce Agility</title><link>https://fontis.au/blog/how-legacy-erps-strangle-ecommerce-agility/</link><pubDate>Mon, 25 Aug 2025 13:12:49 +1000</pubDate><guid>https://fontis.au/blog/how-legacy-erps-strangle-ecommerce-agility/</guid><description>Legacy ERP systems create silos, manual work, and stalled growth. This article explores why outdated ERP software holds Shopify merchants back, the risks of poor ERP system integration, and how cloud ERP solutions, Microsoft Dynamics, and custom ERP development unlock agility, scalability, and ROI.</description></item><item><title>What Matters When Building a Custom Checkout Experience</title><link>https://fontis.au/blog/what-matters-when-building-custom-checkout/</link><pubDate>Tue, 29 Jul 2025 13:12:49 +1000</pubDate><guid>https://fontis.au/blog/what-matters-when-building-custom-checkout/</guid><description>Explore how to tackle eCommerce checkout challenges with composable commerce solutions. Discover proven strategies to reduce cart abandonment, optimise checkout speed, and improve conversions across devices with actionable insights for enhancing the checkout experience and driving revenue.</description></item><item><title>Why Australian Retailers Are Lagging in Headless Commerce Adoption</title><link>https://fontis.au/blog/why-australian-retailers-lagging-headless-commerce/</link><pubDate>Fri, 25 Jul 2025 13:12:49 +1000</pubDate><guid>https://fontis.au/blog/why-australian-retailers-lagging-headless-commerce/</guid><description>While many Australian retailers claim they&amp;rsquo;ve gone headless, are they actually unlocking its true potential? The data reveals a critical gap between surface-level adoption and using this powerful architecture to actually drive revenue. Our latest post dives into the key barriers holding Aussie brands back—from budget pressures to a hidden skills gap—and lays out a clear roadmap to catch up with global leaders.</description></item><item><title>What Makes a Scalable eCommerce Stack in 2025?</title><link>https://fontis.au/blog/what-makes-a-scalable-ecommerce-stack-in-2025/</link><pubDate>Mon, 23 Jun 2025 13:12:49 +1000</pubDate><guid>https://fontis.au/blog/what-makes-a-scalable-ecommerce-stack-in-2025/</guid><description>Shoppers move faster than ever. So do algorithms, tax rules, fulfillment networks, and board-level revenue targets. The stakes for enterprise and mid-market retailers have never been higher. This post breaks down the essential components, the market trends, and the strategic choices that will define scalable commerce in 2025. We&amp;rsquo;ll cut through the hype and explain what really matters: why composable commerce is now non-negotiable, which pain points it solves, the benefits of open source, and how Fontis engineers next-gen stacks for Australian retailers aiming for market leadership.</description></item><item><title>Algolia to Typesense Migration Services</title><link>https://fontis.au/ecommerce-development/migration-services/algolia-typesense-migration/</link><pubDate>Thu, 23 May 2024 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/migration-services/algolia-typesense-migration/</guid><description>&lt;section class="text-gray-900 bg-white py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Migration Services&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-gray-900 font-bold text-4xl mb-4"&gt;Effortless Migration from Algolia to Typesense with Fontis&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 row-start-2 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-gray-900 text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; Is your ecommerce platform struggling with the limitations of Algolia's pricing structure? Are you concerned about data ownership and vendor lock-in? Fontis can help you seamlessly migrate your search functionality from Algolia to Typesense, a powerful open source alternative that empowers you to take control of your search experience.&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 row-start-3 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&#10;&lt;!-- Created with Inkscape (http://www.inkscape.org/) --&gt;&#10;&#10;&lt;svg&#10; width="800"&#10; height="450"&#10; viewBox="0 0 800 450"&#10; version="1.1"&#10; id="svg1"&#10; xml:space="preserve"&#10; inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"&#10; sodipodi:docname="algolia-typesense.svg"&#10; xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"&#10; xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"&#10; xmlns="http://www.w3.org/2000/svg"&#10; xmlns:svg="http://www.w3.org/2000/svg"&gt;&lt;sodipodi:namedview&#10; id="namedview1"&#10; pagecolor="#ffffff"&#10; bordercolor="#000000"&#10; borderopacity="0.25"&#10; inkscape:showpageshadow="2"&#10; inkscape:pageopacity="0.0"&#10; inkscape:pagecheckerboard="0"&#10; inkscape:deskcolor="#d1d1d1"&#10; inkscape:document-units="px"&#10; inkscape:zoom="1.1714717"&#10; inkscape:cx="239.0156"&#10; inkscape:cy="166.03048"&#10; inkscape:window-width="2494"&#10; inkscape:window-height="1563"&#10; inkscape:window-x="0"&#10; inkscape:window-y="0"&#10; inkscape:window-maximized="1"&#10; inkscape:current-layer="layer1" /&gt;&lt;defs&#10; id="defs1" /&gt;&lt;g&#10; inkscape:label="Layer 1"&#10; inkscape:groupmode="layer"&#10; id="layer1"&#10; transform="translate(-78.347118,-149.70277)"&gt;&lt;g&#10; fill="#1035bc"&#10; id="g10"&#10; transform="matrix(2.16,0,0,2.16,225.45707,412.08161)"&gt;&lt;path&#10; d="m 15.0736,15.8466 c 0.1105,0.5522 0.1657,1.0859 0.1657,1.6013 0,0.4785 -0.0552,0.9938 -0.1657,1.546 L 8.06135,18.9387 v 18.5521 c 0,1.546 0.71779,2.319 2.15335,2.319 h 4.1963 c 0.2577,0.6258 0.3865,1.2516 0.3865,1.8773 0,0.6258 -0.0368,1.0123 -0.1104,1.1595 -1.6932,0.2209 -3.4417,0.3313 -5.24538,0.3313 -3.57055,0 -5.35583,-1.5276 -5.35583,-4.5828 V 18.9387 L 0.165644,18.9939 C 0.0552147,18.4417 0,17.9264 0,17.4479 0,16.9325 0.0552147,16.3988 0.165644,15.8466 l 3.920246,0.0552 v -5.7975 c 0,-0.99387 0.14724,-1.69325 0.44172,-2.09816 C 4.82209,7.56442 5.39264,7.34356 6.23926,7.34356 h 1.4908 l 0.33129,0.33129 v 8.28225 z"&#10; id="path1" /&gt;&lt;path&#10; d="m 41.7915,16.1227 -7.5644,25.8957 c -1.3988,4.7485 -2.8896,8.0982 -4.4724,10.0491 -1.5828,1.9509 -3.9571,2.9264 -7.1227,2.9264 -1.6196,0 -3.1104,-0.2393 -4.4724,-0.7178 -0.1104,-1.0307 0.1841,-2.0246 0.8834,-2.9816 1.1411,0.4049 2.3559,0.6073 3.6442,0.6073 1.9509,0 3.4417,-0.6625 4.4724,-1.9877 1.0307,-1.3251 1.9693,-3.3865 2.816,-6.184 l 0.1656,-0.5522 C 29.1841,43.1043 28.448,42.8834 27.9326,42.5153 27.4541,42.1472 27.0492,41.4663 26.7179,40.4724 L 18.9878,16.1779 c 1.1411,-0.4785 1.9509,-0.7178 2.4295,-0.7178 1.0675,0 1.7853,0.6442 2.1534,1.9325 l 4.3619,13.8589 c 0.1473,0.4418 0.9939,3.3129 2.5399,8.6135 0.0736,0.2577 0.2577,0.3865 0.5521,0.3865 l 6.7362,-24.4049 c 0.4786,-0.1472 1.1043,-0.2208 1.8773,-0.2208 0.8099,0 1.4908,0.1104 2.043,0.3313 z"&#10; id="path2" /&gt;&lt;path&#10; d="m 52.4009,41.135 v 10.9325 c 0,0.9938 -0.1472,1.6932 -0.4417,2.0981 -0.2945,0.4418 -0.8834,0.6626 -1.7669,0.6626 H 48.7015 L 48.3703,54.4969 V 16.0123 l 0.3312,-0.3313 h 1.4356 c 0.8835,0 1.4724,0.2392 1.7669,0.7178 0.3313,0.4417 0.4969,1.1779 0.4969,2.2086 v 0.276 c 2.2086,-2.4662 4.8405,-3.6994 7.8957,-3.6994 3.1289,0 5.4847,1.27 7.0675,3.8099 1.5828,2.503 2.3743,5.9816 2.3743,10.4356 0,2.1717 -0.2945,4.1226 -0.8835,5.8527 -0.5521,1.7301 -1.3067,3.2025 -2.2638,4.4172 -0.9202,1.1779 -1.9877,2.0981 -3.2024,2.7607 -1.2148,0.6258 -2.4663,0.9387 -3.7546,0.9387 -2.5399,0 -4.951,-0.7546 -7.2332,-2.2638 z m 0,-17.9448 v 14.1902 c 2.2454,1.6564 4.362,2.4846 6.3497,2.4846 1.9878,0 3.6258,-0.8834 4.9141,-2.6503 1.2884,-1.7668 1.9326,-4.4356 1.9326,-8.0061 0,-1.7669 -0.1657,-3.2945 -0.497,-4.5828 -0.2945,-1.3252 -0.6994,-2.4111 -1.2147,-3.2577 -0.5153,-0.8834 -1.1227,-1.5276 -1.8221,-1.9325 -0.6626,-0.4417 -1.3804,-0.6626 -2.1534,-0.6626 -1.4724,0 -2.8711,0.3865 -4.1963,1.1595 -1.3251,0.773 -2.4294,1.8589 -3.3129,3.2577 z"&#10; id="path3" /&gt;&lt;path&#10; d="M 97.6973,30.6442 H 80.5807 c 0.1841,6.2576 2.5583,9.3865 7.1227,9.3865 2.5031,0 5.1718,-0.773 8.0061,-2.319 0.8099,0.7361 1.3068,1.6748 1.4909,2.8159 -3.0184,2.0614 -6.405,3.092 -10.1596,3.092 -1.9141,0 -3.5521,-0.3497 -4.9141,-1.049 -1.3619,-0.7362 -2.4846,-1.7301 -3.3681,-2.9816 -0.8466,-1.2884 -1.4724,-2.7976 -1.8773,-4.5277 -0.4049,-1.73 -0.6073,-3.6257 -0.6073,-5.6871 0,-2.0981 0.2392,-4.0122 0.7178,-5.7423 0.5153,-1.7301 1.2515,-3.2209 2.2085,-4.4724 0.9571,-1.2515 2.0982,-2.227 3.4234,-2.9264 1.3619,-0.6994 2.9079,-1.0491 4.638,-1.0491 1.6932,0 3.2025,0.3129 4.5276,0.9387 1.362,0.589 2.4847,1.4172 3.3681,2.4847 0.9203,1.0306 1.6196,2.2822 2.0982,3.7546 0.4785,1.4355 0.7178,2.9816 0.7178,4.638 0,0.6626 -0.0369,1.3067 -0.1105,1.9325 -0.0368,0.589 -0.092,1.1595 -0.1656,1.7117 z M 80.5807,27.4969 h 13.2516 v -0.7178 c 0,-2.5398 -0.5338,-4.5828 -1.6013,-6.1288 -1.0675,-1.546 -2.6687,-2.319 -4.8037,-2.319 -2.0981,0 -3.7362,0.8282 -4.9141,2.4847 -1.1411,1.6564 -1.7852,3.8834 -1.9325,6.6809 z"&#10; id="path4" /&gt;&lt;path&#10; d="m 103.381,41.0245 c 0.036,-0.8098 0.257,-1.6932 0.662,-2.6503 0.442,-0.9938 0.939,-1.7668 1.491,-2.319 2.908,1.5828 5.466,2.3743 7.675,2.3743 1.214,0 2.19,-0.2393 2.926,-0.7178 0.773,-0.4786 1.16,-1.1227 1.16,-1.9326 0,-1.2883 -0.994,-2.319 -2.982,-3.092 l -3.092,-1.1595 c -4.638,-1.6932 -6.957,-4.3988 -6.957,-8.1166 0,-1.3251 0.239,-2.503 0.718,-3.5337 0.515,-1.0675 1.214,-1.9693 2.098,-2.7055 0.92,-0.773 2.006,-1.362 3.258,-1.7669 1.251,-0.4049 2.65,-0.6074 4.196,-0.6074 0.699,0 1.472,0.0553 2.319,0.1657 0.883,0.1104 1.767,0.2761 2.65,0.4969 0.884,0.1841 1.73,0.4049 2.54,0.6626 0.81,0.2577 1.509,0.5337 2.098,0.8282 0,0.9203 -0.184,1.8773 -0.552,2.8712 -0.368,0.9939 -0.865,1.73 -1.491,2.2086 -2.908,-1.2884 -5.429,-1.9325 -7.564,-1.9325 -0.957,0 -1.712,0.2392 -2.264,0.7178 -0.552,0.4417 -0.828,1.0306 -0.828,1.7668 0,1.1411 0.92,2.043 2.761,2.7055 l 3.368,1.2148 c 2.429,0.8466 4.233,2.0061 5.411,3.4785 1.178,1.4724 1.767,3.184 1.767,5.135 0,2.6135 -0.976,4.7116 -2.927,6.2944 -1.951,1.5461 -4.748,2.3191 -8.392,2.3191 -3.571,0 -6.921,-0.9019 -10.049,-2.7056 z"&#10; id="path5" /&gt;&lt;path&#10; d="m 151.772,31.5828 h -15.239 c 0.111,2.0246 0.571,3.6258 1.38,4.8037 0.847,1.1411 2.301,1.7117 4.362,1.7117 2.135,0 4.583,-0.6258 7.344,-1.8773 1.067,1.1042 1.748,2.5582 2.043,4.3619 -2.945,2.0982 -6.479,3.1473 -10.601,3.1473 -3.902,0 -6.865,-1.1964 -8.89,-3.589 -1.988,-2.4294 -2.981,-6.0184 -2.981,-10.7669 0,-2.2086 0.257,-4.1963 0.773,-5.9632 0.515,-1.8036 1.269,-3.3312 2.263,-4.5828 0.994,-1.2883 2.209,-2.2822 3.644,-2.9816 1.436,-0.6994 3.074,-1.0491 4.915,-1.0491 1.877,0 3.533,0.2945 4.969,0.8835 1.436,0.5521 2.65,1.3619 3.644,2.4294 0.994,1.0307 1.73,2.2638 2.209,3.6994 0.515,1.4356 0.773,3 0.773,4.6933 0,0.9202 -0.056,1.8036 -0.166,2.6503 -0.11,0.8098 -0.258,1.6196 -0.442,2.4294 z M 141.116,19.9877 c -2.871,0 -4.417,2.1718 -4.638,6.5154 h 9.165 v -0.6626 c 0,-1.7669 -0.368,-3.1841 -1.104,-4.2515 -0.736,-1.0675 -1.877,-1.6013 -3.423,-1.6013 z"&#10; id="path6" /&gt;&lt;path&#10; d="m 182.033,24.5153 v 12.0368 c 0,2.3559 0.386,4.1043 1.159,5.2454 -1.178,1.0307 -2.595,1.5461 -4.251,1.5461 -1.583,0 -2.669,-0.3497 -3.258,-1.0491 -0.589,-0.7362 -0.884,-1.8773 -0.884,-3.4233 V 26.0061 c 0,-1.6564 -0.202,-2.8159 -0.607,-3.4785 -0.405,-0.6626 -1.159,-0.9939 -2.264,-0.9939 -1.951,0 -3.773,0.8835 -5.466,2.6504 v 18.773 c -0.552,0.1104 -1.141,0.184 -1.767,0.2208 -0.589,0.0368 -1.196,0.0552 -1.822,0.0552 -0.626,0 -1.251,-0.0184 -1.877,-0.0552 -0.589,-0.0368 -1.16,-0.1104 -1.712,-0.2208 V 15.6258 l 0.331,-0.3865 h 2.761 c 2.062,0 3.35,1.1043 3.865,3.3128 2.687,-2.319 5.356,-3.4785 8.006,-3.4785 2.651,0 4.602,0.8651 5.853,2.5951 1.288,1.6933 1.933,3.9755 1.933,6.8466 z"&#10; id="path7" /&gt;&lt;path&#10; d="m 187.825,41.0245 c 0.036,-0.8098 0.257,-1.6932 0.662,-2.6503 0.442,-0.9938 0.939,-1.7668 1.491,-2.319 2.908,1.5828 5.466,2.3743 7.675,2.3743 1.214,0 2.19,-0.2393 2.926,-0.7178 0.773,-0.4786 1.16,-1.1227 1.16,-1.9326 0,-1.2883 -0.994,-2.319 -2.982,-3.092 l -3.092,-1.1595 c -4.638,-1.6932 -6.957,-4.3988 -6.957,-8.1166 0,-1.3251 0.239,-2.503 0.718,-3.5337 0.515,-1.0675 1.214,-1.9693 2.098,-2.7055 0.92,-0.773 2.006,-1.362 3.258,-1.7669 1.251,-0.4049 2.65,-0.6074 4.196,-0.6074 0.699,0 1.472,0.0553 2.319,0.1657 0.883,0.1104 1.767,0.2761 2.65,0.4969 0.884,0.1841 1.73,0.4049 2.54,0.6626 0.81,0.2577 1.509,0.5337 2.098,0.8282 0,0.9203 -0.184,1.8773 -0.552,2.8712 -0.368,0.9939 -0.865,1.73 -1.491,2.2086 -2.908,-1.2884 -5.429,-1.9325 -7.564,-1.9325 -0.957,0 -1.712,0.2392 -2.264,0.7178 -0.552,0.4417 -0.828,1.0306 -0.828,1.7668 0,1.1411 0.92,2.043 2.761,2.7055 l 3.368,1.2148 c 2.429,0.8466 4.233,2.0061 5.411,3.4785 1.178,1.4724 1.767,3.184 1.767,5.135 0,2.6135 -0.976,4.7116 -2.927,6.2944 -1.951,1.5461 -4.748,2.3191 -8.392,2.3191 -3.571,0 -6.921,-0.9019 -10.049,-2.7056 z"&#10; id="path8" /&gt;&lt;path&#10; d="m 236.216,31.5828 h -15.239 c 0.111,2.0246 0.571,3.6258 1.38,4.8037 0.847,1.1411 2.301,1.7117 4.362,1.7117 2.135,0 4.583,-0.6258 7.344,-1.8773 1.067,1.1042 1.748,2.5582 2.043,4.3619 -2.945,2.0982 -6.479,3.1473 -10.601,3.1473 -3.902,0 -6.865,-1.1964 -8.89,-3.589 -1.988,-2.4294 -2.981,-6.0184 -2.981,-10.7669 0,-2.2086 0.257,-4.1963 0.773,-5.9632 0.515,-1.8036 1.269,-3.3312 2.263,-4.5828 0.994,-1.2883 2.209,-2.2822 3.645,-2.9816 1.435,-0.6994 3.073,-1.0491 4.914,-1.0491 1.877,0 3.533,0.2945 4.969,0.8835 1.436,0.5521 2.65,1.3619 3.644,2.4294 0.994,1.0307 1.73,2.2638 2.209,3.6994 0.515,1.4356 0.773,3 0.773,4.6933 0,0.9202 -0.055,1.8036 -0.166,2.6503 -0.11,0.8098 -0.258,1.6196 -0.442,2.4294 z M 225.56,19.9877 c -2.871,0 -4.417,2.1718 -4.638,6.5154 h 9.166 v -0.6626 c 0,-1.7669 -0.369,-3.1841 -1.105,-4.2515 -0.736,-1.0675 -1.877,-1.6013 -3.423,-1.6013 z"&#10; id="path9" /&gt;&lt;path&#10; d="M 244.777,50.6871 V 0.165645 C 245.329,0.0552151 245.955,0 246.655,0 c 0.736,0 1.417,0.0552151 2.042,0.165645 V 50.6871 c -0.625,0.1104 -1.306,0.1657 -2.042,0.1657 -0.7,0 -1.326,-0.0553 -1.878,-0.1657 z"&#10; id="path10" /&gt;&lt;/g&gt;&lt;g&#10; id="g1"&#10; transform="matrix(0.64,0,0,0.64,93.549765,120.33707)"&gt;&lt;path&#10; class="cls-2"&#10; d="m 345.94121,218.52832 v -67.34751 c 0,-0.9075 -0.81,-1.5975 -1.705,-1.4575 l -12.615,1.985 c -0.7175,0.1125 -1.2475,0.7325 -1.2475,1.46 l 0.0425,68.30501 c 0,3.23 0,23.175 23.9925,23.8725 0.8325,0.025 1.5225,-0.645 1.5225,-1.4775 v -10.195 c 0,-0.74 -0.5475,-1.3775 -1.28,-1.46 -8.7125,-1.0025 -8.7125,-11.8925 -8.7125,-13.68 z"&#10; id="path1-6"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;rect&#10; class="cls-1"&#10; x="539.81622"&#10; y="175.88582"&#10; width="15.645"&#10; height="69.474998"&#10; rx="1.475"&#10; ry="1.475"&#10; id="rect1"&#10; style="fill:#003dff;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 541.29122,167.54831 h 12.6925 c 0.815,0 1.475,-0.66 1.475,-1.475 v -14.895 c 0,-0.905 -0.81,-1.5975 -1.705,-1.4575 l -12.6925,1.9875 c -0.7175,0.1125 -1.2475,0.73 -1.2475,1.4575 v 12.905 c 0,0.815 0.66,1.475 1.475,1.475 z"&#10; id="path2-2"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 519.35372,218.52832 v -67.34751 c 0,-0.9075 -0.81,-1.5975 -1.705,-1.4575 l -12.615,1.985 c -0.7175,0.1125 -1.2475,0.7325 -1.2475,1.46 l 0.0425,68.30501 c 0,3.23 0,23.175 23.9925,23.8725 0.8325,0.025 1.5225,-0.645 1.5225,-1.4775 v -10.195 c 0,-0.74 -0.5475,-1.3775 -1.28,-1.46 -8.7125,-1.0025 -8.7125,-11.8925 -8.7125,-13.68 z"&#10; id="path3-9"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 486.33372,185.38332 c -2.785,-3.0625 -6.2075,-5.4125 -10.195,-7.0775 -3.98,-1.63251 -8.315,-2.46251 -13.0175,-2.46251 -4.695,0 -9.0375,0.7925 -12.98,2.46251 -3.8975,1.665 -7.3225,4.0125 -10.19,7.0775 -2.8675,3.0575 -5.09502,6.7175 -6.69,11.0075 -1.595,4.2925 -2.31,9.3425 -2.31,14.59 0,5.2475 0.7975,9.2175 2.3875,13.5525 1.595,4.33 3.785,8.0275 6.6125,11.09 2.8225,3.0575 6.20748,5.405 10.14998,7.115 3.9425,1.7075 10.03002,2.5825 13.10002,2.62 3.0625,0 9.195,-0.955 13.175,-2.62 3.98,-1.67 7.365,-4.0575 10.195,-7.115 2.8225,-3.0625 5.0125,-6.76 6.5625,-11.09 1.555,-4.335 2.31,-8.305 2.31,-13.5525 0,-5.2475 -0.835,-10.2975 -2.5075,-14.59 -1.595,-4.2925 -3.785,-7.95 -6.6075,-11.0075 z m -11.1075,40.9375 c -2.8675,3.9375 -6.89,5.925 -12.0225,5.925 -5.1375,0 -9.1575,-1.95 -12.025,-5.925 -2.8675,-3.9375 -4.3025,-8.5025 -4.3025,-15.3 0,-6.7225 1.3975,-12.285 4.265,-16.2175 2.8625,-3.9375 6.885,-5.88 12.0175,-5.88 5.1375,0 9.1575,1.945 12.0225,5.88 2.8675,3.8925 4.34,9.495 4.34,16.2175 0,6.7975 -1.43,11.325 -4.2975,15.3 z"&#10; id="path4-1"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 301.95121,175.88581 h -12.3325 c -12.09,0 -22.7275,6.37001 -28.9375,16.02501 -3.63,5.645 -5.7475,12.4075 -5.7475,19.6825 0,11.2225 5.0325,21.23 12.8975,27.775 0.7325,0.65 1.5125,1.245 2.3275,1.785 3.215,2.1225 7.0275,3.3675 11.13,3.3675 0.3075,0 0.615,-0.007 0.92,-0.0225 0.09,-0.005 0.1775,-0.0125 0.2675,-0.0175 0.2175,-0.0125 0.4375,-0.0275 0.655,-0.05 0.085,-0.008 0.17,-0.02 0.255,-0.03 0.2275,-0.025 0.455,-0.0525 0.6825,-0.085 0.0525,-0.007 0.105,-0.0175 0.1575,-0.025 8.2225,-1.2675 15.39,-7.705 17.725,-15.7025 v 14.4575 c 0,0.815 0.66,1.475 1.475,1.475 h 12.605 c 0.815,0 1.475,-0.66 1.475,-1.475 v -65.68501 c 0,-0.815 -0.66,-1.475 -1.475,-1.475 z m 0,51.73001 c -3.05,2.54 -6.9925,3.495 -11.21,3.78 -0.04,0.002 -0.0825,0.007 -0.1225,0.01 -0.28,0.0175 -0.56,0.025 -0.84,0.025 -10.56,0 -19.28,-8.9725 -19.28,-19.8425 0,-2.5625 0.49,-5.0025 1.355,-7.245 2.805,-7.28 9.6925,-12.435 17.765,-12.435 h 12.3325 z"&#10; id="path5-2"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 611.83872,175.88581 h -12.3325 c -12.09,0 -22.7275,6.37001 -28.9375,16.02501 -3.63,5.645 -5.7475,12.4075 -5.7475,19.6825 0,11.2225 5.0325,21.23 12.8975,27.775 0.7325,0.65 1.5125,1.245 2.3275,1.785 3.215,2.1225 7.0275,3.3675 11.13,3.3675 0.3075,0 0.615,-0.007 0.92,-0.0225 0.09,-0.005 0.1775,-0.0125 0.2675,-0.0175 0.2175,-0.0125 0.4375,-0.0275 0.655,-0.05 0.085,-0.008 0.17,-0.02 0.255,-0.03 0.2275,-0.025 0.455,-0.0525 0.6825,-0.085 0.053,-0.007 0.105,-0.0175 0.1575,-0.025 8.2225,-1.2675 15.39,-7.705 17.725,-15.7025 v 14.4575 c 0,0.815 0.66,1.475 1.475,1.475 h 12.605 c 0.815,0 1.475,-0.66 1.475,-1.475 v -65.68501 c 0,-0.815 -0.66,-1.475 -1.475,-1.475 z m 0,51.73001 c -3.05,2.54 -6.9925,3.495 -11.21,3.78 -0.04,0.002 -0.082,0.007 -0.1225,0.01 -0.28,0.0175 -0.56,0.025 -0.84,0.025 -10.56,0 -19.28,-8.9725 -19.28,-19.8425 0,-2.5625 0.49,-5.0025 1.355,-7.245 2.805,-7.28 9.6925,-12.435 17.765,-12.435 h 12.3325 z"&#10; id="path6-7"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-2"&#10; d="m 406.8587,175.88581 h -12.33249 c -12.09,0 -22.7275,6.37001 -28.9375,16.02501 -2.9475,4.585 -4.9,9.91 -5.5275,15.6475 -0.145,1.325 -0.22,2.67 -0.22,4.035 0,1.365 0.0775,2.7875 0.2325,4.1475 1.07,9.5225 5.785,17.9025 12.665,23.63 0.7325,0.65 1.5125,1.245 2.3275,1.785 3.215,2.1225 7.0275,3.3675 11.13,3.3675 v 0 c 4.4975,0 8.6525,-1.4825 12.04,-3.9925 4.0725,-2.895 7.22,-7.135 8.62001,-11.9375 v 12.565 h -0.0275 v 2.77 c 0,5.46 -1.42751,9.5675 -4.33501,12.34 -2.9025,2.77 -7.76,4.1575 -14.5625,4.1575 -2.78,0 -7.1975,-0.1475 -11.65,-0.6025 -0.7075,-0.0725 -1.365,0.375 -1.5675,1.055 l -3.195,10.7775 c -0.255,0.865 0.3175,1.755 1.2075,1.8825 5.38,0.77 10.63,1.17 13.6625,1.17 12.2275,0 21.29001,-2.6875 27.22251,-8.0525 5.37,-4.8525 8.2875,-12.2225 8.8,-22.13 v -67.16501 c 0,-0.815 -0.66,-1.475 -1.475,-1.475 h -14.08 z m 0,16.02501 c 0,0 0.16252,34.7825 0,35.84 -3.01999,2.4425 -6.77749,3.3975 -10.87249,3.675 -0.04,0.002 -0.0825,0.007 -0.1225,0.01 -0.28,0.0175 -0.56,0.025 -0.84,0.025 -0.33,0 -0.6575,-0.007 -0.985,-0.025 -10.1025,-0.5275 -18.63,-9.315 -18.63,-19.845 0,-2.5625 0.49,-5.0025 1.355,-7.245 2.805,-7.28 9.6925,-12.435 17.765,-12.435 h 12.33249 z"&#10; id="path7-0"&#10; style="fill:#003dff;fill-rule:evenodd;stroke-width:0.25" /&gt;&lt;path&#10; class="cls-1"&#10; d="m 140.80371,149.70331 c -34.1325,0 -61.957505,27.5225 -62.450005,61.54001 -0.5,34.5475 27.530005,63.175 62.082505,63.375 10.67,0.0625 20.9475,-2.5475 30.075,-7.5075 0.89,-0.4825 1.0275,-1.7075 0.27,-2.3775 l -5.845,-5.18 c -1.1875,-1.0525 -2.8775,-1.35 -4.34,-0.73 -6.37,2.71 -13.2925,4.095 -20.4275,4.0075 -27.92,-0.3425 -50.477505,-23.5725 -50.032505,-51.49 0.44,-27.565 23.000005,-49.85251 50.667505,-49.85251 h 50.6725 v 90.06751 l -28.75,-25.545 c -0.93,-0.8275 -2.355,-0.665 -3.105,0.3275 -4.615,6.11 -12.1325,9.91 -20.4825,9.335 -11.5825,-0.8 -20.9675,-10.125 -21.835,-21.7025 -1.0375,-13.81 9.9075,-25.38 23.5,-25.38 12.295,0 22.42,9.4625 23.4775,21.4875 0.095,1.07 0.5775,2.0675 1.38,2.78 l 7.4875,6.6375 c 0.85,0.7525 2.1975,0.2925 2.4075,-0.825 0.54,-2.8875 0.73,-5.895 0.5175,-8.98 -1.205,-17.585 -15.45,-31.7325 -33.0425,-32.81501 -20.17,-1.2425 -37.0325,14.53501 -37.5675,34.31251 -0.5225,19.275 15.27,35.89 34.5475,36.315 8.0475,0.1775 15.5075,-2.3525 21.535,-6.7375 l 37.565,33.3 c 1.61,1.4275 4.1525,0.285 4.1525,-1.8675 V 152.07331 c -0.003,-1.3075 -1.0625,-2.37 -2.3725,-2.37 z"&#10; id="path8-9"&#10; style="fill:#003dff;stroke-width:0.25" /&gt;&lt;/g&gt;&lt;path&#10; style="clip-rule:evenodd;fill-rule:evenodd;stroke-width:0.46481"&#10; id="path5-6"&#10; d="m 168.97889,310.00121 c -8.80207,11.25132 -15.74048,22.33037 -20.67334,33.22978 -4.79063,10.58574 -6.55819,20.57178 -4.88833,30.74081 4.83569,29.4439 45.82318,49.19336 45.82318,49.19336 l 8.94015,-13.78949 10.64612,36.66486 -38.2902,5.97284 7.43232,-11.46328 c 0,0 -39.35721,-21.01282 -43.49008,-59.10483 -2.44883,-22.56999 9.05952,-46.86651 31.95201,-72.99812 0.1675,-0.0196 1.86554,0.97674 2.54817,1.55407 z" /&gt;&lt;/g&gt;&lt;/svg&gt;&#10;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10; &#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&lt;section id="features-gidwvcd4kpc9kaxy" class="bg-gradient-to-t from-white to-blue-50 py-20 lg:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &#10; &lt;div class="pb-6"&gt;&#10; &#10; &lt;small class="pt-2 pb-6 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Why Typesense?&lt;/small&gt;&#10; &#10; &lt;h2 class="text-4xl font-bold text-gray-900"&gt;Unlock the Advantages of Typesense&lt;/h2&gt;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;p class="text-gray-900 max-w-prose"&gt;Typesense offers a compelling alternative to Algolia, delivering exceptional search functionality alongside a unique set of benefits&lt;/p&gt;&#10; &#10;&#10; &lt;div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 w-full overflow-auto gap-x-12 gap-y-12 lg:gap-y-12 mt-12 xl:mt-16"&gt;&#10; &#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Reduced Costs&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Typesense reduces ongoing costs by focusing on what matters, not adding features no-one wants.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Own Your Data&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Typesense is an open source platform that empowers you to maintain complete ownership and control of your search data, ensuring its security and privacy.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Algolia Compatibility&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; The migration process is designed to be smooth and efficient, ensuring minimal disruption to your existing search experience. Typesense offers compatibility with Algolia's API, making the transition effortless for your developers.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &lt;/div&gt;&#10;&#10; &#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Form Submitted</title><link>https://fontis.au/contact-us/success-schedule/</link><pubDate>Thu, 23 May 2024 07:00:00 +0000</pubDate><guid>https://fontis.au/contact-us/success-schedule/</guid><description>&lt;section id="contact" class="bg-white py-20 xl:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &lt;header&gt;&#10; &lt;h2 class="font-bold text-4xl"&gt;Thank You!&lt;/h2&gt;&#10; &lt;/header&gt;&#10; &lt;p class="text-xl mt-8"&gt;We'll be in touch shortly to schedule a call with you.&lt;/p&gt;&#10; &lt;p class="text-xl mt-8"&gt;If you are ready to book a call now, below you can pick a time and date that works for you.&#10; &lt;/p&gt;&#10; &lt;div class="mt-8"&gt;&#10; &lt;!-- Cal inline embed code begins --&gt;&#10; &lt;div style="width:100%;height:100%;overflow:scroll" id="my-cal-inline-30min"&gt;&lt;/div&gt;&#10; &lt;script type="text/javascript"&gt;&#10; (function (C, A, L) { let p = function (a, ar) { a.q.push(ar); }; let d = C.document; C.Cal = C.Cal || function () { let cal = C.Cal; let ar = arguments; if (!cal.loaded) { cal.ns = {}; cal.q = cal.q || []; d.head.appendChild(d.createElement("script")).src = A; cal.loaded = true; } if (ar[0] === L) { const api = function () { p(api, arguments); }; const namespace = ar[1]; api.q = api.q || []; if (typeof namespace === "string") { cal.ns[namespace] = cal.ns[namespace] || api; p(cal.ns[namespace], ar); p(cal, ["initNamespace", namespace]); } else p(cal, ar); return; } p(cal, ar); }; })(window, "https://app.cal.eu/embed/embed.js", "init");&#10; Cal("init", "30min", { origin: "https://app.cal.eu" });&#10;&#10; Cal.ns["30min"]("inline", {&#10; elementOrSelector: "#my-cal-inline-30min",&#10; config: { "layout": "month_view", "useSlotsViewOnSmallScreen": "true" },&#10; calLink: "fontis/30min",&#10; });&#10;&#10; Cal.ns["30min"]("ui", { "hideEventTypeDetails": false, "layout": "month_view" });&#10; &lt;/script&gt;&#10; &lt;!-- Cal inline embed code ends --&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Form Submitted</title><link>https://fontis.au/contact-us/success/</link><pubDate>Thu, 23 May 2024 07:00:00 +0000</pubDate><guid>https://fontis.au/contact-us/success/</guid><description>&lt;section id="contact" class="bg-white py-20 xl:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &lt;header&gt;&#10; &lt;h2 class="font-bold text-4xl"&gt;Your message has been sent&lt;/h2&gt;&#10; &lt;/header&gt;&#10; &lt;p class="text-xl mt-8"&gt;Thank you for getting in touch with us!&lt;/p&gt;&#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Shopify Developers Melbourne | Expert Melbourne-based Shopify Solutions</title><link>https://fontis.au/ecommerce-development/shopify/melbourne/</link><pubDate>Thu, 23 May 2024 07:00:00 +0000</pubDate><guid>https://fontis.au/ecommerce-development/shopify/melbourne/</guid><description>&lt;section class="text-gray-900 bg-white py-20 lg:py-36"&gt;&#10; &#10; &lt;section class="max-w-7xl mx-auto px-8 xl:px-4 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-x-24 lg:gap-y-3 items-center justify-center"&gt;&#10; &#10; &#10; &#10; &lt;div class="col-start-1 row-start-1 z-10"&gt;&#10; &#10; &lt;small class="pt-2 mb-4 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Empowering Your Ecommerce Success in Melbourne&lt;/small&gt;&#10; &#10; &#10; &lt;h1 class="text-gray-900 font-bold text-4xl mb-4"&gt;Expert Shopify Development Services in Melbourne&lt;/h1&gt;&#10; &#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-2 lg:row-span-1 text-gray-900 text-xl font-medium max-w-prose z-10"&gt;&#10; &#10; Take your ecommerce business to the next level with our expert Shopify development services. Fontis provides customised solutions that cater to the unique needs of businesses in Melbourne, ensuring a seamless and efficient online store that drives growth and enhances customer satisfaction.&#10;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-1 lg:row-start-3 pt-6 z-10"&gt;&#10; &lt;a class="button" href="https://fontis.au/book-appointment"&gt;Book a Consultation&lt;/a&gt;&#10; &lt;/div&gt;&#10; &#10; &#10;&#10; &#10; &lt;div class="col-start-1 lg:col-start-2 lg:row-start-1 lg:row-span-3 lg:relative md:min-h-96 z-0"&gt;&#10; &lt;div class="lg:absolute object-contain h-full w-full flex items-center justify-center"&gt;&#10; &#10; &#10; &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&#10;&lt;svg&#10; id="Layer_1"&#10; data-name="Layer 1"&#10; viewBox="0 0 360.00001 400"&#10; version="1.1"&#10; sodipodi:docname="fontis-shopify.svg"&#10; xml:space="preserve"&#10; width="360"&#10; height="400"&#10; inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"&#10; xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"&#10; xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"&#10; xmlns="http://www.w3.org/2000/svg"&#10; xmlns:svg="http://www.w3.org/2000/svg"&#10; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&#10; xmlns:cc="http://creativecommons.org/ns#"&#10; xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;&lt;sodipodi:namedview&#10; id="namedview4"&#10; pagecolor="#ffffff"&#10; bordercolor="#000000"&#10; borderopacity="0.25"&#10; inkscape:showpageshadow="2"&#10; inkscape:pageopacity="0.0"&#10; inkscape:pagecheckerboard="0"&#10; inkscape:deskcolor="#d1d1d1"&#10; inkscape:zoom="3.3637466"&#10; inkscape:cx="178.22389"&#10; inkscape:cy="315.86803"&#10; inkscape:window-width="2494"&#10; inkscape:window-height="1371"&#10; inkscape:window-x="0"&#10; inkscape:window-y="0"&#10; inkscape:window-maximized="1"&#10; inkscape:current-layer="layer1" /&gt;&lt;defs&#10; id="defs4"&gt;&lt;clipPath&#10; id="clip-path"&gt;&lt;path&#10; d="m 57.8,110.89 c -1.13,-3 -2.11,-5.92 -3,-8.67 l 123.54,-71.33 60,34.62 C 219.81,77.8 201.34,93 186.73,114.2 a 154.9,154.9 0 0 0 -17.19,33.27 C 163,167.2 139,177 116,169.42 v 0 C 81,158.69 65.81,132.33 57.8,110.89 Z M 206,228.85 a 50.83,50.83 0 0 0 -1.47,-5.49 v 0 c -6.7,-20.65 -25.55,-33.75 -44.28,-29.87 a 156.17,156.17 0 0 1 -37.41,1.75 c -25.65,-2 -48.07,-10.45 -68,-20.37 v 57.11 0 12.14 l 123.53,71.33 c 1.94,-2.15 4,-4.45 6,-6.93 14.57,-17.66 29.79,-44 21.6,-79.65 z M 293,99.74 a 124.88,124.88 0 0 0 -20.59,-1.82 88.48,88.48 0 0 0 -30.63,5.21 83.78,83.78 0 0 0 -28.55,17.75 v 0 c -18.1,16.14 -21.56,41.8 -7.73,57.3 a 159.31,159.31 0 0 1 15.46,22.52 c 0.21,0.36 0.45,0.73 0.66,1.09 1.09,2 2.06,3.92 3,5.88 0.34,0.67 0.74,1.37 1.06,2 v 0 c 11.06,23.23 15,46.85 16.36,69 l 60,-34.64 V 101.49 c -2.92,-0.6 -5.94,-1.21 -9.1,-1.75 z"&#10; fill="none"&#10; id="path1" /&gt;&lt;/clipPath&gt;&lt;radialGradient&#10; id="radial-gradient"&#10; cx="189.52"&#10; cy="259.35001"&#10; r="252.16"&#10; gradientTransform="matrix(-0.09,-1,1.16,-0.1,-93.23,475.13)"&#10; gradientUnits="userSpaceOnUse"&gt;&lt;stop&#10; offset="0"&#10; stop-color="#aacc85"&#10; id="stop1" /&gt;&lt;stop&#10; offset="0.25"&#10; stop-color="#84b540"&#10; id="stop2" /&gt;&lt;stop&#10; offset="0.51"&#10; stop-color="#4a863f"&#10; id="stop3" /&gt;&lt;stop&#10; offset="1"&#10; stop-color="#256634"&#10; id="stop4" /&gt;&lt;/radialGradient&gt;&lt;filter&#10; style="color-interpolation-filters:sRGB"&#10; inkscape:label="Drop Shadow"&#10; id="filter15"&#10; x="-0.18790517"&#10; y="-0.1652335"&#10; width="1.4227866"&#10; height="1.3717754"&gt;&lt;feFlood&#10; result="flood"&#10; in="SourceGraphic"&#10; flood-opacity="0.498039"&#10; flood-color="rgb(0,0,0)"&#10; id="feFlood14" /&gt;&lt;feGaussianBlur&#10; result="blur"&#10; in="SourceGraphic"&#10; stdDeviation="20.000000"&#10; id="feGaussianBlur14" /&gt;&lt;feOffset&#10; result="offset"&#10; in="blur"&#10; dx="12.000000"&#10; dy="12.000000"&#10; id="feOffset14" /&gt;&lt;feComposite&#10; result="comp1"&#10; operator="in"&#10; in="flood"&#10; in2="offset"&#10; id="feComposite14" /&gt;&lt;feComposite&#10; result="comp2"&#10; operator="over"&#10; in="SourceGraphic"&#10; in2="comp1"&#10; id="feComposite15" /&gt;&lt;/filter&gt;&lt;/defs&gt;&lt;title&#10; id="title4"&gt;Fontis Logo Only&lt;/title&gt;&lt;g&#10; clip-path="url(#clip-path)"&#10; id="g4"&#10; transform="translate(47.739039,-24.479771)"&gt;&lt;rect&#10; x="25.959999"&#10; y="61.900002"&#10; width="333.70999"&#10; height="297.04999"&#10; fill="#226432"&#10; id="rect4" /&gt;&lt;path&#10; d="M -56.75,69 A 175.58,175.58 0 1 0 118.83,-106.57 175.58,175.58 0 0 0 -56.75,69 Z"&#10; fill="url(#radial-gradient)"&#10; id="path4"&#10; style="fill:url(#radial-gradient)" /&gt;&lt;/g&gt;&lt;g&#10; inkscape:groupmode="layer"&#10; id="layer1"&#10; inkscape:label="Shopify"&gt;&lt;g&#10; id="g5"&#10; transform="matrix(0.78293821,0,0,0.78293814,15.826359,115.78166)"&#10; style="filter:url(#filter15)"&gt;&lt;path&#10; d="m 223.774,57.34 c -0.201,-1.46 -1.48,-2.268 -2.537,-2.357 -1.055,-0.088 -23.383,-1.743 -23.383,-1.743 0,0 -15.507,-15.395 -17.209,-17.099 -1.703,-1.703 -5.029,-1.185 -6.32,-0.805 -0.19,0.056 -3.388,1.043 -8.678,2.68 -5.18,-14.906 -14.322,-28.604 -30.405,-28.604 -0.444,0 -0.901,0.018 -1.358,0.044 -4.574,-6.049 -10.24,-8.677 -15.134,-8.677 -37.465,0 -55.364,46.835 -60.976,70.635 -14.558,4.511 -24.9,7.718 -26.221,8.133 -8.126,2.549 -8.383,2.805 -9.45,10.462 C 21.3,95.806 0.038,260.235 0.038,260.235 l 165.678,31.042 89.77,-19.42 c 0,0 -31.513,-213.057 -31.711,-214.517 z M 156.49,40.848 142.471,45.187 c 0.005,-0.988 0.01,-1.96 0.01,-3.023 0,-9.264 -1.286,-16.723 -3.349,-22.636 8.287,1.04 13.806,10.469 17.358,21.32 z M 128.852,21.365 c 2.304,5.773 3.802,14.058 3.802,25.238 0,0.572 -0.005,1.095 -0.01,1.624 -9.117,2.824 -19.024,5.89 -28.953,8.966 5.575,-21.516 16.025,-31.908 25.161,-35.828 z M 117.721,10.828 c 1.617,0 3.246,0.549 4.805,1.622 C 110.519,18.1 97.649,32.33 92.214,60.747 L 69.328,67.835 C 75.694,46.16 90.81,10.828 117.72,10.828 Z"&#10; fill="#95bf46"&#10; id="path1-3" /&gt;&lt;path&#10; d="m 221.237,54.983 c -1.055,-0.088 -23.383,-1.743 -23.383,-1.743 0,0 -15.507,-15.395 -17.209,-17.099 -0.637,-0.634 -1.496,-0.959 -2.394,-1.099 l -12.527,256.233 89.762,-19.418 c 0,0 -31.514,-213.057 -31.712,-214.517 -0.201,-1.46 -1.48,-2.268 -2.537,-2.357"&#10; fill="#5e8e3e"&#10; id="path2" /&gt;&lt;path&#10; d="m 135.242,104.585 -11.069,32.926 c 0,0 -9.698,-5.176 -21.586,-5.176 -17.428,0 -18.305,10.937 -18.305,13.693 0,15.038 39.2,20.8 39.2,56.024 0,27.713 -17.577,45.558 -41.277,45.558 -28.44,0 -42.984,-17.7 -42.984,-17.7 l 7.615,-25.16 c 0,0 14.95,12.835 27.565,12.835 8.243,0 11.596,-6.49 11.596,-11.232 0,-19.616 -32.16,-20.491 -32.16,-52.724 0,-27.129 19.472,-53.382 58.778,-53.382 15.145,0 22.627,4.338 22.627,4.338"&#10; fill="#ffffff"&#10; id="path3" /&gt;&lt;/g&gt;&lt;/g&gt;&lt;metadata&#10; id="metadata15"&gt;&lt;rdf:RDF&gt;&lt;cc:Work&#10; rdf:about=""&gt;&lt;dc:title&gt;Fontis Logo Only&lt;/dc:title&gt;&lt;/cc:Work&gt;&lt;/rdf:RDF&gt;&lt;/metadata&gt;&lt;/svg&gt;&#10;&#10; &#10; &#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10; &lt;/section&gt;&#10;&lt;/section&gt;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&lt;section id="features-ca8l3acjwvzgl2pg" class="bg-gradient-to-t from-white to-blue-50 py-20 lg:py-36"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0"&gt;&#10; &#10; &lt;div class="pb-6"&gt;&#10; &#10; &lt;small class="pt-2 pb-6 text-sm lg:text-lg font-bold uppercase tracking-wide text-fontis-green"&gt;Your Local Shopify Experts with a Global Perspective&lt;/small&gt;&#10; &#10; &lt;h2 class="text-4xl font-bold text-gray-900"&gt;Why Choose Fontis for Shopify Development in Melbourne?&lt;/h2&gt;&#10; &lt;/div&gt;&#10; &#10;&#10; &#10; &lt;p class="text-gray-900 max-w-prose"&gt;Fontis combines local expertise with global experience to deliver top-notch Shopify development services. Our Melbourne-based team understands the unique challenges and opportunities of the local market, providing solutions that are both innovative and relevant.&lt;/p&gt;&#10; &#10;&#10; &lt;div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 w-full overflow-auto gap-x-12 gap-y-12 lg:gap-y-12 mt-12 xl:mt-16"&gt;&#10; &#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="art--tools--01_1_" d="M1,31.36c-0.094,0-0.186-0.037-0.254-0.105c-0.104-0.104-0.134-0.262-0.077-0.396l3-7&#10;&#9;c0.018-0.042,0.044-0.081,0.077-0.113L26.451,1.04c0.256-0.257,0.598-0.398,0.961-0.398c0,0,0,0,0.001,0&#10;&#9;c0.363,0,0.705,0.141,0.962,0.398l2.586,2.586c0.529,0.53,0.529,1.392,0,1.923L8.254,28.255c-0.032,0.032-0.07,0.058-0.113,0.076&#10;&#9;l-7,3C1.096,31.351,1.048,31.36,1,31.36z M2.472,28.48l-0.786,1.834l1.833-0.786L2.472,28.48z M2.777,27.768l1.455,1.456&#10;&#9;l3.408-1.461V26.36H6c-0.199,0-0.36-0.161-0.36-0.36v-1.64H4.237L2.777,27.768z M6.36,25.64H8c0.199,0,0.36,0.161,0.36,0.36v1.131&#10;&#9;L25.991,9.5L22.5,6.009L4.869,23.64H6c0.199,0,0.36,0.161,0.36,0.36V25.64z M23.01,5.5l3.49,3.491L27.491,8L24,4.509L23.01,5.5z&#10;&#9; M24.51,4L28,7.491l2.451-2.451c0.249-0.25,0.249-0.656,0-0.905l-2.586-2.586c-0.121-0.121-0.281-0.188-0.452-0.188&#10;&#9;c-0.001,0-0.001,0-0.001,0c-0.171,0-0.331,0.067-0.451,0.188L24.51,4z M26,31.36c-0.092,0-0.185-0.035-0.255-0.105l-9-9l0.509-0.51&#10;&#9;l1.245,1.246l2.245-2.246l0.51,0.51L19.009,23.5L21,25.491l1.245-1.246l0.51,0.51L21.509,26l1.991,1.991l2.245-2.246l0.51,0.51&#10;&#9;L24.009,28.5L26,30.491L30.491,26l-8.746-8.745l0.51-0.509l9,9c0.141,0.141,0.141,0.369,0,0.51l-5,5&#10;&#9;C26.185,31.325,26.092,31.36,26,31.36z M8.754,23.755l-0.509-0.51l14.5-14.5l0.51,0.509L8.754,23.755z M9.746,15.254l-9-9&#10;&#9;c-0.141-0.141-0.141-0.368,0-0.509l5-5c0.141-0.141,0.368-0.141,0.509,0l9,9l-0.509,0.509L6,1.509L1.509,6L3.5,7.991l2.246-2.245&#10;&#9;l0.509,0.509L4.009,8.5L6,10.491l1.246-1.245l0.509,0.509L6.509,11L8.5,12.991l2.246-2.245l0.509,0.509L9.009,13.5l1.245,1.246&#10;&#9;L9.746,15.254z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Customised Solutions for Your Business&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Every business is unique. We tailor our Shopify solutions to fit your specific needs, ensuring your online store not only stands out but also delivers an exceptional customer experience.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 27.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="medal--01_00000148642654235329447370000014838649376854217377_" d="M22,31.36c-0.055,0-0.11-0.013-0.161-0.038L16,28.402&#10;&#9;l-5.839,2.92c-0.112,0.056-0.245,0.049-0.351-0.016C9.705,31.24,9.64,31.125,9.64,31V19.173c-2.433-1.897-4-4.855-4-8.173&#10;&#9;C5.64,5.288,10.288,0.64,16,0.64c5.713,0,10.36,4.647,10.36,10.36c0,3.317-1.567,6.275-4,8.173V31c0,0.125-0.065,0.24-0.171,0.307&#10;&#9;C22.132,31.342,22.065,31.36,22,31.36z M16,27.64c0.055,0,0.11,0.013,0.161,0.038l5.479,2.74V19.687&#10;&#9;c-1.624,1.058-3.562,1.674-5.64,1.674c-2.079,0-4.016-0.616-5.64-1.674v10.731l5.479-2.74C15.89,27.652,15.945,27.64,16,27.64z&#10;&#9; M16,1.36c-5.315,0-9.64,4.325-9.64,9.64s4.325,9.64,9.64,9.64s9.64-4.324,9.64-9.64S21.315,1.36,16,1.36z M19,16.36&#10;&#9;c-0.079,0-0.157-0.026-0.223-0.077L16,14.097l-2.777,2.186c-0.121,0.096-0.29,0.103-0.419,0.019&#10;&#9;c-0.129-0.084-0.19-0.242-0.152-0.392l0.93-3.583l-2.793-2.036c-0.126-0.092-0.179-0.254-0.13-0.402&#10;&#9;C10.706,9.74,10.844,9.64,11,9.64h3.494l1.163-3.747c0.094-0.301,0.594-0.301,0.688,0l1.163,3.747H21c0.156,0,0.294,0.1,0.343,0.249&#10;&#9;c0.048,0.148-0.005,0.311-0.131,0.402l-2.794,2.036l0.931,3.583c0.039,0.149-0.022,0.307-0.151,0.392&#10;&#9;C19.137,16.34,19.068,16.36,19,16.36z M12.105,10.36l2.098,1.529c0.12,0.087,0.174,0.238,0.137,0.381l-0.724,2.786l2.161-1.7&#10;&#9;c0.131-0.104,0.314-0.104,0.445,0l2.16,1.7l-0.724-2.786c-0.037-0.143,0.018-0.294,0.137-0.381l2.099-1.529h-2.653&#10;&#9;c-0.158,0-0.297-0.103-0.344-0.253L16,7.215l-0.897,2.892c-0.047,0.15-0.186,0.253-0.344,0.253&#10;&#9;C14.759,10.36,12.105,10.36,12.105,10.36z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Proven Track Record of Success&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Results matter. Our clients have seen significant improvements in their online performance and customer engagement. Trust Fontis to deliver measurable success.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="support--services_1_" d="M13,12.64c-0.199,0-0.36,0.161-0.36,0.36v6c0,0.199,0.161,0.36,0.36,0.36h6&#10;&#9;c0.199,0,0.36-0.161,0.36-0.36v-6c0-0.199-0.161-0.36-0.36-0.36H13z M18.64,18.64h-5.28v-5.28h5.28V18.64z M25.5,5.36H11V4.64h14.5&#10;&#9;c3.231,0,5.86,2.628,5.86,5.86s-2.629,5.86-5.86,5.86H21v-0.72h4.5c2.834,0,5.14-2.306,5.14-5.14S28.334,5.36,25.5,5.36z M1.36,9&#10;&#9;H0.64V8.5c0-1.714,1.032-3.264,2.575-3.959C2.848,4.118,2.641,3.574,2.641,3c0-1.301,1.058-2.36,2.359-2.36S7.359,1.699,7.359,3&#10;&#9;c0,0.574-0.208,1.118-0.574,1.541C8.328,5.236,9.36,6.785,9.36,8.5V9H8.64V8.5c0-1.605-1.087-3.038-2.644-3.483&#10;&#9;C5.861,4.978,5.761,4.864,5.739,4.725C5.718,4.585,5.78,4.447,5.897,4.37C6.362,4.064,6.64,3.552,6.64,3&#10;&#9;c0-0.904-0.736-1.64-1.64-1.64S3.36,2.096,3.36,3c0,0.552,0.277,1.064,0.742,1.37c0.118,0.077,0.18,0.215,0.159,0.355&#10;&#9;C4.239,4.864,4.139,4.978,4.004,5.017C2.447,5.462,1.36,6.894,1.36,8.5V9z M31.36,30.499V31h-0.72v-0.501&#10;&#9;c0-1.605-1.087-3.037-2.643-3.483c-0.136-0.038-0.236-0.152-0.257-0.291c-0.021-0.14,0.04-0.278,0.157-0.355&#10;&#9;c0.465-0.306,0.742-0.817,0.742-1.369c0-0.904-0.735-1.64-1.64-1.64s-1.64,0.735-1.64,1.64c0,0.552,0.277,1.063,0.742,1.369&#10;&#9;c0.117,0.077,0.179,0.216,0.157,0.355c-0.021,0.139-0.121,0.253-0.257,0.291c-1.556,0.446-2.643,1.878-2.643,3.483V31H22.64v-0.501&#10;&#9;c0-1.714,1.032-3.264,2.575-3.959c-0.367-0.423-0.575-0.967-0.575-1.54c0-1.302,1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36&#10;&#9;c0,0.573-0.208,1.117-0.575,1.54C30.328,27.235,31.36,28.785,31.36,30.499z M18.255,23.745L21.509,27l-3.254,3.255l-0.51-0.51&#10;&#9;l2.386-2.385H6.5c-3.231,0-5.86-2.629-5.86-5.86s2.628-5.86,5.86-5.86H11v0.72H6.5c-2.834,0-5.14,2.306-5.14,5.14&#10;&#9;s2.306,5.14,5.14,5.14h13.631l-2.386-2.385L18.255,23.745z"/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Commitment to Ongoing Support&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Our partnership doesn’t end at launch. We provide continuous support and maintenance to keep your Shopify store up-to-date and running smoothly.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&lt;div class="w-full feature-list-item"&gt;&#10; &#10; &lt;div class="w-1/2 py-4 mb-2"&gt;&#10; &#10; &lt;div class="icon-svg flex w-20 h-20"&gt;&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;&#10;&lt;!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --&gt;&#10;&lt;svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"&#10;&#9; viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"&gt;&#10;&lt;path id="cloud--builder--professional--services_1_" d="M16,31.36C7.53,31.36,0.64,24.47,0.64,16S7.53,0.64,16,0.64&#10;&#9;S31.36,7.53,31.36,16S24.47,31.36,16,31.36z M15.385,30.627c0.204,0.009,0.409,0.013,0.615,0.013c4.741,0,8.963-2.265,11.64-5.77&#10;&#9;V12.008h0.721v11.831c1.442-2.268,2.279-4.957,2.279-7.839c0-1.999-0.402-3.904-1.13-5.641L18.363,3.924l0.36-0.624l10.249,5.917&#10;&#9;c-2.174-4.141-6.273-7.119-11.101-7.738L6.723,7.916l-0.36-0.624l10.252-5.919C16.412,1.364,16.206,1.36,16,1.36&#10;&#9;c-4.741,0-8.963,2.266-11.64,5.771v12.862H3.64V8.161C2.197,10.429,1.36,13.119,1.36,16c0,1.998,0.402,3.903,1.13,5.641&#10;&#9;l11.147,6.436l-0.36,0.623L3.028,22.782c2.174,4.142,6.273,7.12,11.101,7.739l11.148-6.437l0.359,0.623L15.385,30.627z&#10;&#9; M10.673,21.676c-0.816,0-1.611-0.423-2.048-1.18l0,0c-0.314-0.544-0.397-1.179-0.233-1.789c0.164-0.611,0.553-1.12,1.097-1.434&#10;&#9;l5.485-3.167c0.073-1.473,0.893-2.825,2.176-3.565c1.724-0.995,3.9-0.699,5.291,0.721c0.078,0.08,0.115,0.19,0.1,0.301&#10;&#9;c-0.015,0.11-0.08,0.208-0.177,0.263l-3.354,1.937c-0.306,0.176-0.41,0.569-0.234,0.875c0.178,0.305,0.57,0.412,0.875,0.234&#10;&#9;l3.354-1.937c0.095-0.056,0.214-0.063,0.315-0.022c0.104,0.042,0.181,0.129,0.211,0.237c0.534,1.916-0.297,3.948-2.021,4.943&#10;&#9;c-1.28,0.741-2.861,0.774-4.176,0.103l-5.484,3.166C11.479,21.574,11.073,21.676,10.673,21.676z M19.33,10.675&#10;&#9;c-0.623,0-1.252,0.16-1.821,0.489c-1.122,0.648-1.819,1.856-1.821,3.153c0,0.128-0.068,0.247-0.18,0.311l-5.659,3.268&#10;&#9;c-0.377,0.218-0.648,0.572-0.762,0.996c-0.114,0.425-0.057,0.866,0.161,1.244l0,0c0.453,0.783,1.459,1.053,2.241,0.601l5.66-3.268&#10;&#9;c0.111-0.064,0.248-0.064,0.359,0c1.124,0.647,2.52,0.646,3.642-0.001c1.301-0.751,1.993-2.209,1.785-3.664l-2.926,1.689&#10;&#9;c-0.648,0.375-1.482,0.151-1.857-0.498c-0.375-0.65-0.151-1.483,0.498-1.858l2.925-1.689C20.925,10.94,20.131,10.675,19.33,10.675z"&#10;&#9;/&gt;&#10;&lt;rect id="_Transparent_Rectangle" style="fill:none;" width="32" height="32"/&gt;&#10;&lt;/svg&gt;&#10;&lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;h3 class="text-lg font-bold mb-2"&gt;Expertise in Advanced Shopify Features&lt;/h3&gt;&#10; &lt;p class="text-base"&gt;&#10; &#10; Stay ahead of the competition. We utilise the latest Shopify features to enhance your store’s functionality, from customisations to seamless integrations.&#10; &#10; &lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&#10; &lt;/div&gt;&#10;&#10; &#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Privacy Policy</title><link>https://fontis.au/privacy-policy/</link><pubDate>Sat, 11 May 2024 07:00:00 +0000</pubDate><guid>https://fontis.au/privacy-policy/</guid><description>&lt;section class="py-12 lg:py-20"&gt;&#10; &lt;div class="max-w-7xl mx-auto px-8 xl:px-0 md-content"&gt;&#10;&lt;h1 id="privacy-policy"&gt;Privacy Policy&lt;/h1&gt;&#10;&lt;p&gt;&lt;strong&gt;Effective from 29 May 2012&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;This privacy statement describes how &lt;strong&gt;Fontis Pty Ltd&lt;/strong&gt; collects and uses the personal information you provide on our website: &lt;strong&gt;fontis.com.au&lt;/strong&gt;. It also describes the choices available to you regarding our use of your personal information and how you can access and update this information.&lt;/p&gt;&#10;&lt;h2 id="collection-and-use-of-personal-information"&gt;Collection and Use of Personal Information&lt;/h2&gt;&#10;&lt;p&gt;We collect the following personal information from you:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Contact Information such as name, email address, mailing address, phone number&lt;/li&gt;&#10;&lt;li&gt;Billing Information such as credit card number, and billing address&lt;/li&gt;&#10;&lt;li&gt;Unique Identifiers such as user name, account number, password&lt;/li&gt;&#10;&lt;li&gt;Preferences Information you provide such as product or content interests, or communication or marketing preferences&lt;/li&gt;&#10;&lt;li&gt;Usage activity about how you interact with us such as purchase history, what content you viewed, and which areas of our site you visited.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;As is true of most websites, we automatically gather information about your computer such as your IP address, browser type, referring/exit pages, and operating system.&lt;/p&gt;&#10;&lt;h3 id="we-use-this-information-to"&gt;We use this information to:&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Fulfil your order&lt;/li&gt;&#10;&lt;li&gt;Send you an order confirmation&lt;/li&gt;&#10;&lt;li&gt;Send you requested product or service information&lt;/li&gt;&#10;&lt;li&gt;Send product updates or warranty information&lt;/li&gt;&#10;&lt;li&gt;Respond to customer service requests&lt;/li&gt;&#10;&lt;li&gt;Administer your account&lt;/li&gt;&#10;&lt;li&gt;Send you a newsletter&lt;/li&gt;&#10;&lt;li&gt;Send you marketing communications&lt;/li&gt;&#10;&lt;li&gt;Improve our website and marketing efforts&lt;/li&gt;&#10;&lt;li&gt;Conduct research and analysis&lt;/li&gt;&#10;&lt;li&gt;Respond to your questions and concerns&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="choiceopt-out"&gt;Choice/Opt-Out&lt;/h3&gt;&#10;&lt;p&gt;You may choose to stop receiving our newsletter or marketing emails by following the unsubscribe instructions included in these emails or you can &lt;a href="https://fontis.au/contact-us/"&gt;contact us&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="disclosure-to-third-parties"&gt;Disclosure to Third Parties&lt;/h2&gt;&#10;&lt;p&gt;We will share your information with third parties only in the ways that are described in this privacy statement.&lt;/p&gt;&#10;&lt;p&gt;We may provide your personal information to companies that provide services to help us with our business activities such as shipping your order or offering customer service. These companies are authorised to use your personal information only as necessary to provide these services to us.&lt;/p&gt;&#10;&lt;p&gt;We may disclose your personal information&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;as required by law, such as to comply with a subpoena, or similar legal process&lt;/li&gt;&#10;&lt;li&gt;when we believe in good faith that disclosure is necessary to protect our rights, protect your safety or the safety of others, investigate fraud, or respond to a government request,&lt;/li&gt;&#10;&lt;li&gt;if Fontis Pty Ltd is involved in a merger, acquisition, or sale of all or a portion of its assets, you will be notified via email and/or a prominent notice on our website of any change in ownership or uses of your personal information, as well as any choices you may have regarding your personal information,&lt;/li&gt;&#10;&lt;li&gt;to any other third party with your prior consent to do so.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="tracking-technologies"&gt;Tracking Technologies&lt;/h2&gt;&#10;&lt;p&gt;We or a third party contracted by us may use technologies such as cookies, web beacons, or scripts to gather information about how you and others interact with our website. For example, we will know how many users access a specific areas or features within our site and which links or ads they clicked on. We use this aggregated information to understand and optimize how our site is used, improve our marketing efforts, and provide content and features that are of interest to you.&lt;/p&gt;&#10;&lt;p&gt;We use Google AdSense to serve ads on this site. When you view or click on an ad a cookie will be set to help better provide advertisements that may be of interest to you on this and other websites. You may opt-out of the use of this cookie by visiting Google’s Advertising and Privacy page: &lt;a href="https://policies.google.com/technologies/ads"&gt;https://policies.google.com/technologies/ads&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="security"&gt;Security&lt;/h2&gt;&#10;&lt;p&gt;The security of your personal information is important to us. We follow generally accepted industry standards to protect the personal information submitted to us, both during transmission and once we receive it. No method of transmission over the Internet, or method of electronic storage, is 100% secure. Therefore, we cannot guarantee its absolute security.&lt;/p&gt;&#10;&lt;p&gt;If you have any questions about security on our website, you can &lt;a href="https://fontis.au/contact-us/"&gt;contact us&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="other-information"&gt;Other Information&lt;/h2&gt;&#10;&lt;p&gt;Our website includes third party hosted widgets, which are interactive mini-programs that run on our site to provide single-purpose services (e.g. sharing of articles, videos, etc.). Personal information, like your email address, may be collected and cookies may be set so the widget can work properly. The information through the widget is subject to the widget provider’s privacy policy&lt;/p&gt;&#10;&lt;h3 id="correcting-and-updating-your-personal-information"&gt;Correcting and Updating Your Personal Information&lt;/h3&gt;&#10;&lt;p&gt;To review and update your personal information to ensure it is accurate, &lt;a href="https://fontis.au/contact-us/"&gt;contact us&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h3 id="notification-of-privacy-statement-changes"&gt;Notification of Privacy Statement Changes&lt;/h3&gt;&#10;&lt;p&gt;We may update this privacy statement to reflect changes to our information practices. If we make any material changes we will notify you by email (sent to the e-mail address specified in your account) or by means of a notice on this site prior to the change becoming effective. We encourage you to periodically review this page for the latest information on our privacy practices.&lt;/p&gt;&#10;&lt;h2 id="feedback"&gt;Feedback&lt;/h2&gt;&#10;&lt;p&gt;You can &lt;a href="https://fontis.au/contact-us/"&gt;contact us&lt;/a&gt; about this privacy statement on our &lt;a href="https://fontis.au/contact-us/"&gt;contact form&lt;/a&gt;.&lt;/p&gt;&#10; &lt;/div&gt;&#10;&lt;/section&gt;</description></item><item><title>Australia 1.0.5 for Magento 2 released</title><link>https://fontis.au/blog/australia-v105-magento-2-released/</link><pubDate>Mon, 26 Aug 2019 06:55:17 +0000</pubDate><guid>https://fontis.au/blog/australia-v105-magento-2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 1.0.5 of the Fontis Australia extension for Magento 2. This is a minor update that fixes an issue with NT postcodes.&lt;/p&gt;&#10;&#10;&lt;p&gt;Changes in this version are:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;Remove integer type cast on postcodes, which causes problems for postcodes starting with 0.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The Fontis Australia extension for Magento 2 is available for immediate download on &lt;a href="https://github.com/fontis/australia-mage2"&gt;GitHub&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/australia-mage2/issues"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Australia Post API SDK 2.0 released</title><link>https://fontis.au/blog/auspost-api-php-v2-released/</link><pubDate>Fri, 05 Apr 2019 05:27:44 +0000</pubDate><guid>https://fontis.au/blog/auspost-api-php-v2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 2.0 of the Australia Post API SDK for PHP. This library is widely used throughout the community and we hope that the new version will address a few of the issues we've had with it over the years, and make it even easier to use for other developers.&lt;/p&gt;&#10;&#10;&lt;p&gt;Some of the highlights from this release are:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;The Guzzle 3 client has been replaced with the more generic HTTPlug PSR-7/PSR-18 client. HTTPlug is a more modern adapter library that uses the current PSR standards for HTTP clients, and removing the Guzzle dependency should also get rid of the annoying "package guzzle/guzzle is abandoned, you should avoid using it" warning Composer shows when installing or updating packages.&lt;/li&gt;&#10;&#10; &lt;li&gt;The library is now using PSR-4 autoloading, and we took the opportunity to move all of the classes into a top-level Fontis namespace.&lt;/li&gt;&#10; &#10; &lt;li&gt;PHP 7.1 or greater is now a requirement. Aside from now being the lowest support version of PHP, this allows us to make use of strict types and argument and return type hints.&lt;/li&gt;&#10; &#10; &lt;li&gt;The license has been changed from LGPL 2.0 to OSL 3.0, for consistency with our other packages. Both are reasonably permissive licenses so this should not have a tangible impact on anyone using the library.&lt;/li&gt;&#10; &#10; &lt;li&gt;Unit tests have been removed since none of them were relevant any more, and we found the existing tests did not provide much value.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Please note that this release &lt;strong&gt;does not&lt;/strong&gt; include support for the Delivery Choices API. Since Australia Post removed address validation we have not had any need for it, but we'd welcome anyone who wants to contribute changes to add Delivery Choices in.&lt;/p&gt;&#10;&#10;&lt;p&gt;The new version of the Australia Post API SDK for PHP is now available for immediate download on &lt;a href="https://github.com/fontis/auspost-api-php" rel="nofollow noopener"&gt;GitHub&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/auspost-api-php/issues" rel="nofollow noopener"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Australia Day 2019 Release and Packagist Migration</title><link>https://fontis.au/blog/australia-day-2019-release-packagist-migration/</link><pubDate>Tue, 29 Jan 2019 00:09:11 +0000</pubDate><guid>https://fontis.au/blog/australia-day-2019-release-packagist-migration/</guid><description>Happy Australia Day everyone! Hope everyone down under had a great long weekend. We have a couple of announcements in celebration. Version 1.0.4 of the Australia extension for Magento 2 has now been released. This is a maintenance release that just adds compatibility for Magento 2.3. We&amp;rsquo;d like to thank &lt;a href="https://github.com/PivitParkour94"&gt;Nathaniel Rogers&lt;/a&gt; for his contributions to this release. We have also started migrating our free extensions to be&amp;hellip;</description></item><item><title>Magento Extension Roundup - October 2018</title><link>https://fontis.au/blog/extension-roundup-october-2018/</link><pubDate>Fri, 09 Nov 2018 23:18:02 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-october-2018/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the more notable extensions released in the past month. We look at extensions for redirecting product review pages, adding multiple flat shipping rates, customer group membership and payment method restriction.</description></item><item><title>Australia 1.0.3 for Magento 2 released</title><link>https://fontis.au/blog/australia-v103-magento-2-released/</link><pubDate>Tue, 30 Oct 2018 06:22:32 +0000</pubDate><guid>https://fontis.au/blog/australia-v103-magento-2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 1.0.3 of the Fontis Australia extension for Magento 2. This is a minor update that adds the ability to export orders to CSV using the Click &amp; Send format, and adds compatibility with recent versions of PHP and Magento.&lt;/p&gt;&#10;&#10;&lt;p&gt;Changes in this version are:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;Add Click &amp; Send CSV export&lt;/li&gt;&#10; &lt;li&gt;Add support for PHP 7.1 and 7.2&lt;/li&gt;&#10; &lt;li&gt;Add support for Magento 2.2&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The Fontis Australia extension for Magento 2 is available for immediate download on &lt;a href="https://github.com/fontis/australia-mage2"&gt;GitHub&lt;/a&gt; and is available to &lt;a href="https://github.com/fontis/fontis_australia"&gt;install through Composer from our site&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/australia-mage2/issues"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - September 2018</title><link>https://fontis.au/blog/extension-roundup-september-2018/</link><pubDate>Tue, 16 Oct 2018 23:57:54 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-september-2018/</guid><description>In this month&amp;rsquo;s round-up, we look at some recent Magento 2 extensions that optimise your store&amp;rsquo;s URL rewrites, notify external channels of store events, enable an enhanced FAQ page and allow customers to add comments to their orders.</description></item><item><title>Magento Extension Roundup - August 2018</title><link>https://fontis.au/blog/extension-roundup-august-2018/</link><pubDate>Wed, 12 Sep 2018 04:54:06 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-august-2018/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some recent extensions: sitemap and API improvements, product visibility checks and a tool to clean up unused product images.</description></item><item><title>Magento Extension Roundup - July 2018</title><link>https://fontis.au/blog/extension-roundup-july-2018/</link><pubDate>Tue, 21 Aug 2018 07:31:21 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-july-2018/</guid><description>In this month&amp;rsquo;s round-up, we look at some recent Magento 2 extensions. These extension add improvements to media storage, catalog, translations and product media gallery areas.</description></item><item><title>Customer Group Access 1.0.3 for Magento 2 released</title><link>https://fontis.au/blog/customer-group-access-mage2-103-released/</link><pubDate>Thu, 26 Jul 2018 05:40:10 +0000</pubDate><guid>https://fontis.au/blog/customer-group-access-mage2-103-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the released of version 1.0.3 of our Customer Group Access library for Magento 2. This version updates the library for compatibility with Magento 2.2, and PHP 7.1 and 7.2.&lt;/p&gt;&#10;&#10;&lt;p&gt;This update is important for the Fontis Australia extension, which depends on and automatically installs this library and would have been preventing installation on newer versions of Magento 2.&lt;/p&gt;&#10;&#10;&lt;p&gt;The Customer Group Access library for Magento 2 is now available for immediate download on &lt;a href="https://github.com/fontis/customergroupaccess-mage2" rel="nofollow noopener"&gt;GitHub&lt;/a&gt; and will be installed as a Composer dependency alongside the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension for Magento 2&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/customergroupaccess-mage2/issues" rel="nofollow noopener"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - June 2018</title><link>https://fontis.au/blog/extension-roundup-june-2018/</link><pubDate>Tue, 17 Jul 2018 04:20:30 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-june-2018/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in June. This month we have a fake data generator for testing, a new style of banner slider, and product review reminders.</description></item><item><title>Enhanced Category Products for Magento 1 released</title><link>https://fontis.au/blog/enhanced-category-products-magento-1-released/</link><pubDate>Tue, 19 Jun 2018 00:44:13 +0000</pubDate><guid>https://fontis.au/blog/enhanced-category-products-magento-1-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the &lt;a href="https://www.fontis.com.au/enhanced-category-products-magento-extension"&gt;Enhanced Category Products extension&lt;/a&gt; for Magento 1 (Magento 2 support is not available at this time). This extension provides a new interface to manage positioning of items in a category, making it faster and easier to merchandise products.&lt;/p&gt;&#10;&#10;&lt;p&gt;To reorder products with the Enhanced Category Products extension (ECP) you can simply drag and drop products around in a grid, or use quick access buttons to move products to the front or back of the list. Each product is displayed with its image and basic properties such as price and stock on hand, to give you the information needed for merchandising. You can even filter products and use an auto-sort to do most of the heavy lifting for you.&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;img src="https://fontis.au/media/catalog/product/c/a/category-sorting.png" class="img-responsive" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;ECP is an alternative to the Visual Merchandiser extension which is included in Magento Commerce (formerly Enterprise Edition). We discovered that many users of that Visual Merchandiser extension had trouble getting it to work as expected. The interface was confusing and categories would frequently not be updated to be consistent with the state shown by the extension. We've solved these problems in ECP by using existing Magento code and interface standards, and not attempting to add in our own index and cache systems.&lt;/p&gt;&#10;&#10;&lt;p&gt;The extension is available for sale now on our website, with documentation on how to use it available from within your account once the extension has been purchased.&lt;/p&gt;&#10;&#10;&lt;div class="row"&gt;&#10; &lt;div class="col-sm-24 text-center"&gt;&#10; &lt;a href="https://www.fontis.com.au/enhanced-category-products-magento-extension" class="button btn-secondary" style="width:50%;margin:1em 0"&gt;Get Fontis Enhanced Category Products&lt;/a&gt;&#10; &lt;/div&gt;&#10;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - May 2018</title><link>https://fontis.au/blog/extension-roundup-may-2018/</link><pubDate>Wed, 13 Jun 2018 01:46:21 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-may-2018/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the more notable free and open source extensions which were released last month. We&amp;rsquo;ll review extensions that help you conform to the General Data Protection Regulation (GDPR), login as customer, put your Magento store into maintenance mode without hassle, and preview main transactional emails directly on backend.</description></item><item><title>Magento Extension Roundup - March 2018</title><link>https://fontis.au/blog/extension-roundup-march-2018/</link><pubDate>Fri, 13 Apr 2018 00:00:00 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-march-2018/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in March. In this post, we&amp;rsquo;ll review extensions to help you optimise your images, provide birthday coupons to your customers, improve the cron system, ensure your customers aren&amp;rsquo;t using insecure passwords, an easy product import/export tool, and something to spice up your product detail pages.</description></item><item><title>Australia 3.4.5 for Magento 1 released</title><link>https://fontis.au/blog/australia-v345-magento-1-released/</link><pubDate>Fri, 02 Mar 2018 05:41:07 +0000</pubDate><guid>https://fontis.au/blog/australia-v345-magento-1-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.4.5 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version release of the extension which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Change signature on delivery options to the new Auspost codes&lt;/li&gt;&#10; &lt;li&gt;Update consignment CSV import file importer to match the new eParcel format&lt;/li&gt;&#10; &lt;li&gt;Fix the JavaScript path in modman file&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/posttechguy"&gt;Bevan Holman&lt;/a&gt;, &lt;a href="https://github.com/thomashery"&gt;Thomas Hery&lt;/a&gt; and &lt;a href="https://github.com/digitalpianism"&gt;Raphael Petrini&lt;/a&gt; for their contributions in this release.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - January 2018</title><link>https://fontis.au/blog/extension-roundup-january-2018/</link><pubDate>Wed, 14 Feb 2018 05:51:26 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-january-2018/</guid><description>In this month&amp;rsquo;s round-up, we look at some Magento 2 extensions which make it easier for customers to place bulk orders and view their guest orders, as well as some Magento 1 extensions which help with browser cache-busting and managing product attributes.</description></item><item><title>Magento Extension Roundup - December 2017</title><link>https://fontis.au/blog/extension-roundup-december-2017/</link><pubDate>Wed, 24 Jan 2018 07:08:12 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-december-2017/</guid><description>In this month&amp;rsquo;s round-up, we look at a way to control which customer groups can use specific payment methods, as well as a Magento 2 extension that lets you create your very own chatbot! We also look at a couple of Magento 1 extensions that help with store monitoring and order notifications.</description></item><item><title>Magento Extension Roundup - November 2017</title><link>https://fontis.au/blog/extension-roundup-november-2017/</link><pubDate>Tue, 12 Dec 2017 05:10:26 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-november-2017/</guid><description>In this month&amp;rsquo;s round-up, we look at some recent Magento 1 and Magento 2 extensions. Some assist with development and maintenance, like previewing the checkout page or cleaning up old attributes, while another adds a new product type for charitable donations.</description></item><item><title>Magento Extension Roundup - October 2017</title><link>https://fontis.au/blog/extension-roundup-october-2017/</link><pubDate>Fri, 10 Nov 2017 04:38:55 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-october-2017/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in October. This month we are featuring Google Maps address lookup on the checkout for Magento 2, some useful missing features from Magento 1, and we&amp;rsquo;ll cap it off with a nod towards the holiday season with a festive store switcher extension.</description></item><item><title>Magento Extension Roundup - August 2017</title><link>https://fontis.au/blog/extension-roundup-august-2017/</link><pubDate>Mon, 11 Sep 2017 05:58:19 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-august-2017/</guid><description>In this month&amp;rsquo;s round-up, we looked at a couple of Magento 2 extensions that can be useful for developers as well as an extension that adds a custom shipping method to your site. We also have a Magento 1 extension that allows the use of a different theme for each of your customer groups.</description></item><item><title>Magento Extension Roundup - July 2017</title><link>https://fontis.au/blog/extension-roundup-july-2017/</link><pubDate>Wed, 30 Aug 2017 07:29:20 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-july-2017/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in the last two months. This month, we have several Magento 2 extensions that add functionality such as customer order comments, and CMS page canonical URLs. We also have a Magento 1 extension that adds Virtual Reality support.</description></item><item><title>Magento Extension Roundup - June 2017</title><link>https://fontis.au/blog/extension-roundup-june-2017/</link><pubDate>Thu, 13 Jul 2017 07:59:09 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-june-2017/</guid><description>In this month&amp;rsquo;s round-up, we review a newsletter coupon extension and shipping insurance module for Magento 1, as well as Magento 2 extensions for integrating Bootstrap, menu customisation, and viewing template block hints.</description></item><item><title>Australia Post API Certificate Update</title><link>https://fontis.au/blog/auspost-certificate-update-2017/</link><pubDate>Tue, 11 Jul 2017 04:17:21 +0000</pubDate><guid>https://fontis.au/blog/auspost-certificate-update-2017/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Merchants signed up for Australia Post services will have recently received an email explaining that the SSL certificates used by Australia Post will soon be updated. As many of our customers will be connecting to Auspost APIs through the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt;, we will explain the impact to Magento merchants.&lt;/p&gt;&#10;&#10;&lt;h2&gt;When is this happening?&lt;/h2&gt;&#10;&#10;&lt;p&gt;The cutover time is scheduled for August 2nd, 2017 at 12:00 AEST.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Does this affect the Australia extensions for Magento 1 &amp; 2?&lt;/h2&gt;&#10;&#10;&lt;p&gt;&lt;strong&gt;No.&lt;/strong&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;The extension does not store the SSL certificates anywhere, and so will work with any trusted SSL certificates. This will also be the case for any future updates to the certificates.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Do I need to do anything?&lt;/h2&gt;&#10;&#10;&lt;p&gt;Maybe.&lt;/p&gt;&#10;&#10;&lt;p&gt;If you're only using the Fontis Australia extension, then there won't be anything that needs to be done. If you've connected other services to Australia Post's APIs then you will need to check those services independently.&lt;/p&gt;&#10;&#10;&lt;p&gt;We would encourage everyone to contact Australia Post if you're concerned that you may have other systems connected to the Auspost APIs that may need to be updated.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Australia 1.0.1 for Magento 2 released</title><link>https://fontis.au/blog/australia-v101-magento-2-released/</link><pubDate>Fri, 09 Jun 2017 07:41:07 +0000</pubDate><guid>https://fontis.au/blog/australia-v101-magento-2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 1.0.1 of the Fontis Australia extension for Magento 2. This is a minor update that fixes an issue with eParcel shipping.&lt;/p&gt;&#10;&#10;&lt;p&gt;Changes in this version are:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;Fixed issue where eParcel shipping would throw an error when saving without uploading a CSV file of rates&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The Fontis Australia extension for Magento 2 is available for immediate download on &lt;a href="https://github.com/fontis/australia-mage2"&gt;GitHub&lt;/a&gt; and is available to &lt;a href="https://github.com/fontis/fontis_australia"&gt;install through Composer from our site&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/australia-mage2/issues"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - April 2017</title><link>https://fontis.au/blog/extension-roundup-april-2017/</link><pubDate>Mon, 29 May 2017 01:04:06 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-april-2017/</guid><description>In this month&amp;rsquo;s round-up, we are reviewing some of the free extensions that were released in April for Magento 1, including an extension to limit the number of products a customer can buy as well as a second that adds a color attribute type. We also look at Magento 2 extensions that allow custom maintenance pages to be used, let customers login with one of their existing social accounts and customise the order numbers that Magento generates.</description></item><item><title>Australia 1.0 for Magento 2 released and on Magento Marketplace</title><link>https://fontis.au/blog/australia-v1-magento-2-released/</link><pubDate>Wed, 17 May 2017 04:43:14 +0000</pubDate><guid>https://fontis.au/blog/australia-v1-magento-2-released/</guid><description>We are pleased to announce the release of version 1.0.0 of the Fontis Australia extension for Magento 2. The extension is now also available through Magento Marketplace.</description></item><item><title>Australia 3.4.1 for Magento 1 released</title><link>https://fontis.au/blog/australia-v341-magento-1-released/</link><pubDate>Wed, 26 Apr 2017 01:44:36 +0000</pubDate><guid>https://fontis.au/blog/australia-v341-magento-1-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.4.1 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version release of the extension which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Adds tracking support to Australia Post shipments&lt;/li&gt;&#10;&lt;li&gt;Fixes issues relating to lookups on domestic postcodes less than 1000 in both the Australiapost and Eparcel shipping methods&lt;/li&gt;&#10;&lt;li&gt;Minor improvement to address autocomplete&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/bendechrai"&gt;Ben Dechrai&lt;/a&gt;, &lt;a href="https://github.com/chrisjz"&gt;Chris Zaharia&lt;/a&gt; and &lt;a href="https://github.com/digitalpianism"&gt;Raphael Petrini&lt;/a&gt; for their contributions in this release.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - March 2017</title><link>https://fontis.au/blog/extension-roundup-march-2017/</link><pubDate>Fri, 21 Apr 2017 04:33:30 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-march-2017/</guid><description>In this month&amp;rsquo;s round-up, we review some of the free extensions released in March for Magento 1, including customer registration on the checkout success page, automatic revision tracking for CMS content, and a quick add to cart for customers. We also look at Magento 2 extensions that allow customers to place comments on their orders, and remove browser autofill restrictions from the admin panel login form.</description></item><item><title>Magento Extension Roundup - February 2017</title><link>https://fontis.au/blog/extension-roundup-february-2017/</link><pubDate>Fri, 10 Mar 2017 07:24:05 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-february-2017/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the free extensions released in February including a profiler information extension and a lookbook. We also look at Magento 2 extensions for adding web app manifests, an opcache monitor and a HTTP/2 server push enabler.</description></item><item><title>Magento Extension Roundup - January 2017</title><link>https://fontis.au/blog/extension-roundup-january-2017/</link><pubDate>Tue, 07 Feb 2017 05:17:57 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-january-2017/</guid><description>In this month&amp;rsquo;s round-up, we review some extensions for customising the display of payment/shipping methods, two-factor authentication for the Magento admin panel, configurable sitemap generation, and Facebook Pixel tracking.</description></item><item><title>Australia Day 2017 extension release</title><link>https://fontis.au/blog/australia-day-2017-extension-release/</link><pubDate>Thu, 26 Jan 2017 09:00:00 +0000</pubDate><guid>https://fontis.au/blog/australia-day-2017-extension-release/</guid><description>&lt;p&gt;Happy Australia Day everyone! We are pleased to announce the release of version 3.3.4 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version of the Australia extension which includes the following changes:&lt;/p&gt;&#10;&lt;p&gt;Add button to test connections to Delivery Choices API&lt;/p&gt;&#10;&lt;p&gt;Optimisations to validation checks&lt;/p&gt;&#10;&lt;p&gt;&amp;hellip;&lt;/p&gt;&#10;</description></item><item><title>Google Tag Manager 5.2.0 released</title><link>https://fontis.au/blog/google-tag-manager-v520-released/</link><pubDate>Fri, 13 Jan 2017 01:18:27 +0000</pubDate><guid>https://fontis.au/blog/google-tag-manager-v520-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 5.2.0 of the Fontis Google Tag Manager extension for Magento 1. This is a major version release of the extension which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Expanded support for Analytics Enhanced Ecommerce functionality, making it easier to instrument sites to track product impressions, cart events, and more&lt;/li&gt;&#10; &lt;li&gt;Improved handling of complex product types such as configurable products, passing data for both parent and child products to the data layer&lt;/li&gt;&#10; &lt;li&gt;Separated &amp;lt;script&amp;gt; and &amp;lt;noscript&amp;gt; blocks to match &lt;a href="https://developers.google.com/tag-manager/devguide#multiple-containers"&gt;Google recommendations&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The Fontis Google Tag Manager extension for Magento 1 is now available for immediate purchase &lt;a href="https://www.fontis.com.au/google-tag-manager-magento-extension"&gt;from our site&lt;/a&gt;. Customers who have already purchased the extension can update to the new version by running:&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;pre&gt;composer require "fontis/gtm:^5.2"&lt;/pre&gt;&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - December 2016</title><link>https://fontis.au/blog/extension-roundup-december-2016/</link><pubDate>Thu, 12 Jan 2017 23:43:06 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-december-2016/</guid><description>In this month&amp;rsquo;s round-up, we look at a new plugin system for developers, checkout restrictions and another responsive slider extension.</description></item><item><title>Australia 0.3.1 for Magento 2 released</title><link>https://fontis.au/blog/australia-v031-magento-2-released/</link><pubDate>Thu, 15 Dec 2016 08:50:46 +0000</pubDate><guid>https://fontis.au/blog/australia-v031-magento-2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 0.3.1 of the Fontis Australia extension for Magento 2. This is a minor version release of the extension which includes the following change:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Allow package weights to be decimals&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The Fontis Australia extension for Magento 2 is now available for immediate download on &lt;a href="https://github.com/fontis/australia-mage2"&gt;GitHub&lt;/a&gt; and is available to &lt;a href="https://github.com/fontis/fontis_australia"&gt;install through Composer from our site&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/australia-mage2/issues"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - November 2016</title><link>https://fontis.au/blog/extension-roundup-november-2016/</link><pubDate>Tue, 13 Dec 2016 05:49:09 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-november-2016/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in November. This time we&amp;rsquo;re looking at extensions for EAN generation, email logging, customer order comments and responsive sliders.</description></item><item><title>Australia 3.1.7 for Magento 1 released</title><link>https://fontis.au/blog/australia-v317-magento-1-released/</link><pubDate>Mon, 12 Dec 2016 07:19:00 +0000</pubDate><guid>https://fontis.au/blog/australia-v317-magento-1-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.1.7 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version release of the extension which includes the following change:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Fix an issue with decimal weights being rounded off&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/bencorlett"&gt;Ben Corlett&lt;/a&gt; for contributing this fix.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>How to set up a Magento 2 store for Australia</title><link>https://fontis.au/blog/how-to-set-up-a-magento2-store-for-australia/</link><pubDate>Thu, 24 Nov 2016 00:22:02 +0000</pubDate><guid>https://fontis.au/blog/how-to-set-up-a-magento2-store-for-australia/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;This is a follow up to our 2009 post, &lt;a href="https://fontis.au/blog/how-to-set-up-a-magento-store-for-australia"&gt;How to set up a Magento store for Australia&lt;/a&gt;. There are a few important things that need to be configured for compliance with &lt;abbr title="Australian Taxation Office"&gt;ATO&lt;/abbr&gt; requirements and to ensure that Magento calculates taxes correctly. The following is an outline of the necessary configuration and settings you may need to consider when setting up Magento 2 for an Australian store.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Locale Settings&lt;/h3&gt;&#10;&lt;p&gt;The first step is setting all necessary system configuration settings for Australia:&lt;/p&gt;</description></item><item><title>Australia 0.3.0 for Magento 2 released</title><link>https://fontis.au/blog/australia-v030-magento-2-released/</link><pubDate>Wed, 23 Nov 2016 06:42:59 +0000</pubDate><guid>https://fontis.au/blog/australia-v030-magento-2-released/</guid><description>&lt;p&gt;We are pleased to announce the release of version 0.3.0 of the Fontis Australia extension for Magento 2. This is a substantial update that brings support for Australia Post shipping methods to Magento 2.&lt;/p&gt;&#10;&lt;p&gt;Changes in this version are:&lt;/p&gt;&#10;&lt;p&gt;Add Australia Post as a shipping method&lt;/p&gt;&#10;&lt;p&gt;Add Australia Post eParcel as a shipping method&lt;/p&gt;&#10;</description></item><item><title>Magento Extension Roundup - October 2016</title><link>https://fontis.au/blog/extension-roundup-october-2016/</link><pubDate>Wed, 09 Nov 2016 07:32:32 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-october-2016/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions that were released in October. This time we&amp;rsquo;re looking at extensions for targeted product recommendations, SEO pagination, and Magento core bug fixes.</description></item><item><title>Magento Extension Roundup - September 2016</title><link>https://fontis.au/blog/extension-roundup-september-2016/</link><pubDate>Thu, 27 Oct 2016 06:02:04 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-september-2016/</guid><description>In this month&amp;rsquo;s round-up, we review some of the free extensions that were released in September. This time we&amp;rsquo;re looking at extensions for switching the owner of an order, free shipping option assignment to customers, cleaning up backups, and more.</description></item><item><title>Magento Extension Roundup - August 2016</title><link>https://fontis.au/blog/extension-roundup-august-2016/</link><pubDate>Mon, 12 Sep 2016 23:02:56 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-august-2016/</guid><description>In this month&amp;rsquo;s round-up, we review extensions for general product attachments, embedding an icon font, and a super-fast mass customer import process.</description></item><item><title>Magento Extension Roundup - July 2016</title><link>https://fontis.au/blog/extension-roundup-july-2016/</link><pubDate>Fri, 12 Aug 2016 01:39:08 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-july-2016/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions for address validation, extra category descriptions and easier access to Magento logs.</description></item><item><title>Magento's Product Attributes Index Explained</title><link>https://fontis.au/blog/product-attributes-index-explained/</link><pubDate>Fri, 29 Jul 2016 01:39:32 +0000</pubDate><guid>https://fontis.au/blog/product-attributes-index-explained/</guid><description>The Product Attributes index is an important part of Magento&amp;rsquo;s category filtering system. This post provides an overview of what it is and how it works.</description></item><item><title>Magento Extension Roundup - June 2016</title><link>https://fontis.au/blog/extension-roundup-june-2016/</link><pubDate>Wed, 13 Jul 2016 00:12:27 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-june-2016/</guid><description>In this month&amp;rsquo;s roundup, we review some free extensions that were released in June: extensions allow frontend PDF printing, admin panel two factor authentication, multiple cart item delete and Pinterest tracking pixels.</description></item><item><title>Australia 3.1.6 released</title><link>https://fontis.au/blog/australia-v316-released/</link><pubDate>Wed, 13 Jul 2016 00:04:45 +0000</pubDate><guid>https://fontis.au/blog/australia-v316-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.1.6 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version release of the extension which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Adds a new ATL options column to the exported Click &amp; Send CSV file&lt;/li&gt;&#10; &lt;li&gt;Fixes a bug with EXPRESS services&lt;/li&gt;&#10;&lt;/ul&gt;&#10; &#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/digitalpianism"&gt;Digital Pianism&lt;/a&gt; for their contribution.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Anchor categories and position sorting explained</title><link>https://fontis.au/blog/anchor-categories-position-sorting-explained/</link><pubDate>Wed, 29 Jun 2016 01:39:42 +0000</pubDate><guid>https://fontis.au/blog/anchor-categories-position-sorting-explained/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The &lt;i&gt;Is Anchor&lt;/i&gt; category setting and category product positions do not play well when combined together. You might think that marrying two simple category settings would result in a simple solution, but think twice before you do so or you might get a headache of Magento proportion! In this post we will attempt to demystify how &lt;i&gt;Is Anchor&lt;/i&gt; works and how you can best make use of it.&lt;/p&gt;&#10;&#10;&lt;h2&gt;How does category positioning work?&lt;/h2&gt;&#10;&#10;&lt;p&gt;You probably know that sorting a category by the default "Best Value" criteria uses the &lt;i&gt;Position&lt;/i&gt; field of the products in the category to determine its position in the category listing. This is a whole number value which can be set per product in a category to sort the products in ascending numeric order. Setting a higher position value for a product will move it closer to the bottom of the category list, after all products with the default position of 0.&lt;/p&gt;&#10;&#10;&lt;h2&gt;What does &lt;i&gt;Is Anchor&lt;/i&gt; actually do?&lt;/h2&gt;&#10;&#10;&lt;p&gt;The &lt;i&gt;Is Anchor&lt;/i&gt; display setting for categories allows a category to "inherit" and display all products from its child categories. When &lt;i&gt;Is Anchor&lt;/i&gt; is set to "Yes", products assigned to child categories will be combined and displayed in the parent category along with any products directly assigned to it. This means you can use &lt;i&gt;Is Anchor&lt;/i&gt; at upper level categories to avoid having to explicitly assign products all the way along a branch of the category tree. Instead, simply assign products to their lowest level (most specific) category and they will then be displayed automatically in parent categories.&lt;/p&gt;&#10;&#10;&lt;p&gt;This setting is also typically associated with &lt;a href="http://docs.magento.com/m1/ce/user_guide/catalog/navigation-layered.html"&gt;layered navigation&lt;/a&gt;, since by default it needs to be set to "Yes" before layered navigation will appear on the frontend for a given category.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Combining &lt;i&gt;Is Anchor&lt;/i&gt; and category positions&lt;/h2&gt;&#10;&#10;&lt;p&gt;What is not well documented is the interaction between these two settings in a multi-level category tree. How are products sorted according to their assigned position values in an "anchor" category when there are products in both the parent (anchor) and child categories? Will products directly assigned to the parent category and with a position value set override position values for the same product set at lower categories? What if a product is assigned to two child categories with different position values?&lt;/p&gt;&#10;&#10;&lt;p&gt;To illustrate what happens, consider the following category tree from our own Magento store:&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/category-position-with-is-anchor/is_anchor.png" alt="" style="border:1px solid black;" /&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;The categories contain the following products with the corresponding position values:&lt;/p&gt;&#10;&#10;&lt;div class="table-responsive"&gt;&#10; &lt;table class="table table-bordered"&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th&gt;Category&lt;/th&gt;&#10; &lt;th&gt;Category Level&lt;/th&gt;&#10; &lt;th&gt;Category Position&lt;/th&gt;&#10; &lt;th&gt;Product&lt;/th&gt;&#10; &lt;th&gt;Position&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Payments / Shipping&lt;/td&gt;&#10; &lt;td align="right"&gt;2&lt;/td&gt;&#10; &lt;td align="right"&gt;1&lt;/td&gt;&#10; &lt;td&gt;Australia&lt;/td&gt;&#10; &lt;td align="right"&gt;100&lt;/td&gt;&#10; &lt;/tr&gt;&#10;&#10; &lt;tr&gt;&#10; &lt;td&gt;Payments / Shipping &amp;gt; Payments&lt;/td&gt;&#10; &lt;td align="right"&gt;3&lt;/td&gt;&#10; &lt;td align="right"&gt;1&lt;/td&gt;&#10; &lt;td&gt;ANZ eGate&lt;/td&gt;&#10; &lt;td align="right"&gt;200&lt;/td&gt;&#10; &lt;/tr&gt;&#10;&#10; &lt;tr&gt;&#10; &lt;td&gt;Payments / Shipping &amp;gt; Shipping&lt;/td&gt;&#10; &lt;td align="right"&gt;3&lt;/td&gt;&#10; &lt;td align="right"&gt;2&lt;/td&gt;&#10; &lt;td&gt;IFS SmartFreight Shipping&lt;/td&gt;&#10; &lt;td align="right"&gt;50&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10; &lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;If the sort direction is ascending, we might assume that the products in the "Payments / Shipping" category would be displayed starting with position 50 first, followed by the product with position 100, and then finally the product with the highest position value (200).&lt;/p&gt;&#10;&#10;&lt;p&gt;Instead, what we actually end up with is:&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/category-position-with-is-anchor/fontis-shipping.png" alt="" style="border:1px solid black;" /&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;It turns out that products from a child category are given a position in the parent category based on a weighting applied to their position value from the child category. The exact formula used by Magento is:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;(&lt;/span&gt;category position + 1&lt;span class="o"&gt;)&lt;/span&gt; * &lt;span class="o"&gt;(&lt;/span&gt;category level + 1&lt;span class="o"&gt;)&lt;/span&gt; * 10,000 + product position in category&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This means that products in categories higher up in the category tree will have a much greater weighting than the products in their parent category. So if the products are sorted in ascending position order, products from the parent category would be displayed at the top even if their position values are larger than the position values of products in the child categories.&lt;/p&gt;&#10;&#10;&lt;p&gt;Furthermore, if a product is in both the parent and child categories, then the smaller of the two calculated position values will be used. This could be confusing if you have a few products which are in multiple categories and they don't appear to be ordered relative to the other products from the same category.&lt;/p&gt;&#10;&#10;&lt;p&gt;If we apply Magento's position formula to the example above, you can see that the products have different position values than you might have originally expected:&lt;/p&gt;&#10;&#10;&lt;div class="table-responsive"&gt;&#10; &lt;table class="table table-bordered"&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th&gt;Product&lt;/th&gt;&#10; &lt;th&gt;Original Position in Child&lt;/th&gt;&#10; &lt;th&gt;Computed Position in Parent&lt;/th&gt;&#10; &lt;th&gt;Displayed Position&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Australia&lt;/td&gt;&#10; &lt;td align="right"&gt;100&lt;/td&gt;&#10; &lt;td align="right"&gt;60,100&lt;/td&gt;&#10; &lt;td align="right"&gt;1&lt;sup&gt;st&lt;/sup&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10;&#10; &lt;tr&gt;&#10; &lt;td&gt;ANZ eGate&lt;/td&gt;&#10; &lt;td align="right"&gt;200&lt;/td&gt;&#10; &lt;td align="right"&gt;80,200&lt;/td&gt;&#10; &lt;td align="right"&gt;2&lt;sup&gt;nd&lt;/sup&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10;&#10; &lt;tr&gt;&#10; &lt;td&gt;IFS SmartFreight Shipping&lt;/td&gt;&#10; &lt;td align="right"&gt;50&lt;/td&gt;&#10; &lt;td align="right"&gt;120,050&lt;/td&gt;&#10; &lt;td align="right"&gt;3&lt;sup&gt;rd&lt;/sup&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10; &lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Magento's anchor category functionality is extremely useful for managing large catalogs since it avoids repeated category assignment, but you need to keep in mind how it affects the position values of products in case you intend to make use of position sorting. If your primary concern is ensuring that you have precise control over the position of products in categories, then it may be impractical to use &lt;i&gt;Is Anchor&lt;/i&gt; and it would probably better to turn it off. However, since layered navigation is normally desirable, it then becomes necessary to modify code so that layered navigation is still shown. Without modification, Magento's core position sort functionality is a tradeoff between explicit control and being able to use layered navigation.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Australia Post API library 1.0.4 released</title><link>https://fontis.au/blog/auspost-api-php-104-release/</link><pubDate>Tue, 21 Jun 2016 06:06:46 +0000</pubDate><guid>https://fontis.au/blog/auspost-api-php-104-release/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 1.0.4 of the &lt;a href="https://github.com/fontis/auspost-api-php"&gt;Fontis Australia Post API client library for PHP&lt;/a&gt;. This is a minor version release of the library which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Updated API base URL based on &lt;a href="http://auspost.com.au/pdfs/pac-api-update-2016.pdf"&gt;changes in the API&lt;/a&gt;&lt;/li&gt;&#10; &lt;li&gt;Locked Guzzle dependency to the latest versions on the 3.x branch, as it is not compatible with newer versions&lt;/li&gt;&#10; &lt;li&gt;Allows parcel weights to be provided using decimal numbers instead of integers&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Since Australia Post have deprecated and will eventually decommission the legacy API URL, we encourage all users to upgrade to the latest version soon to avoid any future interruption.&lt;/p&gt;&#10;&#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/bencorlett"&gt;Ben Corlett&lt;/a&gt;, &lt;a href="https://github.com/chrisjz"&gt;Chris Zaharia&lt;/a&gt;, and &lt;a href="https://github.com/ProxiBlue"&gt;Lucas van Staden&lt;/a&gt; for their contributions to this release.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - May 2016</title><link>https://fontis.au/blog/extension-roundup-may-2016/</link><pubDate>Mon, 20 Jun 2016 01:05:38 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-may-2016/</guid><description>In this month&amp;rsquo;s round-up, we review some free extensions released in May. We look at extensions for Facebook tracking, search improvements and order export, as well as Magento 2 command-line autocompletion.</description></item><item><title>Magento Extension Roundup - April 2016</title><link>https://fontis.au/blog/extension-roundup-april-2016/</link><pubDate>Fri, 13 May 2016 09:31:11 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-april-2016/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the free extensions that were released in April. The theme for this month&amp;rsquo;s extensions are small, drop-and-go extensions with minimal conflicts in your Magento installation.</description></item><item><title>Our Campaign Monitor extension has a new home</title><link>https://fontis.au/blog/campaign-monitor-extension-major-update-new-home/</link><pubDate>Fri, 29 Apr 2016 06:10:28 +0000</pubDate><guid>https://fontis.au/blog/campaign-monitor-extension-major-update-new-home/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The Fontis Campaign Monitor extension for Magento has been one of our most popular projects, with over 10,000 downloads, and has been used by people all over the world to connect their Magento store with the Campaign Monitor mailing list service. In collaboration with Campaign Monitor we have overhauled the existing extension to be compatible with the latest versions of Magento 1 and the Campaign Monitor API. The extension now also has a new home, having been adopted as the official Campaign Monitor project rather than continuing on as our unofficial third-party solution.&lt;/p&gt;&#10;&#10;&lt;p&gt;A key aspect of this project was to take advantage of improvements to the &lt;a href="https://www.campaignmonitor.com/api/"&gt;Campaign Monitor API&lt;/a&gt;, including support for the recently launched transactional email functionality. Following is a brief overview of some of the exciting new extension features.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Expanded Custom Fields&lt;/h2&gt;&#10;&#10;&lt;p&gt;Customer and address attributes are still available from the old extension and have been expanded to include additional attributes from more sources of data for the customer.&lt;/p&gt;&#10;&#10;&lt;img class="img-responsive lightbox-images" src="https://fontis.au/media/wysiwyg/blog/campaign-monitor-update/custom-fields.png" alt="" /&gt;&#10;&#10;&lt;p&gt;Basic information about products in the customer's wishlist (name, price, SKU) is also available, with the adminstrator able to set the number of products to include. Since each piece of data for each product is a separate custom field in Campaign Monitor, it would normally be best to limit the products transferred.&lt;/p&gt;&#10;&#10;&lt;p&gt;Importantly, you can also include purchasing data for the customer, to help segement them based on their buying habits or their total value as a customer. Purchasing data includes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Last order value&lt;/li&gt;&#10; &lt;li&gt;Last order date&lt;/li&gt;&#10; &lt;li&gt;Average order value&lt;/li&gt;&#10; &lt;li&gt;Total order value&lt;/li&gt;&#10; &lt;li&gt;Total number of orders&lt;/li&gt;&#10; &lt;li&gt;Total number of products ordered&lt;/li&gt;&#10; &lt;li&gt;First order date&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;All of these fields are configurable and can be added or removed as needed by updating the configuration in Magento. If you've added custom attributes on customers these fields will also be available for use.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Webhooks and Scheduled Sychronisation&lt;/h2&gt;&#10;&#10;&lt;p&gt;Keeping the subscriber list in Magento sychronised with Campaign Monitor is the primary function of the extension and ensuring that the two sources are as up-to-date as possible is done through the use of webhooks and batched jobs. Webhooks trigger whenever a subscriber's status is updated in Campaign Monitor, either through the actions of a subscriber or the account admin, and will immediately send a message to Magento to make the same change. Similarly, Magento will send a notification to Campaign Monitor whenever actions are taken that will affect a subscriber, such as unsubscribing from the newsletter, changing address details, or placing an order.&lt;/p&gt;&#10;&#10;&lt;p&gt;In addition to webhooks the extension also adds scheduled jobs to Magento, using Magento's cron system, to run through all updates made in the last day (on both ends) and ensures the lists are in sync. When the extension is configured for the first time in Magento as special job will be run which synchronises the entire list from Magento, meaning you can get started straight away.&lt;/p&gt;&#10;&#10;&lt;p&gt;If you'd prefer not to use Magento's cron system, perhaps preferring the system's cron scheduler, we have catered for this with Magento shell scripts and simple configuration options in the admin panel.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Subscriber Segmentation&lt;/h2&gt;&#10;&#10;&lt;p&gt;Campaign Monitor allows for list subscribers to be split into segments based on the data contained in custom fields, allowing for extremely powerful targeting of marketing emails. With the extension now sending through custom field data for customers, marketers can make use of this feature to segment customers based on customer group, location, purchase history, registration date and many more.&lt;/p&gt;&#10;&#10;&lt;img class="img-responsive lightbox-images" src="https://fontis.au/media/wysiwyg/blog/campaign-monitor-update/segments.png" alt="" /&gt;&#10;&#10;&lt;p&gt;To help get started the extension will set up several useful segments on the list, based on whether customers have spent over a certain amount, whether they've signed up but haven't purchased yet, and so on. Additional segments can then be set up in Campaign Monitor as needed.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Transactional Emails&lt;/h2&gt;&#10;&#10;&lt;p&gt;Transactional email, such as order confirmations and password resets, can now be sent through Campaign Monitor's new transactional email service through the API. This is useful if you don't want to set up outgoing mail yourself, or would like to have greater visibility into the messages sent. The extension makes use of the &lt;a href="https://www.campaignmonitor.com/api/transactional/"&gt;Transactional Email API&lt;/a&gt; to display a list of recently sent emails, which also allows you to view detailed information including the time it was sent, whether it was opened and the contents of the email.&lt;/p&gt;&#10;&#10;&lt;img class="img-responsive lightbox-images" src="https://fontis.au/media/wysiwyg/blog/campaign-monitor-update/transactional-grid.png" alt="" /&gt;&#10;&#10;&lt;h2&gt;New Home&lt;/h2&gt;&#10;&#10;&lt;p&gt;With the move to becoming an official extension, you can find more information about the release on the &lt;a href="https://www.campaignmonitor.com/blog/how-to/2016/02/magento-integration-for-campaign-monitor/"&gt;Campaign Monitor announcement post&lt;/a&gt;, and the updated extension can be downloaded from &lt;a href="https://www.magentocommerce.com/magento-connect/catalog/product/view/id/30754/s/campaign-monitor/"&gt;Magento Connect&lt;/a&gt; or &lt;a href="https://github.com/campaignmonitor/magento-extension"&gt;GitHub&lt;/a&gt;. Support will now be handled by Campaign Monitor directly via their normal support channels.&lt;/p&gt;&#10;&#10;&lt;p&gt;As part of this change we will be updating our own extension download pages and GitHub repo to direct everyone to the new extension. We've been very proud to have developed the definitive Campaign Monitor extension for Magento since 2008 and we look forward to continuing to work with Campaign Monitor and the community to add even more Campaign Monitor email goodness in releases to come!&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Australia 3.1.5 released</title><link>https://fontis.au/blog/australia-v315-released/</link><pubDate>Wed, 27 Apr 2016 06:04:06 +0000</pubDate><guid>https://fontis.au/blog/australia-v315-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.1.5 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt; for Magento 1. This is a minor version release of the extension which includes the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Moved the admin controller code and changed the URL paths to include "australia_" to try and avoid namespace conflicts with other extensions&lt;/li&gt;&#10; &lt;li&gt;Add configuration to automatically decrypt the Auspost API keys when loading them from config&lt;/li&gt;&#10; &lt;li&gt;Fixed the check for valid Eparcel charge codes&lt;/li&gt;&#10; &lt;li&gt;Updated list of &lt;a href="http://auspost.com.au/pdfs/pac-api-update-2016.pdf"&gt;Australia Post PAC service codes&lt;/a&gt;&lt;/li&gt;&#10; &lt;li&gt;Various minor code improvements and style fixes&lt;/li&gt;&#10;&lt;/ul&gt;&#10; &#10;&lt;p&gt;Thanks to &lt;a href="https://github.com/jasuten"&gt;Justin Volpato&lt;/a&gt; for contributing the updated service codes.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Blog Extension 2.0 Released</title><link>https://fontis.au/blog/blog-extension-v2-released/</link><pubDate>Fri, 22 Apr 2016 08:11:00 +0000</pubDate><guid>https://fontis.au/blog/blog-extension-v2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Since the first public versions of the &lt;a href="https://github.com/fontis/fontis_blog"&gt;Fontis Blog extension for Magento&lt;/a&gt;, we've added a number of important new features culminating in this major version release. It also utilises the recently released &lt;a href="https://github.com/fontis/router-mage1"&gt; Router&lt;/a&gt; extension.&lt;/p&gt;&#10;&#10;&lt;p&gt;The biggest change in version 2 is the addition of support for multiple blogs per store. We realised that the "blog" style of releasing content made sense in many contexts, not just for a typical news feed of posts. Content series such as how to articles, product reviews, press highlights etc. may be better off as separate blogs rather than being combined into a "one-size-fits-all" news feed, where categories or tags within a single blog was previously the only option available. To accommodate this, you can now have as many blogs as necessary, available at whatever URLs are desired.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10;Other highlights of this release include:&#10;&lt;ul&gt;&#10;&lt;li&gt;Tags and authors&lt;/li&gt;&#10;&lt;li&gt;Integration with our &lt;a href="https://www.fontis.com.au/algolia-magento-extension"&gt; Algolia&lt;/a&gt; extension&lt;/li&gt;&#10;&lt;li&gt;Microdata support&lt;/li&gt;&#10;&lt;li&gt;AddThis integration&lt;/li&gt;&#10;&lt;li&gt;Admin panel updates to accomodate various SUPEE security patches&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;With the move to multiple blogs per store, each blog has its own set of options. This is an important change from the first version, and means that the settings in system configuration for the blog are now just defaults.&lt;br /&gt;&lt;br /&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/blog-extension-v2-released/edit-blog-settings.png" alt="Edit Blog Settings" class="img-responsive lightbox-images img-center img-border" /&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;Another point to note is that authors are now a separate entity within the blog. This helps ensure consistency of author details across different blogs and posts, as well as allowing us to create frontend pages that make it easy to view all posts attributed to a specific author:&lt;br /&gt;&lt;br /&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/blog-extension-v2-released/authors-frontend.png" alt="Author Frontend Page" class="img-responsive lightbox-images img-center img-border" /&gt;&#10;&lt;br /&gt;&#10;Note that this needs to be turned on manually, either in the settings for a specific blog or in the system configuration as a default for all blogs.&lt;/p&gt;&#10;&#10;&lt;p&gt;As with any changes, we strongly suggest that you test the upgrade on a staging server and make a backup before attempting to update your live site. The process of migrating your blog data to the new format in version 2 isn't trivial, and any modified or overridden files will need to be updated to accommodate the changes.&lt;/p&gt;&#10;&#10;&lt;p&gt;The new version is available for download &lt;a href="https://github.com/fontis/fontis_blog"&gt;on our website&lt;/a&gt;, and you can browse the source on &lt;a href="https://github.com/fontis/fontis_blog"&gt;GitHub&lt;/a&gt; where we would welcome any contributions from the community.&lt;/p&gt;&#10;&#10;&lt;p&gt;We'd also love to hear about some of the new ways you make use of the support for multiple blogs per store, so let us know if this was just the feature you were waiting for.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Router Magento Extension Released</title><link>https://fontis.au/blog/router-extension-released/</link><pubDate>Wed, 20 Apr 2016 02:27:01 +0000</pubDate><guid>https://fontis.au/blog/router-extension-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Today we're releasing a new free Magento extension for developers - Fontis_Router. This is a low-level extension designed to provide better routing for other extensions that want pretty URLs. Its purpose is to stop Magento from automatically routing requests for things like &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;blog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;view&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt;. It is then up to the developer to implement their own router class to ensure that only the URLs they want to be considered valid are accepted.&lt;/p&gt;&#10;&#10;&lt;p&gt;The extension is available now for download &lt;a href="https://github.com/fontis/router-mage1"&gt;on our website&lt;/a&gt;, and documentation on how to make use of this extension is available from within your account once the extension has been added. You can also browse the source on &lt;a href="https://github.com/fontis/router-mage1"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;Fontis_Router is open source, and as always, contributions from the community via GitHub are most welcome.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - March 2016</title><link>https://fontis.au/blog/extension-roundup-march-2016/</link><pubDate>Sun, 17 Apr 2016 22:35:46 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-march-2016/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the free extensions that were released in March, including a customer notifications extension, a size charts solution and a special price countdown timer.</description></item><item><title>Australia Extension release for Magento 2</title><link>https://fontis.au/blog/australia-day-2016-extension-release/</link><pubDate>Tue, 26 Jan 2016 01:05:20 +0000</pubDate><guid>https://fontis.au/blog/australia-day-2016-extension-release/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Happy Australia Day everyone! Six years after &lt;a href="https://fontis.au/blog/australia-day-2010-extension-release"&gt;our last Australia Day release&lt;/a&gt;, the extension is still going strong and we are celebrating again this year with the release of the first version of the Fontis Australia extension for Magento 2. This initial release of the Australia extension includes the Australian regions and the BPAY and direct deposit payment methods. An Australia Post shipping method is not included with this first release, but will be added in a later version along with the rest of the features from the Magento 1 extension.&lt;/p&gt;&#10;&#10;&lt;p&gt;As part of the new release we have refactored out the &lt;a href="https://github.com/fontis/bpay-ref-generator"&gt;BPAY reference calculation code&lt;/a&gt; and the &lt;a href="https://github.com/fontis/customergroupaccess-mage2"&gt;check to determine if a customer group should have access to a resource&lt;/a&gt;. Both of these libraries have been published on GitHub and are licensed under the OSL3. The BPAY library doesn't even depend on Magento, so it can be used in any project which needs to calculate appropriate BPAY references.&lt;/p&gt;&#10;&#10;&lt;p&gt;With its recent GA release, 2016 will be the year of Magento 2, and we plan to port a number of our other popular extensions to the new platform while we also take the opportunity to officially discontinue others.&lt;/p&gt;&#10;&#10;&lt;p&gt;The Fontis Australia extension for Magento 2 is now available for immediate download on &lt;a href="https://github.com/fontis/australia-mage2"&gt;GitHub&lt;/a&gt; and is available to &lt;a href="https://github.com/fontis/fontis_australia"&gt;install through Composer from our site&lt;/a&gt;. If you have any feedback or would like to contribute, please submit an &lt;a href="https://github.com/fontis/australia-mage2/issues"&gt;issue on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - November 2015</title><link>https://fontis.au/blog/extension-roundup-november-2015/</link><pubDate>Mon, 14 Dec 2015 05:31:01 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-november-2015/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the free extensions that were released in November, including developer tools, Magento 2 code migration, and an expanded flat rate shipping method.</description></item><item><title>Magento Extension Roundup - October 2015</title><link>https://fontis.au/blog/extension-roundup-october-2015/</link><pubDate>Thu, 05 Nov 2015 22:12:37 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-october-2015/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the free extensions that were released in October, including admin activity and inventory logging solutions, order price and quantity restrictions, and events content.</description></item><item><title>Magento Extension Roundup - September 2015</title><link>https://fontis.au/blog/extension-roundup-september-2015/</link><pubDate>Thu, 08 Oct 2015 05:31:28 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-september-2015/</guid><description>In this month&amp;rsquo;s round-up, we look at a few extensions which include a stock sorter, a configurable subscription sign up process, a coupon popup, a generator for mock media files and an extension that allows setting advanced PDO options for database connections.</description></item><item><title>Google Tag Manager Extension Released</title><link>https://fontis.au/blog/google-tag-manager-extension-released/</link><pubDate>Tue, 15 Sep 2015 23:24:30 +0000</pubDate><guid>https://fontis.au/blog/google-tag-manager-extension-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Looking to manage remarketing code or other third-party services on your site, without needing a developer to make every change? &lt;a href="http://www.google.com/analytics/ce/mws/tagmanager/" target="_blank" rel="nofollow"&gt;Tag Manager&lt;/a&gt; is a free service from Google which aims to address this common problem and give you the ability to easily add tags for Google Analytics, AdWords, tracking pixels and more. The &lt;a href="https://www.fontis.com.au/google-tag-manager-magento-extension"&gt;Fontis Google Tag Manager extension for Magento&lt;/a&gt; will automatically export common Magento data so that it can be used in GTM.&lt;/p&gt;&#10;&#10;&lt;p&gt;You can install the GTM extension using our new &lt;a href="https://www.fontis.com.au/composer-faq"&gt;Composer repositories&lt;/a&gt;, making installation and upgrades a breeze. Once installed in Magento, simply add the public ID for your GTM container and you're ready to go. You can also choose what information is exposed to GTM, as well as write custom data layers, allowing a wide range of tags to be created.&lt;/p&gt;&#10;&#10;&lt;p&gt;What are some of the services you can integrate using GTM?&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;Google Universal Analytics and Enhanced Ecommerce&lt;/li&gt;&#10; &lt;li&gt;Google AdWords conversion tracking and remarketing&lt;/li&gt;&#10; &lt;li&gt;DoubleClick for Publishers&lt;/li&gt;&#10; &lt;li&gt;Google Consumer Surveys&lt;/li&gt;&#10; &lt;li&gt;Google Trusted Stores&lt;/li&gt;&#10; &lt;li&gt;Facebook remarketing and tracking&lt;/li&gt;&#10; &lt;li&gt;Clicktale&lt;/li&gt;&#10; &lt;li&gt;Crazyegg&lt;/li&gt;&#10; &lt;li&gt;AdRoll&lt;/li&gt;&#10; &lt;li&gt;AddThis&lt;/li&gt;&#10; &lt;li&gt;Chartbeat&lt;/li&gt;&#10; &lt;li&gt;Optimizely&lt;/li&gt;&#10; &lt;li&gt;LivePerson&lt;/li&gt;&#10; &lt;li&gt;... and many, many more&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Anything that requires HTML or JavaScript code to be embedded on a page can be installed this way, and managed all from within the GTM interface.&lt;/p&gt;&#10;&#10;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - August 2015</title><link>https://fontis.au/blog/extension-roundup-august-2015/</link><pubDate>Mon, 14 Sep 2015 07:24:07 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-august-2015/</guid><description>In this month&amp;rsquo;s round-up, we look at extensions that allow customers to subscribe to newsletters in multiple stores with the same email, a customisable team members page with profile information, a dynamic display of CMS blocks based on customer browsing and purchase history and a simple testimonial manager that lets admins manage and display customer testimonials via CMS blocks.</description></item><item><title>Composer Autoloader 2.0 released</title><link>https://fontis.au/blog/composer-autoloader-v2-released/</link><pubDate>Fri, 11 Sep 2015 08:19:37 +0000</pubDate><guid>https://fontis.au/blog/composer-autoloader-v2-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Today we are releasing version 2.0 of the Fontis Composer Autoloader extension for Magento, which is designed to let you use any Composer dependency within Magento. This release includes changes so that you no longer need to fire an extra event to use it for code that doesn't run during a normal Magento web request, such as a shell script.&lt;/p&gt;&#10;&#10;&lt;p&gt;These changes make the extension more generally applicable and mean developers no longer need to worry about whether Composer dependencies will be loaded differently based on environment. The way in which we've implemented this extension also means there is no need to patch or modify core files.&lt;/p&gt;&#10;&#10;&lt;p&gt;Fontis Composer Autoloader 2.0 is available now through &lt;a href="https://github.com/fontis/composer-autoloader"&gt;our website&lt;/a&gt;, as well as on &lt;a href="https://github.com/fontis/composer-autoloader" rel="nofollow"&gt;GitHub&lt;/a&gt;. If you find this extension helpful, please leave a comment and let us know, or if you'd like to contribute, issues and PRs on GitHub are always welcome.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Fontis Composer Repository Launch</title><link>https://fontis.au/blog/composer-repository-launch/</link><pubDate>Thu, 10 Sep 2015 07:30:23 +0000</pubDate><guid>https://fontis.au/blog/composer-repository-launch/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;PHP and Magento development has matured in the past few years. One of the biggest advances has been the widespread adoption of &lt;a href="https://getcomposer.org/" rel="nofollow"&gt;Composer&lt;/a&gt;, which has established itself as a de facto standard for the management of PHP packages and libraries. Though Composer doesn't immediately lend itself to the management of Magento extensions, the Magento developer community quickly realised the value of doing so and worked together to release the impressive &lt;a href="https://github.com/Cotya/magento-composer-installer" rel="nofollow"&gt;magento-composer-installer&lt;/a&gt;. This adds support for managing Magento extensions with Composer, which can make the process of managing versions and dependencies in a Magento installation much easier.&lt;/p&gt;&#10;&#10;&lt;p&gt;Magento 2 officially &lt;a href="http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html" rel="nofollow"&gt;requires Composer&lt;/a&gt; and will be using it as the recommended installation method, significantly improving the developer experience. With this change in mind, today we are pleased to announce the introduction of Composer support for all of our Magento 1 extensions, allowing developers to easily install, update and manage extensions registered to their Fontis account with Composer.&lt;/p&gt;&#10;&#10;&lt;p&gt;Getting started is as easy as adding your personal Fontis repository to your composer.json. For more information, see our &lt;a href="https://www.fontis.com.au/composer-faq"&gt;Composer FAQ page&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Using AWS DynamoDB for Magento session storage</title><link>https://fontis.au/blog/dynamodb-session-storage/</link><pubDate>Mon, 31 Aug 2015 00:00:00 +0000</pubDate><guid>https://fontis.au/blog/dynamodb-session-storage/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/dynamodb/"&gt;DynamoDB&lt;/a&gt; is a NoSQL database service provided by Amazon, offering features like easy scalability, high availability and data durability. These properties make it well suited to being used as a Magento session storage engine. The AWS PHP SDK already includes a PHP session handler, so in theory it should be a simple matter of including the SDK and configuring Magento to use it. In practice, it wasn't quite this straightforward.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Using a custom session handler&lt;/h2&gt;&#10;&#10;&lt;p&gt;Since CE 1.7, Magento has allowed specifying a custom session handler. This is done by specifying 'user' as the value of the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;session_save&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; node in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt;, and a static function to call in the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;session_save_path&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; node. For example:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;global&amp;gt;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;session_save&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;![CDATA[user]]&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/session_save&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;session_save_path&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;![CDATA[My_Module_Model_Session::initHandler]]&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/session_save_path&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/global&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Unfortunately this doesn't work out of the box. The value of the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;session_save_path&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; node is retrieved using the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getSessionSavePath&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Core_Model_Session_Abstract&lt;/span&gt;&lt;/code&gt;. This function checks to see if there's a config value for the session save path and returns it. The issue is that it's returned as a Magento config node object, not as a string. Magento tries to pass this object as an argument to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;call_user_func&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;, which won't work. This means the session handler isn't initialised correctly and the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;session_start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; call fails.&lt;/p&gt;&#10;&#10;&lt;p&gt;Our fix for this was to modify the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getSessionSavePath&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Core_Model_Session_Abstract&lt;/span&gt;&lt;/code&gt; to convert the return value to a string. This allows it to be successfully used as a &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;call_user_func&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; argument.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Storing session data in DynamoDB&lt;/h2&gt;&#10;&#10;&lt;p&gt;Once we got the session handler loaded, we found that sessions weren't being stored correctly on the frontend - the data was always blank. They did work correctly from the admin panel, however. After some digging, we found that the issue was the AWS SDK was failing to write the session data to DynamoDB because one of the arguments to the UpdateItem API call had no value. This was because the SDK uses &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; to escape API call parameters, and it was failing on the session data.&lt;/p&gt;&#10;&#10;&lt;p&gt;The session data string contained invalid UTF-8 characters in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;server_addr&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;remote_addr&lt;/span&gt;&lt;/code&gt; values. These are added by the Mage_Log module and contain the output of the &lt;a href="http://php.net/manual/en/function.inet-pton.php" rel="nofollow" target="_blank"&gt;inet_pton()&lt;/a&gt; function: IP addresses as binary strings. As the output of this function isn't likely to be valid UTF-8, it causes &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; to fail when called on the session data. The relevant classes and methods are:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;initByRequest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Log_Model_Visitor&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10; &lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getServerAddr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getRemoteAddr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Core_Helper_Http&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The issue didn't occur for the admin panel as the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;server_addr&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;remote_addr&lt;/span&gt;&lt;/code&gt; values are only added on the frontend. Admin sessions didn't contain the binary strings and could be successfully passed to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;. This also only occurs for recent versions of Magento (such as CE 1.9.2.0). Previous versions used &lt;a href="http://php.net/manual/en/function.ip2long.php" rel="nofollow" target="_blank"&gt;ip2long()&lt;/a&gt; to output IP addresses; this returns an integer that can be successfully JSON-encoded.&lt;/p&gt;&#10;&#10;&lt;p&gt;Our solution was to disable the Mage_Log module, as we didn't need it (or anything depending on it) for this project. We used the &lt;a href="https://github.com/Zookal/magento-mock"&gt;Zookal magento-mock&lt;/a&gt; module to let us disable the module without causing errors in other code that expects it to be present. Another possible solution would be to have the session handler encode/decode the session data to handle the invalid UTF-8 characters (i.e. using Base64).&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - July 2015</title><link>https://fontis.au/blog/extension-roundup-july-2015/</link><pubDate>Fri, 14 Aug 2015 23:08:13 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-july-2015/</guid><description>In this month&amp;rsquo;s round-up, we look at five free extensions. These include a streamlining tool to speed up the checkout process, a customisable Q&amp;amp;A section, a product history page for insights on a certain item, an extension that automates the display of related items on product pages, and an extension that enables webhooks helping integrations with third party platforms.</description></item><item><title>CLI image resize memory limit errors</title><link>https://fontis.au/blog/cli-memory-limit-reached/</link><pubDate>Mon, 13 Jul 2015 07:27:49 +0000</pubDate><guid>https://fontis.au/blog/cli-memory-limit-reached/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Magento will automatically resize product images based on dimensions specified in templates so that customers aren't downloading large source images when all they need is a small thumbnail. However, we've discovered an issue with recent versions of Magento which will sometimes cause a "Memory Limit has been reached" error when attempting to resize images through a PHP command line script.&lt;/p&gt;&#10;&#10;&lt;p&gt;This issue was introduced in Magento CE 1.8.0.0 and EE 1.13.0.0 versions, and will normally only occur with code that is run from the CLI. The default PHP CLI &lt;a href="http://php.net/manual/en/ini.core.php#ini.memory-limit" rel="nofollow" target="_blank"&gt;memory limit&lt;/a&gt; is often set to &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt; so that there is no memory limit applied. Reviewing the relevant code we found that Magento was using the following method to determine if it had enough memory to resize images:&lt;/p&gt;&#10;&lt;p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_isMemoryLimitReached&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_convertToByte&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ini_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;memory_limit&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getimagesize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_fileName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$requiredMemory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;memory_get_usage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;$requiredMemory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$limit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;If the memory limit is set to &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt;, this code will return true, as the required memory will always be greater than &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt;. To fix this issue, you simply need to adjust the function to include an extra check for the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt; memory limit:&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_isMemoryLimitReached&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_convertToByte&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ini_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;memory_limit&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="c1"&gt;// If the memory limit is -1 we want to return false as this value means we have no memory limit.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$limit&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getimagesize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_fileName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$requiredMemory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;$size&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;memory_get_usage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;$requiredMemory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$limit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;You can download a &lt;a href="https://fontis.au/media/wysiwyg/blog/cli-memory-limit-reached/image_memory_limit.patch"&gt;patch to fix the memory limit error when resizing images&lt;/a&gt; and apply it with the following command from your Magento root directory:&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;patch -p0 &amp;gt; image_memory_limit.patch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;It should be noted that this bug will only come up if Magento is attempting to resize an image which doesn't already exist. If Magento had previously generated that image size (such as through a web request), then it won't try to do so again and you won't run into the problem. This issue has already been &lt;a href="http://www.magentocommerce.com/bug-tracking/issue/index/id/184"&gt;submitted to the Magento bug tracker&lt;/a&gt;, so hopefully a fix will be included in a future release. The Mercator project has been &lt;a href="https://github.com/mercator/mercator/commit/96e7aaa10561b345b756cec2a1402246f39add80"&gt;updated with the patch&lt;/a&gt; as well.&#10;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - June 2015</title><link>https://fontis.au/blog/extension-roundup-june-2015/</link><pubDate>Fri, 10 Jul 2015 01:08:22 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-june-2015/</guid><description>In this month&amp;rsquo;s round-up, we look at an extension that improves customer experience and developer convenience, a customer self deletion and order cancellation, HTML5 form support in the admin panel, automatic currency based on IP, an enhanced index stats for Enterprise Edition, and an IP-based offline payment method for developers.</description></item><item><title>MageAudit Updated with Report History</title><link>https://fontis.au/blog/mageaudit-updated-report-history/</link><pubDate>Thu, 25 Jun 2015 04:42:39 +0000</pubDate><guid>https://fontis.au/blog/mageaudit-updated-report-history/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Our popular Magento auditing tool, &lt;a href="https://www.fontis.com.au/mageaudit"&gt;MageAudit&lt;/a&gt;, has been updated to collect your reports together for easy historical reference, while we've also added a number of other features requested by our customers, including the option to purchase multiple credits at a discounted rate.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Updated Features&lt;/h2&gt;&#10;&#10;&lt;p&gt;Previously, audit reports were isolated and could only be viewed by using the unique URL sent in confirmation emails. Though these URLs were randomised and measures were in place to lock reports where unusual access patterns were detected, given the sensitive nature of report contents we have made the decision to require authentication. Now, all audits are listed in your customer account, giving you one place to log in to and see any past audits, including their report grade.&lt;/p&gt;&#10;&#10;&lt;p&gt;In addition, each audit report is now unlocked with credits which can be purchased in bulk, with discounts available. This will make it cheaper and more convenient to run multiple audits across one or more Magento sites, for example when performing a second audit after changes from a first audit have been made.&lt;/p&gt;&#10;&#10;&lt;p&gt;We've also improved the data collector script that runs on your server to submit an audit so that it's faster, consumes fewer resources, and will work on a wider range of systems. This should make the process of running an audit even easier.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Accessing Previous Reports&lt;/h2&gt;&#10;&#10;&lt;p&gt;If you'd like you view a report generated before these most recent changes, you can still do so by logging in to your new account on our site. All existing audits have been associated with new accounts using the email address that was provided when running an audit. To log in to your new account:&lt;/p&gt;&#10;&#10;&lt;ol&gt;&#10; &lt;li&gt;Go to the &lt;a href="https://www.fontis.com.au/customer/account/"&gt;Log In&lt;/a&gt; page&lt;/li&gt;&#10; &lt;li&gt;Either:&lt;ul&gt;&#10; &lt;li&gt;Log in with a social service, if you have a social account with the same email address provided when submitting the audit; or&lt;/li&gt;&#10; &lt;li&gt;Use the &lt;a href="https://www.fontis.com.au/customer/account/forgotpassword/"&gt;Forgot Your Password?&lt;/a&gt; to reset the password for your email address&lt;/li&gt;&#10; &lt;/ul&gt;&#10; &lt;/li&gt;&#10;&lt;/ol&gt;&#10;&#10;&lt;p&gt;Once you're logged in, you can update your account details and &lt;a href="https://www.fontis.com.au/mageaudit/account/"&gt;view historical reports&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;h2&gt;What's Next?&lt;/h2&gt;&#10;&#10;&lt;p&gt;This update will make it easier for us to keep improving MageAudit and add further checks to better inform you of potential issues on your Magento site. Running an audit to receive an indicative letter grade is free (you only pay for detailed reports), so if you haven't tried out MageAudit yet, create an account and give your site a health check today!&lt;/p&gt;&#10;&#10;&lt;p style="margin:2em 0;"&gt;&#10; &lt;a href="https://www.fontis.com.au/mageaudit" class="btn btn-secondary"&gt;Try MageAudit&lt;/a&gt;&#10;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Enterprise 1.14.2.0 Release</title><link>https://fontis.au/blog/magento-enterprise-1-14-2-0-release/</link><pubDate>Tue, 23 Jun 2015 03:47:39 +0000</pubDate><guid>https://fontis.au/blog/magento-enterprise-1-14-2-0-release/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;April saw the release of the latest version of Magento Enterprise Edition (&lt;a target="_blank" rel="nofollow" href="http://magento.com/blog/magento-news/introducing-enterprise-edition-1142"&gt;1.14.2.0&lt;/a&gt;), bringing in the usual assortment of new features and bug fixes. While we &lt;a target="_blank" rel="nofollow" href="http://community.magento.com/t5/News-Announcements/Magento-Community-Edition-1-9-2-Update/m-p/8878"&gt;wait&lt;/a&gt; for the corresponding release of Community Edition 1.9.2.0 (1.9.1.1 is basically 1.9.1.0 with the patch for SUPEE-5344 applied), we've put together some notes on the release based on a quick look through the changes.&lt;/p&gt;&#10;&#10;&lt;p&gt;With each new release, we first review the &lt;a target="_blank" rel="nofollow" href="http://merch.docs.magento.com/ee/user_guide/Magento_Enterprise_Edition_User_Guide.html#magento/release-notes-ee-1.14.2.html"&gt;release notes&lt;/a&gt; for a summary of the changes, and these have improved a great deal in more recent releases. However, there are still points that would benefit from further explanation, such as:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Product Visibility set to "Search" works correctly.&lt;/li&gt;&#10; &lt;li&gt;Widgets can be added to CMS pages.&lt;/li&gt;&#10; &lt;li&gt;Saving a customer account from the Admin no longer returns an error.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;These issues all sound quite serious, however as far as we know the features were working more or less correctly in past releases. Without an explanation of how these bugs were fixed, or indeed what they actually were, it is difficult to understand the applicability of the changes to any particular installation.&lt;/p&gt;&#10;&#10;&lt;p&gt;In order to identify exactly what has changed so that we can understand the implications more fully, it can be helpful to manually review the changes between releases in the form of a patch. To do so, we first create our own patch by unpacking a copy of the new release into a "magento-new" directory, alongside a copy of the previous release in a "magento-old" directory. The patch can then be generated like so:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;diff -r -u -N magento-old/app magento-new/app &amp;gt; app.patch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;We split up each top level directory of the Magento codebase (app, lib, js, etc.) to make it a bit easier to review, so the command should be repeated for each directory of interest in the codebase. In the past (most recently 1.12.0.0-1.12.0.1), Magento released official patches as a means of upgrading rather than full release archives only, which is something that would be great to see brought back.&lt;/p&gt;&#10;&#10;&lt;p&gt;With our patches in hand, we can begin to review the changes in detail.&lt;/p&gt;&#10;&#10;&lt;h2&gt;License headers&lt;/h2&gt;&#10;&#10;&lt;p&gt;We'll get the boring one out of the way first. Each year, one of the first releases sees a change to every file, due to a desire to update the copyright year in all of the license headers. Being the first release of 2015, version 1.14.2.0 is no exception, and it has had at least the copyright year changed in every single file. Whether or not this is necessary is a question for the lawyers, but it certainly makes reviewing the patch a more frustrating process than it otherwise would be.&lt;/p&gt;&#10;&#10;&lt;p&gt;If Magento were to start releasing official patches again, it would be very helpful for the license header changes to be split out and provided as a separate patch. This would make reviewing the upgrades much easier, since you then have the actual code changes isolated from the non-functional header changes.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Google Tag Manager support&lt;/h2&gt;&#10;&#10;&lt;p&gt;A new Enterprise-only feature is built-in support for &lt;a target="_blank" rel="nofollow" href="https://www.google.com/tagmanager/"&gt;Google Tag Manager&lt;/a&gt; (GTM). This new module appears to add some basic transaction data into the GTM data layer, as well as click tracking for the main checkout flow including add to cart, initiating checkout as guest or logged-in user, and steps through the default multi-step checkout. It also adds click tracking for the banner functionality in Enterprise Edition.&lt;/p&gt;&#10;&#10;&lt;p&gt;At this stage, the module doesn't appear to be very extensible and it has a number of shortcomings, some of which were acknowledged by Magento in the release notes. These include:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;No way to easily add more data to the data layer through configuration&lt;/li&gt;&#10; &lt;li&gt;Checkout tracking hardcoded for the default multi-step checkout, meaning that alternative checkouts are not supported&lt;/li&gt;&#10; &lt;li&gt;No built-in support for customer data in the data layer&lt;/li&gt;&#10; &lt;li&gt;Analytics tracking has been added to usage of the admin panel&lt;/li&gt;&#10; &lt;li&gt;Known issues relating to click tracking of add to cart actions (see release notes)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;We will soon release a GTM extension that addresses some of these issues and offers Community Edition compatibility. If you'd like to be notified of the release, you can &lt;a href="http://eepurl.com/bq5vkz"&gt;register&lt;/a&gt; for the release announcement and to receive a launch discount.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Sysreport tool&lt;/h2&gt;&#10;&#10;&lt;p&gt;Although technically included in the last release (1.14.1.0), a relatively new Enterprise-only feature is the "sysreport" system diagnosis tool. The tool is designed to produce a report on the health of your Magento installation by checking if any core files have been modified running some other tests.&lt;/p&gt;&#10;&#10;&lt;p&gt;At this stage the tool seems intended to be used to dump raw information that you might send to Magento support, rather than providing any recommendations to assist in resolving the problems it detects.&lt;/p&gt;&#10;&#10;&lt;p&gt;As an alternative, our &lt;a href="https://www.fontis.com.au/mageaudit"&gt;MageAudit&lt;/a&gt; service supports both Community and Enterprise editions, and produces a report that includes the results of over 30 tests across 6 categories. The tests are accompanied by recommendations on how to resolve common issues in the event that a test fails.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Wrapping up&lt;/h2&gt;&#10;&#10;&lt;p&gt;While the Magento release notes have improved substantially from those of yesteryear, we'd still like to see more detail and in-depth explanations of each change, particularly for items in the "Miscellaneous Fixes" group from these release notes. Magento 2 is showing promise in this area, as even though there are references to an internal bug tracker added by the Magento team, there are also transparent discussions happening around some of those changes in the project's &lt;a target="_blank" href="https://github.com/magento/magento2/issues" rel="nofollow"&gt;GitHub issue tracker&lt;/a&gt;. If Magento 2's release notes were to include links to relevant GitHub issues as part of the detail for each change (in CE at least), this would go a long way towards documenting and making it easier to understand changes where there was community engagement. Bringing back patches that separate code changes between versions from the copyright year updates and whitespace changes would also help.&lt;/p&gt;&#10;&#10;&lt;p&gt;Finally, be sure to keep an eye on the &lt;a target="_blank" href="https://github.com/mercator/mercator"&gt;Mercator project&lt;/a&gt;, as we will update it with the changes from CE 1.9.2.0 soon after release.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Australia 3.1.0 released</title><link>https://fontis.au/blog/australia-v31-released/</link><pubDate>Fri, 05 Jun 2015 04:30:54 +0000</pubDate><guid>https://fontis.au/blog/australia-v31-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 3.1.0 of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Fontis Australia extension&lt;/a&gt;. This new version includes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Now allows for custom charge codes when importing rates, for merchants who don't use one of the standard eParcel codes. If enabled, the charge code will no longer be validated against the standard list and accept any codes sudmitted.&lt;/li&gt;&#10; &lt;li&gt;Fixes checkout autocomplete JavaScript to send country codes correctly when multiple countries are available.&lt;/li&gt;&#10; &lt;li&gt;Update the Australia Post tracking website URL.&lt;/li&gt;&#10; &lt;li&gt;Fix issues with admin routes arising due to SUPEE-5344 patch.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Thanks to &lt;a target="_blank" rel="nofollow" href="http://www.aligent.com.au/"&gt;Aligent&lt;/a&gt; and &lt;a target="_blank" rel="nofollow" href="https://github.com/bencorlett"&gt;Ben Corlett&lt;/a&gt; for contributing these changes.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Feeds Generator 1.4.0 released</title><link>https://fontis.au/blog/feeds-generator-v140-released/</link><pubDate>Wed, 03 Jun 2015 07:37:41 +0000</pubDate><guid>https://fontis.au/blog/feeds-generator-v140-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of version 1.4.0 of our &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;Feeds Generator extension&lt;/a&gt;, which brings numerous fixes to the Google Shopping products feed generation and some other minor improvements.&lt;/p&gt;&#10;&#10;&lt;p&gt;Included in this release are the following changes:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;The Google feed will only set a configurable product as a variant if it varies by one of the official attributes - color, size, material or pattern. This avoids problems with Google rejecting products from the feed that don't use one of these attributes.&lt;/li&gt;&#10;&#10; &lt;li&gt;A configuration option has been added to the admin panel to make it easy to disable generating the feeds as part of the Magento cron run. This is useful if you want to generate the feeds as part of your own system cron jobs, without needing to manually remove the corresponding cron entries from the extension's config.xml file. Since the feed generation can take a while for larger catalogs, it's often preferrable to run it on its own outside of Magento, which gives you greater control over when and how the feeds are updated.&lt;/li&gt;&#10;&#10; &lt;li&gt;When checking for valid image URLs in the Google feed the extension now accepts HTTPS in addition to HTTP. Previously the URL would be incorrectly rejected and rewritten to a path which would result in a 404.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;You can download and install the new release now from our &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;GitHub repository&lt;/a&gt; or by adding &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;the Feeds Generator extension&lt;/a&gt; to your account on our website.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - May 2015</title><link>https://fontis.au/blog/extension-roundup-may-2015/</link><pubDate>Tue, 02 Jun 2015 01:16:57 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-may-2015/</guid><description>In this month&amp;rsquo;s round-up, we quickly review some of the more notable free extensions which were released on Magento Connect and GitHub in the past month. This month we look at Magento 2 migration, instant messaging integration, image compression, and more.</description></item><item><title>Magento Extension Roundup - April 2015</title><link>https://fontis.au/blog/extension-roundup-april-2015/</link><pubDate>Tue, 12 May 2015 05:42:52 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-april-2015/</guid><description>In this month&amp;rsquo;s round-up, we look at extensions for adding your own custom stock statuses and customer attributes, auto-registering customers on checkout, Instagram integration and more.</description></item><item><title>Australia 3.0 and Feeds Generator</title><link>https://fontis.au/blog/australia-v3-feeds-generator/</link><pubDate>Wed, 29 Apr 2015 00:18:56 +0000</pubDate><guid>https://fontis.au/blog/australia-v3-feeds-generator/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are happy to announce a couple of major releases today. Users of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Australia extension&lt;/a&gt; will be pleased to hear that we have released version 3.0, containing substantial new features and many minor enhancements. Additionally, the new &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;Feeds Generator extension&lt;/a&gt; has been launched, allowing you to easily produce feeds of your Magento catalogue for the major shopping comparison services like Google Shopping.&lt;/p&gt;&#10;&#10;&lt;section&gt;&#10; &lt;h2&gt;Australia&lt;/h2&gt;&#10; &lt;p&gt;The 3.0 release of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Australia extension&lt;/a&gt; is a major release that adds many new features for Australian stores. Major changes made in the 3.0 release include:&lt;/p&gt;&#10;&#10; &lt;h3&gt;Overhauled Australia Post shipping method&lt;/h3&gt;&#10; &lt;p&gt;The Australia Post shipping method has been updated to use the Postage Assessment Calculator service from Australia Post. The service will determine a list of appropriately-priced shipping rates based on the customer's order items. Additionally, the merchant can control whether the customer is also presented with options for insurance and signature on delivery.&lt;/p&gt;&#10; &lt;p&gt;This can be used in conjunction with the Click &amp; Send order export feature (detailed below) to manage consignments.&lt;/p&gt;&#10; &#10; &lt;h3&gt;Click &amp; Send consignments export&lt;/h3&gt;&#10; &lt;p&gt;Similar to the eParcel consignments export functionality (which we've updated with bug fixes and new configuration options), we now support exporting orders into a CSV format suitable for the Click &amp; Send consignments service. This gives you more choice in how you transfer consignment information to Australia Post.&lt;/p&gt;&#10; &#10; &lt;h3&gt;Checkout page address validation&lt;/h3&gt;&#10; &lt;p&gt;Through our integration with the Australia Post Delivery Choices service, you can optionally choose to enable address validation for your checkout page.&lt;/p&gt;&#10; &lt;p&gt;Once a customer has entered their billing or shipping address details on the checkout, the Delivery Choices service will be used to validate the provided address. If the address is invalid, the customer will be prompted with optional suggestions for a correct address.&lt;/p&gt;&#10; &lt;p&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/australia-3/address-validation-checkout.png" alt="" class="img-responsive" /&gt;&lt;/p&gt;&#10; &lt;p&gt;The customer can choose to accept the suggestion, reject it and use the exact address they entered, or go back and edit their address. If the address is already valid as entered, the dialog box is not displayed and the customer is taken to the next section of the checkout as normal.&lt;/p&gt;&#10;&#10; &lt;h3&gt;Minor updates&lt;/h3&gt;&#10;&#10; &lt;ul&gt;&#10; &lt;li&gt;Addition of eParcel rates export functionality&lt;/li&gt;&#10; &lt;li&gt;Improvements to eParcel consignments export functionality&lt;/li&gt;&#10; &lt;li&gt;Improvements to postcode autocomplete&lt;/li&gt;&#10; &lt;li&gt;Improvements to Direct Deposit payment method&lt;/li&gt;&#10; &lt;li&gt;Improvements to BPAY payment method&lt;/li&gt;&#10; &lt;li&gt;Support for wildcards in eParcel CSV rates import functionality&lt;/li&gt;&#10; &lt;li&gt;Support for email notifications in eParcel consignments&lt;/li&gt;&#10; &lt;li&gt;Support for multi-warehouse in eParcel consignments&lt;/li&gt;&#10; &lt;/ul&gt;&#10;&lt;/section&gt;&#10;&#10;&lt;section&gt;&#10; &lt;h2&gt;Feeds Generator&lt;/h2&gt;&#10; &lt;p&gt;A popular feature of the Australia extension was the ability to generate feeds for the various shopping comparison services available, such as Google Shopping. We are pleased to announce that this feature will now receive more focused development as the separate &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;Feeds Generator extension&lt;/a&gt;, since it now also supports services used outside of Australia. By splitting out the feeds generation functionality, merchants who just want the feeds generator don't need to also install the rest of the Australia extension.&lt;/p&gt;&#10;&lt;/section&gt;&#10;&#10;&lt;section&gt;&#10; &lt;h2&gt;Summary&lt;/h2&gt;&#10; &lt;p&gt;This release of the &lt;a href="https://github.com/fontis/fontis_australia"&gt;Australia extension&lt;/a&gt; is a major update to the integration with Australia Post, allowing Australian stores to make use of the latest Australia Post services. Our &lt;a href="https://github.com/fontis/fontis_feedsgenerator"&gt;Feeds Generator extension&lt;/a&gt; allows you to generate feed files for Google Shopping and a host of other comparison shopping services.&lt;/p&gt;&#10; &lt;p&gt;You can download and install these new releases immediately from our &lt;a href="https://github.com/fontis"&gt;GitHub repositories&lt;/a&gt; or &lt;a href="http://www.magentocommerce.com/magento-connect/developer/Fontis"&gt;Magento Connect&lt;/a&gt;. Documentation is available from our website by adding the extensions to your account.&lt;/p&gt;&#10; &lt;p&gt;We would like to thank &lt;a href="https://github.com/bencorlett"&gt;Ben Corlett&lt;/a&gt;, &lt;a href="https://github.com/drdrak3"&gt;Matthew Boik&lt;/a&gt;, &lt;a href="https://github.com/dermo666"&gt;Tomas Dermisek&lt;/a&gt; and &lt;a href="https://github.com/vishnub"&gt;Vishnu Bhatvadekar&lt;/a&gt; for contributing to this release of the Australia extension. As always, contributions from the community are welcomed.&lt;/p&gt;&#10;&lt;/section&gt;&lt;/div&gt;</description></item><item><title>Magento Extension Roundup - March 2015</title><link>https://fontis.au/blog/extension-roundup-march-2015/</link><pubDate>Fri, 17 Apr 2015 09:23:33 +0000</pubDate><guid>https://fontis.au/blog/extension-roundup-march-2015/</guid><description>In this month&amp;rsquo;s round-up, we review a few free extensions. These include wishlist notifications for admins, custom SMTP email configurations, a maintenance mode within Magento, order deletion, and checkout promotions. Other extensions include guest audits, admin syntax highlighting, and speed optimisations offer useful enhancements for developers.</description></item><item><title>Algolia Magento Extension Released</title><link>https://fontis.au/blog/algolia-magento-extension-released/</link><pubDate>Thu, 16 Apr 2015 08:05:01 +0000</pubDate><guid>https://fontis.au/blog/algolia-magento-extension-released/</guid><description>Algolia is an exciting new hosted search service that provides instant search results as you type. The service is reliable, with a 99.99% uptime SLA and a &lt;a href="https://www.algolia.com/dsn"&gt;distributed service network&lt;/a&gt; that delivers lightning fast results no matter where you are in the world. It provides an easy to use administration interface which allows you to quickly and easily check on the data and settings of your search indexes, as well as viewing analytics and logs. Pricing for such a powerful service is very reasonable, with &lt;a href="https://www.algolia.com/pricing"&gt;plans&lt;/a&gt; starting from as low as $49 per month, putting it well within reach of smaller site operators.</description></item><item><title>Adding the WYSIWYG editor to an extension</title><link>https://fontis.au/blog/add-wysiwyg-editor-to-extension/</link><pubDate>Thu, 02 Apr 2015 07:45:47 +0000</pubDate><guid>https://fontis.au/blog/add-wysiwyg-editor-to-extension/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;&#10; While developing the new &lt;a href="https://github.com/fontis/fontis_blog"&gt;Fontis Blog extension&lt;/a&gt;,&#10; we wanted to allow use of the same WYSIWYG editor tools that users have when&#10; creating Magento CMS pages or static blocks. Doing so is not very difficult,&#10; requiring only a few changes to add the Magento WYSIWYG to your own extensions.&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; The first step is tell Magento that it can load the&#10; TinyMCE WYSIWYG JavaScript file. This should be done in the layout, in the handle&#10; used for your page, like so:&#10;&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;reference&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;head&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;action&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;setCanLoadTinyMce&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;flag&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/flag&amp;gt;&amp;lt;/action&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/reference&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;&#10; The second step is to set a couple of attributes for each&#10; field on your page that you wish to have the WYSIWYG editor. For each&#10; field that you have on your page, you'll have a call to &#10; &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$fieldset&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addField&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; with a few configuration&#10; options. Most fields will have the "name", "label", "title", "style" and "required"&#10; options set. To enable the WYSIWYG editor for a specific field, you'll need&#10; to add the following two options:&#10;&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;&#10; &lt;i&gt;wysiwyg&lt;/i&gt; &amp;mdash; set this to true&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;i&gt;config&lt;/i&gt; &amp;mdash; make a call to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getSingleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cms/wysiwyg_config&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;&#10; and assign the result to this&#10; &lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;&#10; This will be enough to get the WYSIWYG editor working, but there are still some&#10; additional steps required to get it working as you'd expect.&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; When you make the call to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getSingleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cms/wysiwyg_config&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;,&#10; you can specify a few defaults. To do so, you create an array with these&#10; defaults and pass it as a parameter to &lt;code class="code-inline language-xml"&gt;getConfig()&lt;/code&gt;, like so:&#10;&lt;/p&gt;&#10;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getSingleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cms/wysiwyg_config&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="na"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;add_variables&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;add_widgets&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;add_images&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&#10;&lt;p&gt;&#10; These settings control the visibility of the "Add Variables", "Add Widgets" and&#10; "Add Images" buttons when the WYSIWYG editor is hidden. It is also worth noting that&#10; if the WYSIWYG editor is disabled completely, the "Add Images" button will not show&#10; up even if set to &lt;code class="code-inline language-xml"&gt;true&lt;/code&gt; unless either &lt;code class="code-inline language-xml"&gt;add_variables&lt;/code&gt; or&#10; &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;add_widgets&lt;/span&gt;&lt;/code&gt; (or both) are set to &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;/code&gt;.&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; Next, in order for the Magento WYSIWYG image gallery to actually appear, you need to add&#10; &lt;code class="code-inline language-xml"&gt;&lt;span class="nt"&gt;&amp;lt;update&lt;/span&gt; &lt;span class="na"&gt;handle=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;editor&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt; to the relevant layout XML.&#10; For example:&#10;&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;adminhtml_blog_blog_edit&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;update&lt;/span&gt; &lt;span class="na"&gt;handle=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;editor&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/adminhtml_blog_blog_edit&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;&#10; This tells Magento to load in further JavaScript which enables the use of the gallery.&#10; You'll need to ensure this is in place for all controller actions, such as for separate&#10; edit and add actions.&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; Lastly, don't forget to put the text the user entered through Magento's CMS processor&#10; before the text is output to the browser. This ensures the CMS tags inserted by&#10; the WYSIWYG editor are parsed and replaced by actual markup. This is done with a&#10; call to the following function:&#10;&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$processedContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getPageTemplateProcessor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$unprocessedContent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;&#10; Following the above process should allow your extension to provide admins&#10; with the familiar Magento WYSIWYG editor on a text field of your choosing, making it easy&#10; for them to manage rich content on their site.&#10;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Mercator Demo Vagrant Box</title><link>https://fontis.au/blog/mercator-demo-vagrant-box/</link><pubDate>Fri, 23 May 2014 02:02:56 +0000</pubDate><guid>https://fontis.au/blog/mercator-demo-vagrant-box/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;As part of our ongoing work on &lt;a href="https://github.com/mercator/mercator"&gt;Mercator&lt;/a&gt; (a Magento Community Edition distribution &lt;a href="https://fontis.au/blog/mercator-release"&gt;launched&lt;/a&gt; last year), we have released a demo &lt;a href="http://www.vagrantup.com"&gt;Vagrant&lt;/a&gt; box, available for immediate download. Mercator has recently been updated to merge changes from the Magento CE 1.9.0.1 release, and now includes features such as a streamlined checkout, responsive design using the Bootstrap framework, and improved search functionality. Rather than having to set up a development environment and install Mercator, the box is fully configured and ready for use. The box runs Mercator on &lt;a href="http://hhvm.com"&gt;HHVM&lt;/a&gt;, includes services like &lt;a href="http://redis.io/"&gt;Redis&lt;/a&gt; and &lt;a href="http://www.elasticsearch.org/"&gt;Elasticsearch&lt;/a&gt; pre-installed and configured, and uses the Magento CE 1.8 sample data.&lt;/p&gt;&#10;&#10;&lt;p&gt;The store switcher has been configured with both Mercator's Bootstrap theme, the standard Magento theme and the new Magento CE 1.9 responsive web design ("RWD") theme. Note that the RWD theme isn't fully compatible with some of Mercator's features (i.e. AJAX layered navigation) just yet.&lt;/p&gt;&#10;&#10;&lt;p&gt;To get started with a Vagrant Mercator VM:&lt;/p&gt;&#10;&#10;&lt;ol&gt;&#10;&lt;li&gt;Install Vagrant (version 1.1 or greater).&lt;/li&gt;&#10;&#10;&lt;li&gt;Download the &lt;a href="http://dl.fontis.com.au/mercator.box"&gt;box file&lt;/a&gt; (MD5: &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;c865ce46da6c4bcb41f0c422fec18b0a&lt;/span&gt;&lt;/code&gt;):&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wget http://dl.fontis.com.au/mercator.box&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;Import the box:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vagrant box add --name mercator mercator.box&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;Initialise and start a new Mercator VM:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir mercator_vm&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; mercator_vm&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vagrant init mercator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vagrant up&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;View Mercator in your web browser:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;http://127.0.0.1:8081/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&#10;&lt;p&gt;For more information on using the VM, including admin details, see the &lt;a href="https://github.com/mercator/mercator/wiki/Vagrant"&gt;Mercator wiki&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;Mercator is still a work in progress and is under active development on &lt;a href="https://github.com/mercator/mercator"&gt;GitHub&lt;/a&gt;. Contributions and any feedback are welcome.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Mercator Launched</title><link>https://fontis.au/blog/mercator-release/</link><pubDate>Mon, 02 Sep 2013 02:44:02 +0000</pubDate><guid>https://fontis.au/blog/mercator-release/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Fontis is pleased to announce the release of Mercator, a community driven distribution of Magento. The Magento community has matured to the point where an amazing number of valuable open source contributions have been released, and Mercator expands upon the Community Edition feature set by bringing together the best of these extensions into a cohesive distribution. Code is now on &lt;a href="https://github.com/fontis/mercator"&gt;GitHub&lt;/a&gt;, and already includes a number of additional features in its initial commit that have been integrated through community extensions.&lt;/p&gt;&#10;&#10;&lt;p&gt;The project has the following goals:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Include the best community extensions to add the most commonly required features, tested and integrated to ensure they work together.&lt;/li&gt;&#10;&lt;li&gt;Provide a better platform for new projects that does not prioritise backwards compatibility with official Magento releases. This allows core changes and fixes where appropriate.&lt;/li&gt;&#10;&lt;li&gt;Present an alternative to Enterprise Edition, with a similar feature set but under an open source licensing and development model.&lt;/li&gt;&#10;&lt;li&gt;Continue support and development of the Magento 1.x codebase.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Why another fork? The goals of the project are different enough from other prominent forks (e.g. Mage+) that we feel a new codebase is warranted. In particular, we are not attempting to rigidly maintain backwards compatibility, so the intent is that we are free to make breaking changes when it is deemed necessary.&lt;/p&gt;&#10;&#10;&lt;p&gt;The initial commit includes all the standard features of Magento Community Edition, plus the following new features:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Enhanced admin product grid&lt;/li&gt;&#10;&lt;li&gt;Integrated blog&lt;/li&gt;&#10;&lt;li&gt;Enhanced cron scheduler admin interface&lt;/li&gt;&#10;&lt;li&gt;Redis cache backend&lt;/li&gt;&#10;&lt;li&gt;Support for changing a product's attribute set&lt;/li&gt;&#10;&lt;li&gt;Custom shipping rates that can be used for admin panel order creation&lt;/li&gt;&#10;&lt;li&gt;Quick admin panel navigation&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Further additions are planned, and we welcome input on any extensions that may be good candidates for inclusion. We are also looking for other collaborators to contribute directly to the project, and would invite interested developers to join us on GitHub and get involved.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Fontis Magento Blog Extension</title><link>https://fontis.au/blog/magento-blog-extension-released/</link><pubDate>Mon, 26 Aug 2013 07:00:31 +0000</pubDate><guid>https://fontis.au/blog/magento-blog-extension-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Blogs are a great tool for businesses to engage with customers and publicise the latest products, promotions and services through their website, and eCommerce websites are of course no exception. There are a number of solutions for Magento that have been around for quite a long time now, but we feel there's still room for improvement when it comes to a native extension, and that's why we're pleased to announce the release of the Fontis Blog extension for Magento. With source now available on &lt;a href="https://github.com/fontis/fontis_blog"&gt;GitHub&lt;/a&gt; and as a package on the &lt;a href="https://github.com/fontis/fontis_blog"&gt;Fontis Blog Magento extension&lt;/a&gt; page, it provides a built-in blogging platform for Magento using familiar admin panel content management features.&lt;/p&gt;&#10;&#10;&lt;p&gt;The Blog extension has all the standard features you'd expect:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Posts&lt;/li&gt;&#10;&lt;li&gt;Categories&lt;/li&gt;&#10;&lt;li&gt;Comments&lt;/li&gt;&#10;&lt;li&gt;Archives&lt;/li&gt;&#10;&lt;li&gt;RSS feeds&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;It also has full multi-store support, and integrates seamlessly with the newly-updated &lt;a href="https://github.com/fontis/fontis_recaptcha"&gt;Fontis reCAPTCHA Magento extension&lt;/a&gt;. You can review the full list of features from our &lt;a href="https://github.com/fontis/fontis_blog"&gt;Blog Magento extension&lt;/a&gt; page.&lt;/p&gt;&#10;&#10;&lt;p&gt;This extension, like the Blog extension released by AheadWorks, is a derivative of the old Lazzymonk Blog extension that was popular in 2009 before development by its original author ceased. We feel our extension will benefit from using a standard open source license and from an open development model that encourages community contributions. The extension has been published on &lt;a href="https://github.com/fontis/fontis_blog"&gt;GitHub&lt;/a&gt; under the Open Source License v3, and we welcome any contributions from the wider Magento developer community.&lt;/p&gt;&#10;&#10;&lt;p&gt;Listing on Magento Connect will follow soon, and we'll update this post once a Magento package is available through this channel.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>M2M Sync compatibility with MYOB 2011/2012 and 2013</title><link>https://fontis.au/blog/m2m-sync-2011-2012-2013-compatibility/</link><pubDate>Thu, 21 Mar 2013 23:20:02 +0000</pubDate><guid>https://fontis.au/blog/m2m-sync-2011-2012-2013-compatibility/</guid><description>While MYOB continues to extend its products into the cloud, it has created some confusion surrounding our M2M Sync software and support for the latest releases of the MYOB product line. In summary, M2M Sync is compatible with the AccountRight version 19 products, which are still supported by MYOB at this time. It is not compatible with the AccountRight 2011/2012 or 2013 products. However, please note that any current AccountRight subscription also includes access to the compatible version 19 software, so this may be installed instead for use with M2M Sync.</description></item><item><title>Move Magento Private Files Outside the Docroot</title><link>https://fontis.au/blog/move-magento-private-files-outside-the-docroot/</link><pubDate>Fri, 23 Nov 2012 07:31:52 +0000</pubDate><guid>https://fontis.au/blog/move-magento-private-files-outside-the-docroot/</guid><description>&lt;div class="postContent std"&gt;&lt;p class="lead"&gt;This week saw the inaugural &lt;a href="http://www.clickfrenzy.com.au"&gt;Click Frenzy&lt;/a&gt; sale generate a huge amount of interest in Australian eCommerce, and we are proud to have been the developer responsible for delivering the website for the event based on a Magento platform.&lt;/p&gt;&#10;&#10;&lt;p&gt;The site stood up well after a challenging start on Tuesday evening, but there was a configuration issue with the webserver environment at one point which left a number of private application files exposed for some time. During this period the Magento directory was inadvertently left with directory listings on and without private directories and their contents protected from access. These private files being accessible did not result in a security breach of any kind, and there was never any sensitive personal data stored on any of the website's servers, but the cause of the disclosure does highlight a risk of Magento’s design. Currently, the entire application is designed to be located in the webserver’s document root (docroot). To address this risk and eliminate the possibility of a misconfiguration having this effect, the Magento application needs to be restructured to make it possible to relocate most parts outside of the docroot. This is an approach we’ll be adopting in future and which we document in this post. We also include an accompanying &lt;a href="#patch"&gt;patch&lt;/a&gt; that we are releasing to the Magento community.&lt;/p&gt;&#10;&#10;&lt;p&gt;So, what happened? The issue stemmed from a fundamental aspect of Magento’s design, where the entire application is intended to be located within the webserver’s document root. Part of Magento’s success and broad installed base can be attributed to the wide availability of LAMP hosting services, and this design does allow for an easier installation on shared hosts and environments where custom configuration is not possible - just unpack the files and get started with the web-based installer. It ships with a number of Apache .htaccess files included which are designed to disable access to sensitive directories. However, should the Apache webserver be misconfigured in such a way that directory listings are enabled and/or the files intended to disable access are ignored (&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Options&lt;/span&gt; &lt;span class="nx"&gt;Indexes&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;AllowOverride&lt;/span&gt; &lt;span class="nx"&gt;None&lt;/span&gt;&lt;/code&gt;), the contents of the entire application are then at risk of being disclosed. It is worth noting that this design is the current state of both of the latest official Magento Community Edition and Enterprise Edition releases (version 1.7.0.2 and 1.12.0.2 respectively). &lt;a href="https://github.com/magento/magento2"&gt;Magento 2&lt;/a&gt; versions published on github so far don’t appear to indicate this will be changed significantly for the next major release.&lt;/p&gt;&#10;&#10;&lt;p&gt;An alternative design adopted by many other popular web applications and frameworks is to separate as much of the private application files from the public content as possible. The private files are moved to a location outside the docroot. Such a design protects against any server misconfiguration since it doesn't rely upon placing blocks on certain paths - the private parts of the application exist in a location from which the webserver won’t directly serve files. Some other examples from the Open Source MVC PHP world that have already adopted this approach spring to mind:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;&lt;a href="http://laravel.com"&gt;Laravel&lt;/a&gt; - includes a "public" directory, which ships containing only:&lt;/li&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;a single .htaccess file to handle rewrites&#10; &lt;li&gt;index.php to bootstrap the application&#10; &lt;li&gt;subdirectories for css, js, images and the default information pages&#10; &lt;li&gt;favicon.ico&#10; &lt;li&gt;plus a location for laravel plugin’s assets&#10; &lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&#10; &lt;li&gt;&lt;a href="http://fuelphp.com"&gt;Fuel PHP&lt;/a&gt; - includes a "public" directory, containing:&lt;/li&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;a single .htaccess file to handle rewrites&lt;/li&gt;&#10; &lt;li&gt;index.php for bootstrapping and routing&lt;/li&gt;&#10; &lt;li&gt;an "assets" folder for images,css and js&lt;/li&gt;&#10; &lt;/ul&gt;&#10; &lt;li&gt;&lt;a href="http://cakephp.org"&gt;CakePHP&lt;/a&gt; - includes a "webroot" folder, containing:&lt;/li&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;a single .htaccess file to handle rewrites&lt;/li&gt;&#10; &lt;li&gt;subdirectories for css, js, images and a files folder for publicly downloadable content&lt;/li&gt;&#10; &lt;li&gt;index.php and test.php used to bootstrap the application from its protected location&lt;/li&gt;&#10; &lt;li&gt;favicon.ico&lt;/li&gt;&#10; &lt;/ul&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;While catering to “lowest common denominator” hosting may have done wonders for Magento’s initial adoption, when configuring a customised Magento installation and hosting environment, we feel the risks presented by the monolithic directory structure outweigh any of the potential benefits. Therefore it is worthwhile restructuring and modifying Magento to allow for the application files to be moved. Using &lt;a href="http://www.mageplus.org"&gt;Mage+&lt;/a&gt; (e61ac08729) as a base, our approach moves the contents of the following directories outside of the document root:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;lib&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;pkginfo&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;shell&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;We also move files such as cron.sh, install.php and mage, while we leave the directories js, media, skin, downloader and of course the index.php file public. There are a number of other, lesser used files such as get.php and api.php that we leave public too.&lt;/p&gt;&#10;&#10;&lt;p&gt;Our changes to get.php and api.php have not yet been exhaustively tested, however we would question whether the get.php file functions correctly in recent releases and whether it is safe to be used in a production environment. We wonder whether anyone actually uses this this feature though (leave a comment and let us know if you do). The api.php file is designed to improve the speed of API calls by using a light Magento stack to service the request. However, there appears to be an issue in the latest release where the WSDL includes an incorrect URL, which renders the SOAP API useless when you're using this method regardless of our changes. Making a request to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="nx"&gt;wsdl&lt;/span&gt;&lt;/code&gt; and using the SOAP API as normal still functions correctly and has been tested with the changes.&lt;/p&gt;&#10;&#10;&lt;a name="patch"&gt;&lt;/a&gt;&lt;h2&gt;Restructuring&lt;/h2&gt;&#10;&#10;&lt;p&gt;To set up Mage+ or Magento to use our new, safer structure with an existing Magento installation, there are a few manual file changes required before applying our &lt;a href="https://fontis.au/media/files/filestructure.patch"&gt;patch&lt;/a&gt;. It goes without saying that changes like these should always be tested on a development version of a site first, and that backups of all files and the databases should be taken prior to making any changes of this magnitude and scope.&lt;/p&gt;&#10;&#10;&lt;p&gt;The first step is to create a new directory in the root of the magento folder called ‘public’. This directory will become the docroot of the magento installation, so that everything inside it will be public, and everything outside it will be private. Next, move the following files and folders into this new public directory:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;downloader&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;skin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;htaccess&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;htaccess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sample&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;cron&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;favicon&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ico&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;get&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sample&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;The resulting file structure should look something like the following:&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/filetree.png" class="img-responsive" alt="file structure" /&gt;&#10;&#10;&lt;p&gt;Now that the basic file structure is in place, the &lt;patch&gt; can be applied. This patch will modify a number of core files in Magento which control how the application interacts with its filesystem. The following files will be modified by the patch, so if you have made any local changes or overrides to them, you may need to apply these changes manually:&lt;/patch&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Options&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Install&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;cron&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;get&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Finally, we’ve deleted the .htaccess files in the app, downloader, includes, lib, pkginfo, shell and var directories, since they should now be located outside the docroot and are not required.&lt;/p&gt;&#10;&#10;&lt;p&gt;Once all of the above changes have been made, the webserver configuration should be updated so that the site’s docroot is magento/public rather than magento. We’re still working on the patch and conducting further testing with Mage+, and would welcome any feedback or improvements.&lt;/p&gt;&#10;&#10;&lt;p&gt;With these changes in place, we can rest easy knowing that as long as our docroot is correctly set to the public directory, the rest of our application files will be safe from access in the event of a configuration error - something we don’t intend to get caught out by again! There aren’t many reasons not to adopt this change, so we’d strongly recommend other Magento users consider whether it might also be appropriate for their installation.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Fontis Westpac 2.1.5: Important Update</title><link>https://fontis.au/blog/fontis-westpac-215-important-update/</link><pubDate>Sun, 04 Nov 2012 23:29:15 +0000</pubDate><guid>https://fontis.au/blog/fontis-westpac-215-important-update/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We have just released an important update to the Fontis Westpac extension, which should be installed by all merchants using the PayWay service. The update includes a new Verisign certificate for the PayWay gateway which will be required in order to continue connecting to the gateway. Merchants who will be affected by this update should have already been contacted by Westpac.&lt;/p&gt;&#10;&#10;&lt;p&gt;In addition, we have added another small but often requested feature, and added in a credit card type selection box to the PayWay and QuickGateway settings pages in the Magento configuration. Merchants will now be able to easily configure whether they want to accept American Express, Discover and others.&lt;/p&gt;&#10;&#10;&lt;p&gt;The latest version of the extension can be downloaded from our website at the &lt;a href="https://github.com/fontis/fontis_westpac"&gt;Fontis Westpac&lt;/a&gt;, through &lt;a href="http://www.magentocommerce.com/magento-connect/fontis-westpac-payway-and-quickgateway.html"&gt;Magento Connect&lt;/a&gt; or on &lt;a href="https://github.com/fontis/fontis_westpac/"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>RMA Feature Overview</title><link>https://fontis.au/blog/rma-feature-overview/</link><pubDate>Tue, 28 Aug 2012 00:05:19 +0000</pubDate><guid>https://fontis.au/blog/rma-feature-overview/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Since version 1.11, Magento Enterprise Edition releases have included a &lt;abbr title="return merchandise authorisation"&gt;RMA&lt;/abbr&gt; feature to help manage this process. The system supports tracking requests from when they are first created by a customer, all the way through to resolution. This post will look at how to set up and administer RMA requests from the admin panel, and will also detail a few shortcomings that will hopefully be improved in future releases.&lt;/p&gt;&#10;&#10;&lt;h2&gt;How to set up the Magento Enterprise RMA system&lt;/h2&gt;&#10;&lt;p&gt;Firstly, you need to customise the System Configuration settings:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;&lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;RMA Settings&lt;/i&gt;&#10; &lt;ul&gt;&#10; &lt;li&gt;&lt;i&gt;Enable RMA on Frontend&lt;/i&gt;&#10; &lt;p&gt;If this is set to Yes, all of the RMA functionality is displayed in the frontend. This includes a link on the view order screen of the my account and also the entry in the main my account navigation menu&lt;/p&gt;&lt;/li&gt;&#10; &lt;li&gt;&lt;i&gt;Enable RMA on Product Level&lt;/i&gt;&#10; &lt;p&gt;The name of this setting could be slightly confusing. What this actually configures is the &lt;strong&gt;default&lt;/strong&gt; setting for if an individual product is available for RMA. On the manage product screen, there is a new attribute called Enable RMA and when this is set to 'Use Config' on an individual product (which is the default) then this setting is used to determine if the product is available for RMA or not.&lt;/p&gt;&lt;/li&gt;&#10; &lt;li&gt;&lt;i&gt;Use Store Address&lt;/i&gt;&#10; &lt;p&gt;This setting is for controlling the address that a customer is directed to return their products to when their RMA request is authorised. If set to Yes, the store address configured at System &amp;rarr; Configuration &amp;rarr; Store Information is used. If set to No, a new set of settings is displayed which allows a new return address to be entered&lt;/p&gt;&lt;/li&gt;&#10; &lt;/ul&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;i&gt;Sales &amp;rarr; Sales Emails&lt;/i&gt;&#10; &lt;p&gt;There are four new sales emails that need to be configured: RMA, RMA Authorization, RMA Admin Comments and RMA Customer Comments. These are all standard transactional email settings so can be configured in the same way as the other transactional emails, such as those for orders and shipments. Customising the transactional email templates can be done by navigating to System &amp;rarr; Transactional Emails and either creating or editing the templates there.&lt;/p&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Once these configuration settings have been updated, go to &lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;RMA&lt;/i&gt; &amp;rarr; &lt;i&gt;Manage RMA Items Attributes&lt;/i&gt; to configure the fields that are used on a per-item basis. There are 4 default form attributes that can be configured, and like all Magento attribute management screens, it's possible to add new attributes to the items as well. When adding a new attribute or updating an existing one, you'll be presented with a form like the following one:&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/new-attribute-form.png" class="img-responsive" alt="Create new attribute form" /&gt;&#10;&#10;&lt;p&gt;Depending on the input type (the screenshot above was from a Dropdown attribute) the fields in the attribute properties fieldset will change. The Values Required field is shown for every attribute type. As you would expect, this controls if an attribute is required. However, this is only used when the attribute is placed in the form for the customer to fill in. In other words, regardless of this setting, the attribute will always be optional when accessing the RMA through the administration panel.&lt;/p&gt;&#10;&#10;&lt;p&gt;The second fieldset, &lt;i&gt;Frontend Properties&lt;/i&gt; allows you to show or hide the field on the frontend using the &lt;i&gt;Show on Frontend&lt;/i&gt; property. You can also adjust the order the fields appear in using the &lt;i&gt;Sort Order&lt;/i&gt; property. The third property, &lt;i&gt;Forms to Use In&lt;/i&gt;, will always have just the &lt;i&gt;Default EAV Form&lt;/i&gt; value available. This value should always be selected, regardless of any other settings.&lt;/p&gt;&#10;&#10;&lt;p&gt;In EE 1.11, even though you can create new attributes for the RMA items, neither the administration interface nor the frontend interface handles them as you might expect. The frontend interface will allow custom fields to be added to the create new RMA form, however these will not be shown in the view RMA screen regardless of your settings. In addition, while you can stop the data being shown for a particular default attribute on the frontend, it's impossible to stop the column being displayed on the view RMA screen, without editing your template files (changing these files is beyond the scope of this post).&lt;/p&gt;&#10;&#10;&lt;p&gt;Similarly, the administration interface also suffers from a lack of flexibility as it's impossible to change the attributes that are displayed in the administration form, again without editing the template files. No new attributes can be shown, and there's no way to hide the default attributes. This means that if a new attribute is created and set to display on the frontend, a customer will see and have the opportunity to fill in the form, but that field will not be visible through the administration interface. Furthermore, if an attribute is created with Show on Frontend set to No, the attribute simply won't be visible anywhere.&lt;/p&gt;&#10;&#10;&lt;p&gt;However, EE 1.12 has thankfully seen one of these shortcomings addressed. If you have created custom attributes for your return items, these are now visible both in the frontend and the backend by clicking the &lt;i&gt;details&lt;/i&gt; link displayed with the item.&lt;/p&gt;&#10;&#10;&lt;p&gt;Because of the above, using only the default attributes is recommended with version 1.11, and the following list details these four default attributes and their intended usage.&lt;/p&gt;&#10;&#10;&lt;table&gt;&lt;tbody&gt;&#10;&lt;tr&gt;&#10; &lt;td valign="top" width="10%"&gt;&lt;i&gt;Resolution&lt;/i&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;p&gt;This field is used for the manner in which the RMA request was resolved, for example Exchange or Store Credit.&lt;/p&gt;&#10; &lt;p&gt;Ideally, this field will not be displayed on the RMA request form, but will be displayed on the view RMA screen, after the RMA has been created. Unfortunately, this cannot be done without significant modification to the template files.&lt;/p&gt;&#10; &lt;p&gt;The best compromise is to change the frontend label of this attribute to something like "Ideal Resolution", but leave the Admin label as Resolution. This will change the caption on the field in the create RMA form to be "Ideal Resolution" but will leave the label in the administration interface and the view RMA page as just Resolution. This is because the administration interface has its own label, and the view RMA page has the name of the field hard coded into the template file.&lt;/p&gt;&#10; &lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td valign="top" width="10%"&gt;&lt;i&gt;Item Condition&lt;/i&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;p&gt;Depending on the specific store requirements, this field can be used for either the condition that the item was received in, or the condition that the item is being returned in.&lt;/p&gt;&#10; &lt;p&gt;Personalising the possible values for this field to match the stores requirements is recommended, as the default values are somewhat ambiguous.&lt;/p&gt;&#10; &lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td valign="top" width="10%"&gt;&lt;i&gt;Reason&lt;/i&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;p&gt;This attribute is used to show why an RMA has been requested. Default values include Wrong Colour, Wrong Size and Out of Service. Again, it's important to update these possible values to match the requirements of your store.&lt;/p&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td valign="top" width="10%"&gt;&lt;i&gt;Other&lt;/i&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;p&gt;In the event that a customer selects 'Other' for the Reason attribute above, this field will be automatically displayed. It's a text field and allows the customer to enter a custom reason for the product being returned.&lt;/p&gt;&#10; &lt;p&gt;It's not possible to remove this Other option from the Reason attribute without significant modifications to template and script files.&lt;/p&gt;&#10; &lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&lt;/table&gt;&#10;&#10;&lt;p&gt;If you do need to have further attributes added in then you will need to have a Magento developer make modifications to the system for you to accommodate them.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Usage&lt;/h2&gt;&#10;&lt;h3&gt;Creating an RMA Request as a Registered Customer&lt;/h3&gt;&#10;&lt;p&gt;Once an order has been completed, a new link titled 'return' is added to the view order screen in the my account area. When a customer clicks this link they are presented with the following form:&lt;p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/new-return-form.png" class="img-responsive" alt="Create new return form" /&gt;&#10;&#10;&lt;p&gt;When the customer submits this form, an email is sent to the address that was set up in the Sales Emails section and the RMA request is created and visible in the &lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;RMA&lt;/i&gt; &amp;rarr; &lt;i&gt;Manage RMA&lt;/i&gt; section of the administration panel.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Creating an RMA Request as a Guest&lt;/h3&gt;&#10;&lt;p&gt;If a customer wants to create an RMA request for an order they placed as a guest, they need to fill in the following form, which can be found at http://&amp;lt;yoursite&amp;gt;/sales/guest/form:&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/guest-login-form.png" class="img-responsive" alt="Guest login form" /&gt;&#10;&#10;&lt;p&gt;When this form is filled in and the order is found, the interface that's shown is a copy of the customer account view order interface, but accessible by guest customers and showing the guest customer order details. This is a highly useful and yet less well known interface that all Magento EE stores can make use of. This interface then allows guest customers to create RMA requests in the same way as logged in customers.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Creating an RMA Request Through the Administration Interface&lt;/h3&gt;&#10;&lt;p&gt;As well as customers being able to create RMA Requests, store administrators can create RMA requests for orders. To do this, go to &lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;RMA&lt;/i&gt; &amp;rarr; &lt;i&gt;Manage RMA&lt;/i&gt; and then click the &lt;i&gt;New RMA Request&lt;/i&gt; button.&lt;/p&gt;&#10;&#10;&lt;p&gt;The first screen that's displayed allows an order to be selected. This is a standard Magento grid interface, and can be interacted with in the same way as other grids. Once the order is selected, a manage form with two tabs is displayed. The first, &lt;i&gt;General Information&lt;/i&gt;, shows details of the customer that the request is for. The second tab, &lt;i&gt;RMA Items&lt;/i&gt; shows each of the items that will be RMA'd. Any number of products can be added to a single request, so it's not necessary to make a single request per product that is going to be RMA'd.&lt;/p&gt;&#10;&#10;&lt;p&gt;Once the products have been added to the request, press the &lt;i&gt;Submit RMA&lt;/i&gt; button on the &lt;i&gt;General Information&lt;/i&gt; tab to create the RMA Request.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Managing an RMA Request&lt;/h3&gt;&#10;&lt;p&gt;Once the RMA request has been created, store administrators can view and update it in the &lt;i&gt;Sales&lt;/i&gt; &amp;rarr; &lt;i&gt;RMA&lt;/i&gt; &amp;rarr; &lt;i&gt;Manage RMA&lt;/i&gt; section of the administration panel. Every RMA request has a status assigned to it, which works in much the same way as the status that appears on an order. When a request is created it will initially be in the &lt;b&gt;Pending&lt;/b&gt; state.&lt;/p&gt;&#10;&#10;&lt;p&gt;When an item is in this pending state, store administrators can authorise or deny the request by changing the status dropdown of the item. If there is more than one item in the request, some items can be authorised while others can be denied. A customer can also request to return more than one of an item. There is an authorised quantity field, which should be filled in at this step, that is used to display the number of items that the customer has been authorised to return.&lt;/p&gt;&#10;&#10;&lt;p&gt;Once a request has been authorised, its status changes to &lt;b&gt;Authorized&lt;/b&gt;. The customer is sent an email to let them know which products have been authorised and they can then send the items back to the store.&lt;/p&gt;&#10;&#10;&lt;p&gt;When the returned items are received, the store administrator should change the status of the request to be Return Recieved and should also fill in the quantity of items that were received.&lt;/p&gt;&#10;&#10;&lt;p&gt;Finally, when the product has been received and assessed, the request can either be &lt;b&gt;Approved&lt;/b&gt; or &lt;b&gt;Rejected&lt;/b&gt;. Once the request is approved, the administrator must manually do the resolve action for the request. This is one area where the system could be improved in future versions to streamline the case of refund or store credit.&lt;/p&gt;&#10;&#10;&lt;p&gt;When all products in the request are either Approved, Rejected or Denied, the request will be completed.&lt;/p&gt;&#10;&#10;&lt;p&gt;The RMA feature is a welcome addition to the Magento Enterprise Edition, and provides a structured way of managing RMA requests within your Magento website. There are a few areas that could be more flexible or streamlined, but overall the system is sound and can help provide a more transparent, organised and efficient way of managing the returns process.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>MageAudit: The Magento Health Check</title><link>https://fontis.au/blog/mageaudit-the-magento-health-check/</link><pubDate>Tue, 22 May 2012 08:28:25 +0000</pubDate><guid>https://fontis.au/blog/mageaudit-the-magento-health-check/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;A successful Magento implementation requires not only development expertise and an understanding of its internals and various settings, but also systems administration knowledge to ensure that the hosting environment is configured correctly and for optimal performance. As a store owner or developer who may not be familiar with all of these areas themselves, it can therefore be difficult to check on the overall quality of a particular installation. How can the relative “health” of a Magento store be quickly and easily assessed? Introducing &lt;a href="http://www.fontis.com.au/mageaudit/"&gt;MageAudit, the Magento Health Check&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;We've set out to provide a solution to assist both users and developers in detecting common misconfigurations, incompatibilities, and other sources of potential Magento headaches. Unfortunately, we see problematic installations suffering from many of these issues on a daily basis, and hope that by sharing our expertise through MageAudit, we can help more of the community improve the quality of their sites.&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/mageaudit.png" class="img-responsive" alt="MageAudit report" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;MageAudit couldn't be easier to run, just download our audit script and upload to your server; it should run anywhere Magento 1.1+ does. Once uploaded, access the script in your browser, and after submitting you will be directed to the MageAudit site to see your overall grade. For the low fee of just $49 USD, you can then unlock the report to access extended result details complete with information on how each check works along with suggestions on how to resolve any issues found. Compared to the cost of having one or more independent developers (or even the Magento Expert Consulting Group) perform a similar set of basic checks which may take many days to complete, it's easy to see how MageAudit represents excellent value.&lt;/p&gt;&#10;&#10;&lt;p&gt;To conduct the audit, the service collects several different pieces of information from your site - namely Magento settings, extensions installed, file hashes, software versions, and basic server configuration details. We do not collect any logins, passwords, customer details, sales data, credit cards or any other sensitive information from your site, and we will not share the limited identifiable data that we do collect with anyone. In addition, all data transferred back to our servers is fully encrypted.&lt;/p&gt;&#10;&#10;&lt;p&gt;The documentation and checks included in MageAudit have been developed through our first-hand experience troubleshooting and working with Magento for more than 5 years, as well as incorporating established best practices from resources such as the official Magento performance whitepaper. We currently conduct 25 tests over 6 categories, with plans to add many in future.&lt;/p&gt;&#10;&#10;&lt;p&gt;With MageAudit, Magento store owners and developers now have access to an on-demand audit tool providing fast and cost effective advice. So is your Magento site healthy? Find out now with &lt;a href="http://www.fontis.com.au/mageaudit/"&gt;MageAudit&lt;/a&gt; – grading your site is quick and free, with no obligation to purchase the full report.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>M2M Sync Now Supports Magento Go</title><link>https://fontis.au/blog/m2m-sync-now-supports-magento-go/</link><pubDate>Tue, 03 Apr 2012 00:50:38 +0000</pubDate><guid>https://fontis.au/blog/m2m-sync-now-supports-magento-go/</guid><description>With its most recent update (version 1.2.10.1), our Magento-MYOB synchronisation application &lt;a href="https://www.fontis.com.au/m2m-magento-myob-sync"&gt;M2M Sync&lt;/a&gt; now supports &lt;a href="http://go.magento.com"&gt;Magento Go&lt;/a&gt;. This hosted Magento solution allows businesses to set up online stores without needing to manage their own server and implementation, and offers an enhanced set of features compared to Magento Community Edition. M2M Sync has been updated to handle these additional features, such as gift card accounts and store credit, and is an ideal solution for MYOB users who are tired of error-prone manual data entry.</description></item><item><title>CMS Page Version Control</title><link>https://fontis.au/blog/cms-page-version-control/</link><pubDate>Fri, 01 Jul 2011 07:13:36 +0000</pubDate><guid>https://fontis.au/blog/cms-page-version-control/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;When editing a CMS page in Magento Enterprise Edition's admin panel, it's easy enough to make a mistake and accidentally remove a section of text or accidentally modify markup which may be a crucial part of the page's layout. While you may have back-ups to handle a situation like this, it can still be a time consuming process to retrieve and then restore the original content. However, using Magento's built-in version control system, you can conveniently restore your page to how it was at any time in the past, and also switch between different versions of a page with ease. In this post, we'll explain how this feature works and why you should use it.&lt;/p&gt;&#10;&#10;&lt;h2&gt;How It Works&lt;/h2&gt;&#10;&#10;&lt;p&gt;Version control is available for any CMS page in Magento Enterprise Edition (v1.8 and above). When version control is activated for a CMS page, an automatic backup is made every time that page is edited. These backups (called &lt;em&gt;revisions&lt;/em&gt;) are organised by Magento, and are retained indefinitely, meaning the page can be reverted instantly to how it was at any time in the past. You can also maintain alternate &lt;em&gt;versions&lt;/em&gt; of a page (seasonal variations, for example), and switch between them at any time.&lt;/p&gt;&#10;&#10;&lt;p&gt;Version control was added to Magento's CMS feature set in version 1.8, and being a relatively new feature it is one that many users may not be aware of yet. If you're used to Magento's standard CMS page editor, activating version control can be intimidating at first — the familiar "Content" and "Design" tabs are removed, and are replaced with a "Versions" tab with little explanation of what to do next. However, while it's true that activating version control will mean a few extra steps when updating your CMS pages, the benefits when managing complex changes can make it well worthwhile.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Setting Up Version Control for a CMS Page&lt;/h2&gt;&#10;&#10;&lt;p&gt;For this example, we'll be using a standard installation of Magento Enterprise Edition. We'll activate version control for the &lt;em&gt;About Us&lt;/em&gt; page, and then create a second version, where we'll change the main image on the page. We can then switch between these two versions instantly.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Preparation&lt;/h3&gt;&#10;&#10;&lt;p&gt;In Magento's admin panel, go to &lt;em&gt;CMS&lt;/em&gt; &gt; &lt;em&gt;Pages&lt;/em&gt; &gt; &lt;em&gt;Manage Content&lt;/em&gt;, and click on the &lt;em&gt;About Us&lt;/em&gt; page. This brings up the Edit Page screen, where we can change the &lt;em&gt;Under Version Control&lt;/em&gt; option to &lt;em&gt;Yes&lt;/em&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/01.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/01-small-options.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;Note that the &lt;em&gt;Content&lt;/em&gt;, &lt;em&gt;Design&lt;/em&gt;, and &lt;em&gt;Meta Data&lt;/em&gt; tabs to the left have now been replaced with a new &lt;em&gt;Versions&lt;/em&gt; tab.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/01.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/01-small-tabs.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;The &lt;em&gt;Versions&lt;/em&gt; tab shows the different versions of the page.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/02.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/02-small.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&#10;&lt;h3&gt;Versions and Revisions&lt;/h3&gt;&#10;&#10;&lt;p&gt;While a &lt;em&gt;version&lt;/em&gt; of a page is manually created by the administrator, a new &lt;em&gt;revision&lt;/em&gt; is automatically created every time the page is modified. You can use &lt;em&gt;versions&lt;/em&gt; if you are maintaining a page that has a number of significantly different variations, which you may need to switch between. On the other hand, &lt;em&gt;revisions&lt;/em&gt; are mainly used to revert the page to how it was at an earlier date, if a mistake is made while updating the page. In our About Us page example, we'll create a new version with a different image.&lt;/p&gt;&#10;&#10;&lt;p&gt;Clicking on one of the entries on the &lt;em&gt;Versions&lt;/em&gt; tab will show the list of revisions for this version.&lt;/p&gt;&#10;&#10;&lt;p&gt;At this point, the only version of this page has a version name of &lt;em&gt;About Us&lt;/em&gt;, because the version name is copied from the page name by default. This name isn't shown to visitors, so it's a good idea to give it a more descriptive name that will help you remember what it's for. In our example, we'll call this version &lt;em&gt;Original&lt;/em&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/03.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/03-small.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;h3&gt;Editing the Page&lt;/h3&gt;&#10;&#10;&lt;p&gt;Click on a revision to bring up the familiar CMS page editor. The editor shows you the name of the version, as well as the revision number that you're editing.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/04.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/04-small.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;We'll turn off the WYSIWYG editor, and change the image by finding the line that reads:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Varien&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;{;{;skin url=&amp;#39;images/media/about_us_img.jpg&amp;#39;};};&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Varien&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;and changing it to this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Varien&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;{;{;skin url=&amp;#39;images/media/col_left_callout.jpg&amp;#39;};};&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Varien&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;h3&gt;Saving Changes&lt;/h3&gt;&#10;&#10;&lt;p&gt;Even though the editor says we're editing "Revision #1", if we click "&lt;strong&gt;Save&lt;/strong&gt;", revision 1 won't be modified at all. Instead, Magento automatically creates a new revision (Revision #2) with our changes. This is the principle idea of version control - no data is lost with each change.&lt;/p&gt;&#10;&#10;&lt;p&gt;However, as we're making a fairly major change to this page, we want to create a new &lt;em&gt;version&lt;/em&gt;, and not just a new &lt;em&gt;revision&lt;/em&gt; in this version. We can quickly do this using the "&lt;strong&gt;Save in New Version&lt;/strong&gt;" button, which will prompt us for a name for the new version. As the name entered here won't be shown to visitors, it should have a descriptive name that will explain what's unique about this version. In our example, because this version has a different image, we'll call it &lt;em&gt;Alternate Image&lt;/em&gt;.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Publishing&lt;/h3&gt;&#10;&#10;&lt;p&gt;After choosing "&lt;strong&gt;Save in New Version&lt;/strong&gt;", we remain in the editor, and the page on the frontend hasn't been updated with our changes. Although the new "Version" has been saved, it still needs to be published before it's shown on the frontend. Clicking the "&lt;strong&gt;Publish&lt;/strong&gt;" button will publish the page immediately (if there's any changes since the last save, this button will read "&lt;strong&gt;Save and Publish&lt;/strong&gt;", which will create a new revision and publish at once).&lt;/p&gt;&#10;&#10;&lt;p&gt;After publishing the page, we are taken all the way back to the main &lt;em&gt;Edit Page&lt;/em&gt; screen. The &lt;em&gt;Currently Published Revision&lt;/em&gt; is now our &lt;em&gt;Alternate Image&lt;/em&gt; version, at revision 1. This link is a handy shortcut that jumps straight back to the editor.&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/05.png" alt="" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;We can now view the page on the frontend, which will have our new image.&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/00-before.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/00-before-small.png" alt="" /&gt;&#10; &lt;/a&gt;&#10; &lt;a title="Click for full version" href="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/00-after.png"&gt;&#10; &lt;img src="https://fontis.au/media/wysiwyg/blog/magento-cms-page-version-control/00-after-small.png" alt="" /&gt;&#10; &lt;/a&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;h2&gt;Recovering From Disaster&lt;/h2&gt;&#10;&#10;&lt;p&gt;Let's say I was editing the page, and I accidentally deleted a paragraph while I was changing the image. I didn't notice initially, so I saved it and published it, and then I saw the missing text on the frontend. I can't remember what the text said, so normally I'd have to hope that I've got a backup somewhere.&lt;/p&gt;&#10;&#10;&lt;p&gt;However, because the page was under version control, I can just publish the "Original" version to restore the page to exactly how it was before I made my changes. Then, I'll delete the &lt;em&gt;Alternate Image&lt;/em&gt; version, make my changes again as above (more carefully this time!), and finally publish the correct version.&lt;/p&gt;&#10;&#10;&lt;p&gt;Although it takes some getting used to and adds a few steps to the process of updating CMS page content, Magento's version control for CMS pages is incredibly useful. After taking the time to learn how it works, you may find it actually saves you time overall. After all, no matter how careful we are when editing important pages, we all make mistakes!&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Manage Customer Attributes</title><link>https://fontis.au/blog/manage-customer-attributes/</link><pubDate>Tue, 12 Oct 2010 01:02:22 +0000</pubDate><guid>https://fontis.au/blog/manage-customer-attributes/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;From the start Magento has included the ability to modify product attributes through an interface in the administration panel. With Enterprise Edition 1.9, you can now manage customer attributes through a similar interface. This article will show you how to use this interface, as well as show you what this interface can and can't do.&lt;/p&gt;&#10;&#10;&lt;p&gt;The most useful feature that this interface provides is the ability to create brand new customer attributes and then define where in the site these attributes should be shown. To create a new attribute, go to &lt;i&gt;Customers &amp;rarr; Attributes &amp;rarr; Manage Customer Attributes&lt;/i&gt;. The &lt;i&gt;Customers &amp;rarr; Attributes &amp;rarr; Manage Customer Address Attributes&lt;/i&gt; screen works in the same way, but on customer addresses rather than customers. From this screen you can either select one of the existing attributes to edit or you can click on the &lt;i&gt;Add New Attribute&lt;/i&gt; button to create a new attribute. You will see the following screen:&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/customer-attribute-edit.png" class="img-responsive" alt="Screenshot of the customer attribute edit interface" /&gt;&#10;&#10;&lt;p&gt;At this point, we come to the first restriction of this interface: you cannot modify all of the options for the built-in attributes. Most of the unchangeable options make sense to lock, however there are some options, for example the sort order, that I feel should be editable. Furthermore, not all of the built-in attributes are in this list. One attribute you cannot change is the region_id attribute. This is the attribute that has a list of the available states. Magento doesn't come with Australian states by default and even with this feature you cannot add them. We recommend using &lt;a href="https://github.com/fontis/fontis_australia"&gt;our Australia extension&lt;/a&gt; to add this functionality as well as a number of other Australia-related improvements.&lt;/p&gt;&#10;&#10;&lt;h3&gt;The Input/Output Filter&lt;/h3&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/customer-attribute-filter.png" class="img-responsive" alt="Screenshot of the input and output filter control" /&gt;&#10;&#10;&lt;p&gt;If you have used the manage product attribute interface at all, these manage customer attribute screens should be completely familiar. However, there are a few new options on an attribute that are new and need explanation. The &lt;i&gt;Input/Output Filter&lt;/i&gt; is a useful option. This allows you to set a filter on the text that the customer enters. Given that anybody who signs up to your site can enter text into this field, I recommend setting this to something other than &lt;i&gt;None&lt;/i&gt;. If set to none the text the customer enters will be output verbatim; if a customer was to enter HTML code it would be output on the frontend and rendered by the browser, possibly hijacking the user's browser - either by redirecting to a new page or by putting harmful, invisible code into the page.&lt;/p&gt;&#10;&#10;&lt;p&gt;Setting the option to one of the other two options is by far safer; setting it to &lt;i&gt;Strip HTML Tags&lt;/i&gt; will remove any HTML code from the input, whereas setting the option to &lt;i&gt;Escape HTML Entities&lt;/i&gt; will display the HTML code as text rather than rendering it.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Use in Customer Segment&lt;/h3&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/customer-attribute-segment.png" class="img-responsive" alt="Screenshot of the customer segment control" /&gt;&#10;&#10;&lt;p&gt;Customer segments are another Magento Enterprise-only feature and while they are beyond the scope of this article, they add the ability to sort your customers based on various attributes for use in things like reporting and marketing. Setting the &lt;i&gt;Use in Customer Segment&lt;/i&gt; option to &lt;i&gt;Yes&lt;/i&gt;, allows you to also use this attribute in automatically filtering customers into segments.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Forms to Use In&lt;/h3&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/customer-attribute-forms.png" class="img-responsive" alt="Screenshot of the forms to use in control" /&gt;&#10;&#10;&lt;p&gt;This option is used to set where in the site the attribute will be used. The first three options - &lt;i&gt;Customer Checkout Register&lt;/i&gt;, &lt;i&gt;Customer Registration&lt;/i&gt; and &lt;i&gt;Customer Account Edit&lt;/i&gt; - are quite self-explanatory. The fourth and final option is the &lt;i&gt;Admin Checkout&lt;/i&gt; option which will allow you to show or hide the option in the create new customer form &lt;b&gt;when you are creating a new order&lt;/b&gt; in the admin panel. Unfortunately there is no option for &lt;i&gt;Admin Customer Creation&lt;/i&gt; so this attribute will always show up in the create new customer form in the admin panel.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Attribute Visibility&lt;/h3&gt;&#10;&#10;&lt;p&gt;Here we run into a possible drawback - there is no way to set an attribute to be invisible. While this is not necessarily a show-stopping problem it could be frustrating if you need this functionality. In previous versions of Magento there was a flag you could set to make an attribute invisible but this flag is not present in Enterprise Edition 1.9 so there is no way to hide an attribute from the customer create and edit screens.&lt;/p&gt;&#10;&#10;&lt;p&gt;While Magento's flexible attribute system has always allowed for the inclusion of additional customer attributes, this interface for the administration panel makes this achievable without needing to extend the core system through code. The system is still new but overall it is easy to use and shows off the power of Magento's attribute system.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>(Re)sending Magento order emails</title><link>https://fontis.au/blog/resending-magento-order-emails/</link><pubDate>Fri, 01 Oct 2010 07:02:31 +0000</pubDate><guid>https://fontis.au/blog/resending-magento-order-emails/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;I recently had a need to resend Magento order confirmation emails for orders placed within a particular time period. Magento provides an interface for resending these emails out of the box (navigate to Sales →; Orders →; Order and click 'Send Email' up in the top right), but this takes 15-20 seconds per order at best. If you have more than a few of these order emails to resend, this approach will quickly become tedious. Luckily, there's an alternative: it is possible to write a Magento script to do the job for you, which I'll explore in this blog post.&lt;/p&gt;&#10;&#10;&lt;p&gt;If, for example, we wanted to resend the order emails for the first 100 orders (e.g. order increments 100000001 through 100000101), we would run something like this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;MAGE_BASE_DIR&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/var/www/magento&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;require_once&lt;/span&gt; &lt;span class="nx"&gt;MAGE_BASE_DIR&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/app/Mage.php&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setCurrentStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage_Core_Model_App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;ADMIN_STORE_ID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000101&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;sales/order&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;sendNewOrderEmail&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; successfully sentn&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Exception&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; not foundn&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The first few lines allow our script access to the Magento environment, which makes it possible to use &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; later on, and take action on the Magento orders:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;MAGE_BASE_DIR&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/var/www/magento&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;require_once&lt;/span&gt; &lt;span class="nx"&gt;MAGE_BASE_DIR&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/app/Mage.php&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setCurrentStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage_Core_Model_App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;ADMIN_STORE_ID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Note: You'll need to update &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;MAGE_BASE_DIR&lt;/span&gt;&lt;/code&gt; to point to your own Magento directory, or the script will fail at &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;Since we know that we just want the first 100 orders, ranging from 100000001 through 100000101, we write it this way. Alternatively, we could combine several sets of order increments like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;array_merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000101&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200000101&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300000101&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, we simply iterate over the list of order increments and retrieve the corresponding order objects, one by one. We also want to print out an error message if the order cannot be found, so that we've got a record of exactly what happened after the script is finished.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sales/order&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; not found&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;If this script was intended to be used more than once, or in an automated process, it would be more appropriate to log errors to file, but for this particular situation, simply echoing any errors is an acceptable option.&lt;/p&gt;&#10;&#10;&lt;p&gt;To determine how to send the order emails, we look at the core modules. In the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;emailAction&lt;/span&gt;&lt;/code&gt; method of &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Adminhtml_Sales_OrderController&lt;/span&gt;&lt;/code&gt;, which is called when you click the "Send Email" button, the $order-&gt;sendNewOrderEmail() method is called to handle emails. Chances are high that we can do the same thing (though in other situations you may need to do some extra initialisation to put your script into the correct state):&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;sendNewOrderEmail&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; successfully sent&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Exception&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;We also record any errors or successes, echoing either result, as we do when the order cannot be found.&lt;/p&gt;&#10;&#10;&lt;p&gt;Finally, we want to avoid filling up the mail queue too quickly, so we'll introduce a short (2-second) delay between each iteration of the script:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The finished script can be run with &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;, and might take something like 2-3 seconds per order to run (including the 2-second delay), and in the absence of any errors, it won't require any manual intervention. Quite an improvement.&lt;/p&gt;&#10;&#10;&lt;p&gt;And that's just one possibility. You could also adjust this script slightly to send other order-related emails. For example, with the following changes, a shipment will be generated for each of the selected orders and shipment notices will be sent to the respective customers:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;MAGE_BASE_DIR&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/var/www/magento&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;require_once&lt;/span&gt; &lt;span class="nx"&gt;MAGE_BASE_DIR&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/app/Mage.php&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setCurrentStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage_Core_Model_App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;ADMIN_STORE_ID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000101&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;In this instance the shipment will be created to contain all of the products, so this particular script can only be run against an order once. Details of the shipment will show up in the Shipments tab of the order screen.&lt;/p&gt;&#10;&#10;&lt;p&gt;Finally, the next variation will generate invoices and send corresponding emails:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;MAGE_BASE_DIR&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/var/www/magento&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;require_once&lt;/span&gt; &lt;span class="nx"&gt;MAGE_BASE_DIR&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/app/Mage.php&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setCurrentStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage_Core_Model_App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;ADMIN_STORE_ID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000101&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrements&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;sales/order&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$invoice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;prepareInvoice&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;register&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setEmailSent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getOrder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setIsInProcess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$transactionSave&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;core/resource_transaction&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getOrder&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$invoice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Invoice generation for order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; was successfuln&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Exception&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Order &lt;/span&gt;&lt;span class="si"&gt;$orderIncrement&lt;/span&gt;&lt;span class="s2"&gt; not foundn&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;These examples demonstrate how you might programatically resend the main transactional emails related to an order, and of course it should be possible to take a similar approach for any other transactional emails that might need to be resent.&lt;/p&gt;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento versions:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4, 1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Big Brown Box wins inaugural ORIA</title><link>https://fontis.au/blog/big-brown-box-wins-inaugural-oria/</link><pubDate>Mon, 12 Jul 2010 05:58:33 +0000</pubDate><guid>https://fontis.au/blog/big-brown-box-wins-inaugural-oria/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Our congratulations to everyone at &lt;a href="http://www.bigbrownbox.com.au"&gt;Big Brown Box&lt;/a&gt;, who were the winners of the inaugural Best Site Design award last week at the &lt;a href="http://www.onlineretailer.net/events/oria10"&gt;Online Retailer Industry Awards 2010&lt;/a&gt;. The awards were extremely competitive and drawn from over 170 nominated online businesses around Australia; the Best Site Design category in particular boasted some of the most innovative online retailers in the Australian market.&lt;/p&gt;&#10;&lt;p&gt;The Big Brown Box website and the key reasons for its win were described by the ORIA judging panel:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;“A site that is simple to use, with minimal clicks per purchase was at the top of the list for Big Brown Box. Simple search refinements, a clear and uncluttered home page and dropdown hover menus make it easy for customers to find exactly what they're looking for. With a wide range of personal and home electronics, the prominent free shipping icon is appealing for customers, and the customer service number and live chat function is further reassurance.&lt;/p&gt;&#10;&lt;p&gt;Offering some of the top electrical goods brands, the site delivers a simple, no fuss shopping experience, offering good prices and secure delivery for those who know what they are looking for. With extra details and specifications available on each product via pop up hover menus, all the information a customer could need is easily accessed via the UI.”&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&#10;&lt;p&gt;Big Brown Box’s eCommerce Manager, Nigel Price, said of the win:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;“The team at Big Brown Box are over the moon with this award. To be recognised by our industry peers for the new site design is fulfilling so much hard work. We spent a lot of time planning the new site and focused on integrating consumer insights gleaned from extensive research. The new design has helped to dramatically simplify the purchase process while maintaining access to key information to help inform consumer decisions before the checkout. So far the response from our customers to the new designs has been excellent – to receive this accolade from the ORIA judges is simply the icing on the cake”.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&#10;&lt;p&gt;Big Brown Box is a subsidiary of &lt;a href="http://www.radiorentals.com.au"&gt;Radio Rentals&lt;/a&gt; (owned by the &lt;a href="http://www.thorn.com.au"&gt;Thorn Group Limited&lt;/a&gt;) who retail a large range of consumer electronics, appliances solely online which allows them to keep costs low by cutting out unnecessary overheads.&lt;/p&gt;&#10;&#10;&lt;p&gt;Fontis is the Magento Solutions Partner for Big Brown Box and has worked closely with the Big Brown Box team to realise their eCommerce vision in the 12 months since the site relaunched on the Magento platform.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Banners and the Banner Rotator Widget</title><link>https://fontis.au/blog/banners-and-banner-rotator-widget/</link><pubDate>Tue, 15 Jun 2010 02:14:39 +0000</pubDate><guid>https://fontis.au/blog/banners-and-banner-rotator-widget/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Banners are a relatively new CMS feature of Magento Enterprise Edition that allow administrators to create, organise and display promotional content. In the past, this requirement was often addressed by manually creating static blocks and customising a site's layout. By using banners and the banner rotator widget, you can now create content and then control exactly how and where it is shown on your site in a much easier way.&lt;/p&gt;&#10;&#10;&lt;h2&gt;Banners&lt;/h2&gt;&#10;&lt;p&gt;Banners are a type of CMS content. Like blocks and pages, at their core they consist of a WYSIWYG text editor field that allows you to enter your own content. Banners differ from the other CMS content types by having additional options that control how and when they are displayed. To create a new banner, go to &lt;i&gt;CMS &amp;rarr; Banners&lt;/i&gt; from the admin panel and click the &lt;i&gt;Add Banner&lt;/i&gt; button.&lt;p&gt;&#10;&#10;&lt;p&gt;The &lt;i&gt;Banner Properties&lt;/i&gt; tab allows you to specify a banner name and set whether the banner is active or not. The &lt;i&gt;Applies To&lt;/i&gt; field is slightly obscurely named and lets you specify which regions on your site the banner will be used in (headers, footers, sidebars, etc). The &lt;i&gt;Customer Segments&lt;/i&gt; option lets you associate a banner with a particular customer segment. Customer segments are defined elsewhere and are out of the scope of this post, but basically define the conditions under which the banner will appear. If you want a banner to only be shown when a customer has more than a certain number of items in their cart, for example, or only for customers from a certain region, you can set up segments to achieve this.&lt;/p&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/banner-properties-small.png" alt="Banner properties tab" /&gt;&#10;&#10;&lt;p&gt;The &lt;i&gt;Content&lt;/i&gt; tab provides a WYSIWYG text editor similar to the CMS Block and Page sections and allows you to create the content for the banner.&lt;/p&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/banner-content-small.png" alt="Banner content tab" /&gt;&#10;&#10;&lt;p&gt;The &lt;i&gt;Related Promotions&lt;/i&gt; tab allows you to link a banner to a price rule (catalog or discount code). If you select a rule from the grid, the banner will only be shown when that rule is applied. For example, you could create a discount rule with a code and associate a banner with it; the banner would only be shown when the discount code was successfully applied to the shopping cart.&lt;/p&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/banner-related-promotions-small.png" alt="Banner related promotions tab" /&gt;&#10;&#10;&lt;h2&gt;The Banner Rotator Widget&lt;/h2&gt;&#10;&lt;p&gt;Banners on their own are a useful tool, and associating them with a customer segment or promotion allows fairly specific control over where a banner appears based on a customer's actions. If you want to use banners as part of the layout of your site, however, you need to add a new element - the banner rotator widget. This widget allows you to place a particular set of banners in specific places on your site, much like a CMS block.&lt;/p&gt;&#10;&#10;&lt;p&gt;Widgets can be embedded inside many types of CMS content, but you can also create 'stand-alone' instances of a widget type. This is the method used with the banner rotator. To create a new banner rotator, select &lt;i&gt;CMS &amp;rarr; Widgets&lt;/i&gt; from the backend menu and select &lt;i&gt;Banner Rotator&lt;/i&gt; from the &lt;i&gt;Type&lt;/i&gt; drop-down list. Select the package and theme your site uses from the &lt;i&gt;Design Package/Theme&lt;/i&gt; drop-down - note that this must match the settings under &lt;i&gt;System &amp;rarr; Configuration &amp;rarr; Design&lt;/i&gt; exactly, or your banner will not appear. Click &lt;i&gt;Continue&lt;/i&gt; and the rest of the widget options will appear. These are arranged in two tabs - &lt;i&gt;Frontend Properties&lt;/i&gt; and &lt;i&gt;Widget Options&lt;/i&gt;. &lt;i&gt;Frontend Properties&lt;/i&gt; controls where the banner will appear, while &lt;i&gt;Widget Options&lt;/i&gt; allows you to choose which banners are shown.&lt;/p&gt;&#10;&#10;&lt;p&gt;The &lt;i&gt;Frontend Properties&lt;/i&gt; tab contains fields for the name of the widget instance and the websites it will appear on. The &lt;i&gt;Layout Updates&lt;/i&gt; section at the bottom is the way to actually cause the banner rotator to appear on the frontend of the site. Clicking the &lt;i&gt;Add Layout Update&lt;/i&gt; button will add a new update and show the &lt;i&gt;Display On&lt;/i&gt; drop-down. From this list, you can choose what type of page you would like the banner to appear on. You can show the banner on categories, product pages or other pages; depending on which you choose, you will be presented with additional options. For example, if you choose &lt;i&gt;Anchor Categories&lt;/i&gt;, you will see the following options:&lt;/p&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/banner-rotator-category.png" alt="Banner rotator category options" /&gt;&#10;&lt;p&gt;The &lt;i&gt;Categories&lt;/i&gt; section allows you to show the banner on either all anchor categories or on specific ones. The &lt;i&gt;Block Reference&lt;/i&gt; drop-down lets you specify where the banner will appear - header, footer, sidebar, etc. The &lt;i&gt;Template&lt;/i&gt; drop-down should normally be set to &lt;i&gt;Banner Block Template&lt;/i&gt; - this is used for showing a banner as a block of its own, instead of inside another block.&lt;/p&gt;&#10;&lt;p&gt;It is possible to add more than one layout update to a widget instance. You might want to show a banner on both anchor and non-anchor categories, but a single layout update will only allow you to pick one or the other. To work around this, add two layout updates, select &lt;i&gt;Anchor Categories&lt;/i&gt; for the first and select &lt;i&gt;Non-Anchor Categories&lt;/i&gt; on the second.&lt;/p&gt;&#10;&lt;p&gt;The &lt;i&gt;Widget Options&lt;/i&gt; tab is simpler. The &lt;i&gt;Banners to Display&lt;/i&gt; drop-down allows you to choose to either select the banners to show directly (&lt;i&gt;Specified Banners&lt;/i&gt;) or to use banners depending on the current promotions (&lt;i&gt;Shopping Cart Promotions Related/Catalog Promotions Related&lt;/i&gt;). &lt;i&gt;Specified Banners will probably be used most often&lt;/i&gt;. &lt;i&gt;Restrict by Banner Types&lt;/i&gt; is relevant if you select a promotion-dependent type from the &lt;i&gt;Banners to Display&lt;/i&gt; drop-down, and allows you to limit the banners that will be shown by type - this lets you make sure you don't have footer banners appearing in the sidebar, for example. If you choose &lt;i&gt;Specified Banners&lt;/i&gt;, you can select the banner(s) you want to display directly from the &lt;i&gt;Specify Banners&lt;/i&gt; grid. Finally, the &lt;i&gt;Rotation Mode&lt;/i&gt; drop-down controls how the banners are rotated:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;&lt;strong&gt;One at the time, Random&lt;/strong&gt;: Each time the banner is shown, a random banner will be picked from the set you have selected.&lt;/li&gt;&#10; &lt;li&gt;&lt;strong&gt;One at the time, Series&lt;/strong&gt;: The banner shows the next banner in the set you have chosen each time the page is loaded, in the order you selected (using the &lt;i&gt;Position&lt;/i&gt; column in the grid).&lt;/li&gt;&#10; &lt;li&gt;&lt;strong&gt;One at the time, Shuffle&lt;/strong&gt;: The same as the above, but the order of the set is randomised each time.&lt;/li&gt;&#10; &lt;li&gt;&lt;strong&gt;Do not rotate, display all at once&lt;/strong&gt;: Shows all the banners at once.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Note that if you have only selected a single banner, it doesn't matter what you set this to.&lt;/p&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/banner-rotator-widget.png" alt="Banner rotator widget options" /&gt;&#10;&#10;&lt;p&gt;As an example, say you wanted to show a banner in the header of your site when on pages in a specific anchor product category (Shoes) :&#10;&lt;ol&gt;&#10; &lt;li&gt;Create the new banner in &lt;i&gt;CMS &amp;rarr; Banners&lt;/i&gt;. The new banner doesn't need to be linked to a customer segment or a promotion, so these areas can be left blank - the content is the important part.&lt;/li&gt;&#10; &lt;li&gt;Once the banner has been created, create a new banner rotator widget instance from &lt;i&gt;CMS &amp;rarr; Widgets&lt;/i&gt;.&lt;/li&gt;&#10; &lt;li&gt;From the &lt;i&gt;Frontend Properties&lt;/i&gt; section, choose &lt;i&gt;Anchor Category&lt;/i&gt; from the &lt;i&gt;Display On&lt;/i&gt; drop-down, select &lt;i&gt;Specific Categories&lt;/i&gt;, click the list icon and select Shoes from the category tree.&lt;/li&gt;&#10; &lt;li&gt;Select &lt;i&gt;Page Header&lt;/i&gt; from the &lt;i&gt;Block Reference&lt;/i&gt; drop-down and select &lt;i&gt;Banner Block Template&lt;/i&gt; from the &lt;i&gt;Template&lt;/i&gt; drop-down.&lt;/li&gt;&#10; &lt;li&gt;On the &lt;i&gt;Widget Options&lt;/i&gt; tab, select the banner you created from the grid and save the rotator.&lt;/li&gt;&#10; &lt;li&gt;The banner will now appear on the front-end when customers view the Shoes category page.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;While it is possible to do something similar using CMS static blocks and the layout system, banners provide a more flexible way of managing promotional elements on your site. Banner rotators allow fine control over where and when banners are shown without needing to add custom code, making things easier to use and maintain.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Adding a step to the Onepage Checkout</title><link>https://fontis.au/blog/adding-step-onepage-checkout/</link><pubDate>Thu, 27 May 2010 07:38:12 +0000</pubDate><guid>https://fontis.au/blog/adding-step-onepage-checkout/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The default Magento onepage checkout includes six steps for the customer to complete. However, sometimes you may have a requirement to create an extra checkout step. An example of this might be an option for your customer to choose a free gift as part of their order, or an extra step to collect special delivery instructions. Using delivery instructions as an example, we'll demonstrate how this can be achieved.&lt;/p&gt;&#10;&#10;&lt;p&gt;The first file we need to modify is &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;. Obviously we don't want to modify the code class="code-default" in the core context, so copy the file to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;b&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;/code&gt;&lt;/b&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;. Magento will use this file automatically.&lt;/p&gt;&#10;&#10;&lt;p&gt;In the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getSteps&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method of this class there is an array of the step codes, in order of viewing. We need to add our own step code class="code-default" in this array, in the relevant place. For this example, the code class="code-default" will be &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;deliveryinstructions&lt;/span&gt;&lt;/code&gt; so we will change the line to be this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stepCodes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;billing&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;shipping&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;shipping_method&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;deliveryinstructions&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;payment&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;review&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, we need to create a new file - &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Deliveryinstructions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;. As you can see from the name, this is the block file that runs our new step. You can use this class to do any special setup work for your block, but more than likely all you'll need is this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Mage_Checkout_Block_Onepage_Deliveryinstructions&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Checkout_Block_Onepage_Abstract&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCheckout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;label&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;checkout&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Delivery Instructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;is_show&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;isShow&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;_construct&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Now we need to make the actual template. The file we need is: &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;THEME&lt;/span&gt; &lt;span class="nx"&gt;DIRECTORY&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;onepage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;deliveryinstructions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;. Often the best way to create this file is to copy one of the other files, perhaps billing.phtml or shipping.phtml. Then, just modify the file to suit your needs.&lt;/p&gt;&#10;&#10;&lt;p&gt;With the template created, we need to tell Magento about it by editing the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;THEME&lt;/span&gt; &lt;span class="nx"&gt;DIRECTORY&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="nx"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; file. This will tell Magento when to load our new template file. Below the multishipping sections in this file the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;checkout_onepage_index&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; context begins. Look through it until you find the references to the login, billing, shipping, shipping method, payment and review templates. These are all inside the content reference area. At the position between all these files that you want your step to show, you need to add a reference to your new template. It should look something like this:&lt;/p&gt;&#10;&#10; &#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;block&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;checkout/onepage_deliveryinstructions&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;checkout.onepage.deliveryinstructions&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;as=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;template=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;checkout/onepage/deliveryinstructions.phtml&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Following on from that, we need to override the onepage controller to put in our extra step. How to actually override a controller is beyond the scope of this post, however the &lt;a href="http://www.magentocommerce.com/wiki/how_to_overload_a_controller"&gt;Magento wiki article on overriding controllers&lt;/a&gt; should tell you everything you need to know.&lt;/p&gt;&#10;&#10;&lt;p&gt;There are two parts we need to work with in our overridden controller, and the first one is the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;STEP&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Action&lt;/span&gt;&lt;/code&gt; method for the step before ours. In this example, I'm putting my new step between the Shipping Method step and the Payment Method step, so I'm going to override the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveShippingMethodAction&lt;/span&gt;&lt;/code&gt; method. We need to change the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;goto_section&lt;/span&gt;&lt;/code&gt; in the method to be our new step, so it should look like this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;goto_section&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;deliveryinstructions&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;We also need to remove the following code class="code-default", as we don't need to update our delivery instructions section. We will need the code class="code-default" again for the next part, so keep it handy:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;update_section&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;name&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;payment-method&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;html&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_getPaymentMethodsHtml&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The next change to this controller should be to add a new method, called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveDeliveryinstructionsAction&lt;/span&gt;&lt;/code&gt;. This method must perform two functions; it should call the method on the Onepage Model, and also pass any data back to the browser. The following code class="code-default" is an example of what we need, copied and modified from the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveShippingMethodAction&lt;/span&gt;&lt;/code&gt; method:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveDeliveryinstructionsAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_expireAjax&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRequest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;isPost&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRequest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getPost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getOnepage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;saveDeliveryinstructions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/*&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt; $result will have error data if shipping method is empty&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt; */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;dispatchEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;checkout_controller_onepage_save_deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;request&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRequest&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;quote&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getOnepage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getQuote&lt;/span&gt;&lt;span class="p"&gt;()));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getResponse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setBody&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Zend_Json&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;goto_section&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;payment&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;update_section&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;name&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;payment-method&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;html&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_getPaymentMethodsHtml&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getResponse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setBody&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Zend_Json&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;In the last step we called a method that we haven't defined yet, so we'll do that now. This method is in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file. Like the past few files, we are going to modify the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveShippingMethod&lt;/span&gt;&lt;/code&gt; method and also copy it to a new method. The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveShippingMethod&lt;/span&gt;&lt;/code&gt; code class="code-default" should be modified to look like this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveShippingMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$shippingMethod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$shippingMethod&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;error&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;message&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;checkout&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Invalid shipping method.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getQuote&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getShippingAddress&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getShippingRateByCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$shippingMethod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$rate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;error&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;message&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;checkout&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Invalid shipping method.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getQuote&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getShippingAddress&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setShippingMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$shippingMethod&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getQuote&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;collectTotals&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCheckout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;shipping_method&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;complete&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;allow&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Unfortunately, there is no simple way to save the data that we collect. For example, information about a customer will be saved completely differently to shipping information like our delivery instructions; the delivery instructions will be saved differently again to how we would add a free gift to the order.&lt;/p&gt;&#10;&#10;&lt;p&gt;Because of this I won't show you any code class="code-default" for actually saving the data you've captured, though we may address this in a follow up post at a later date. The following code class="code-default" is the new method that does not save anything:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveDeliveryinstructions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$deliveryinstructions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Save the data here&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCheckout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;complete&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;payment&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;allow&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, we need to make a couple of JavaScript changes. These changes will be made in the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SKIN&lt;/span&gt; &lt;span class="nx"&gt;DIRECTORY&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;opcheckout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; file. In the Checkout class, we need to change the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setShippingMethod&lt;/span&gt;&lt;/code&gt; method to go to the delivery information block, similar to the way we have in the files above. Then we need to make a &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setDeliveryinstructions&lt;/span&gt;&lt;/code&gt; method which will be exactly the same as the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setShippingMethod&lt;/span&gt;&lt;/code&gt; method before we modified it.&lt;/p&gt;&#10;&#10;&lt;p&gt;There is a class further down in the file called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;ShippingMethod&lt;/span&gt;&lt;/code&gt;, inside of which is a method called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;nextStep&lt;/span&gt;&lt;/code&gt;. We need to change it as per the above method so that the step goes to the delivery instructions step rather than the payment step. Then, again like before, we need to copy the whole class and modify it so that it's now a &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;DeliveryInstructions&lt;/span&gt;&lt;/code&gt; class, making sure to set the next step to be the payment step.&lt;/p&gt;&#10;&#10;&lt;p&gt;There is now one final requirement, which is to add in our step in the progress meter on the right side of the checkout. To do this we need to edit &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;THEME&lt;/span&gt; &lt;span class="nx"&gt;DIRECTORY&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;onepage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;progress&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;. If you look at the file, you'll have a pretty good idea of how the template should be laid out and below is an example of what to add in for our example delivery instructions:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCheckout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStepData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;deliveryinstructions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;is_show&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;?php if ($this-&amp;gt;getCheckout()-&amp;gt;getStepData(&amp;#34;deliveryinstructions&amp;#34;, &amp;#34;complete&amp;#34;)): ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;li&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;h4 class=&amp;#34;complete&amp;#34;&amp;gt;&amp;lt;?php echo $this-&amp;gt;__(&amp;#34;Delivery Instructions&amp;#34;); ?&amp;gt; &amp;lt;span class=&amp;#34;separator&amp;#34;&amp;gt;|&amp;lt;/span&amp;gt; &amp;lt;a href=&amp;#34;#deliveryinstructions&amp;#34; onclick=&amp;#34;checkout.accordion.openSection(&amp;#39;opc-deliveryinstructions&amp;#39;);return false;&amp;#34;&amp;gt;&amp;lt;?php echo $this-&amp;gt;__(&amp;#34;Change&amp;#34;); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h4&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;div class=&amp;#34;content&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;!-- Here write code class=&amp;#34;code-default&amp;#34; to display the data the customer enters --&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;/div&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;/li&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;?php else: ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;li&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;h4&amp;gt;&amp;lt;?php echo $this-&amp;gt;__(&amp;#34;Delivery Instructions&amp;#34;); ?&amp;gt;&amp;lt;/h4&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;/li&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &amp;lt;?php endif; ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php endif; ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;We have now added a new step to our checkout and made it accessible in the same way as the rest of the checkout steps. Using this as a base, you can develop the concept further to provide additional information or options to the customer during checkout. Of course, too many steps will likely turn people away, so it's a matter of balancing the need to collect extra information with the need to make the checkout as quick and easy to complete as possible.&lt;/p&gt;&#10;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento versions:&lt;/td&gt;&#10;&lt;td&gt;1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Magento Session Fixation Workaround</title><link>https://fontis.au/blog/magento-session-fixation-workaround/</link><pubDate>Sat, 20 Mar 2010 23:43:58 +0000</pubDate><guid>https://fontis.au/blog/magento-session-fixation-workaround/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Earlier versions of Magento were susceptible to a form of &lt;a href="http://en.wikipedia.org/wiki/Session_fixation"&gt;session fixation&lt;/a&gt; vulnerability, which can have quite serious consequences even without anyone trying to exploit it maliciously. Visitors may unwittingly follow a link to a Magento site, and be logged in as another user without performing any actions. This results in multiple visitors sharing a session and causes confusion as they add and remove things from the same cart, and potentially even allows them to view another customer's details and place orders under their account. Luckily the issue has a simple fix in version 1.4 and later, but in this post we'll also detail a precaution that can be taken to guard against this in earlier versions.&lt;/p&gt;&#10;&#10;&lt;p&gt;The problem stems from a feature whereby the session ID is passed as a GET parameter when the URL by which the current Magento store is being accessed doesn't match that store's base URL. This feature was designed to support a user freely switching between stores within the one site. However, it is quite common for a site to be accessible by two or more URLs (e.g. domain both with and without www), and links that are generated when accessing the site via any URL that is not the base URL will have a SID parameter included in the query string. If a URL of this form is then distributed to many people through an email campaign, ad link, data feed, or by other means, then they may share the session identified by the SID in the URL for as long as it is valid. The person distributing the URL might have quite innocently stumbled into the URL that includes the SID, for example by directly entering the domain name without the www but where the base URL includes it.&lt;/p&gt;&#10;&#10;&lt;p&gt;As a workaround, assuming we have Apache rewrites enabled, then we can use a rewrite to remove the offending SID parameter from the query string altogether. The following rewrite would be used before any rewrites of the request to Magento:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Covers the case where there are more parameters that follow SID=XXXX&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# We rewrite the query (foo=bar&amp;amp;)SID=XXXX&amp;amp;(baz=naz) to just foo=bar&amp;amp;baz=naz.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# The ampersand following the preceding parameters, if they are present, is retained.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond % ^&lt;span class="o"&gt;(&lt;/span&gt;.+&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;?SID&lt;span class="o"&gt;=[&lt;/span&gt;w&lt;span class="o"&gt;]&lt;/span&gt;*&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;.+&lt;span class="o"&gt;)&lt;/span&gt;?$ &lt;span class="o"&gt;[&lt;/span&gt;NC&lt;span class="o"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule ^&lt;span class="o"&gt;(&lt;/span&gt;.*&lt;span class="o"&gt;)&lt;/span&gt;$ /&lt;span class="nv"&gt;$1&lt;/span&gt;?%1%2 &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;R&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;301,L,NE&lt;span class="o"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Covers the case where there are no more parameters follow SID=XXXX&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# We rewrite the query (foo=bar)&amp;amp;SID=XXXX to just foo=bar.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# The ampersand following the preceding parameters, if they are present, is discarded.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond % ^&lt;span class="o"&gt;((&lt;/span&gt;.+&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;?SID&lt;span class="o"&gt;=[&lt;/span&gt;w&lt;span class="o"&gt;]&lt;/span&gt;*$ &lt;span class="o"&gt;[&lt;/span&gt;NC&lt;span class="o"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule ^&lt;span class="o"&gt;(&lt;/span&gt;.*&lt;span class="o"&gt;)&lt;/span&gt;$ /&lt;span class="nv"&gt;$1&lt;/span&gt;?%2 &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;R&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;301,L,NE&lt;span class="o"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The rewrites handle two cases covering whether there are additional parameters following SID or not. One advantage of this approach is that it requires no modification of the application itself and provides an extra layer of security for your website. It could also conceivably be used for other applications aside from Magento to prevent similar problems.&lt;/p&gt;&#10;&#10;&lt;p&gt;To turn the option off in Magento 1.4 and later, set "Use SID on Frontend" to "No" under System → Configuration → Web → Session Validation Settings:&lt;p&gt;&#10;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/magento_session_validation.png" alt="" /&gt;&#10;&#10;&lt;p&gt;Note that the rewrite detailed above shouldn't interfere with anything else, and could always be left in place following a 1.4 upgrade to guard against the setting ever accidentally being turned back on.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Customise Magento Checkout Success Page Based On Payment Type</title><link>https://fontis.au/blog/customise-magento-checkout-success-page-based-payment-type/</link><pubDate>Fri, 19 Mar 2010 06:08:45 +0000</pubDate><guid>https://fontis.au/blog/customise-magento-checkout-success-page-based-payment-type/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The Magento order process completes with an order success page confirming that the order has been received and displaying the order number. This poses a problem for orders with non-instantaneous payment methods (like Check/Money Order) since the necessary payment details are then only available to customers during the payment step before the order is placed and customers need to know to note these down. Ideally you want any necessary payment information to be shown to the customer once they have finished placing the order. This post shows how to customise the order success page based on the selected payment type to show payment details for non-instantaneous payment methods, ensuring that customers properly complete the full order process.&lt;/p&gt;&#10;&#10;&lt;p&gt;To demonstrate the necessary changes we will use the Check/Money Order payment method. To get started we need to create a static block with "money_order_msg" set as the block id and add the following content: "Your order will be processed as soon as payment has been received. Please make cheques payable to ACME Inc."&lt;/p&gt;&#10;&#10;&lt;p&gt;To include the static block we have just created the following template needs to be modified:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;design&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;frontend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;_your_theme_&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;Custom code is best inserted above the &lt;code class="code-inline language-html"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;button-set&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; element, which defines a 'Continue Shopping' button. Insert the following above the "button-set" line:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Get the id of the order just made.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sales/order&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getOrderId&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// If the order was paid for by Check or Money Order, display the custom message&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getPayment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getMethod&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;checkmo&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getLayout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;createBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;cms/block&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setBlockId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;money_order_msg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;toHtml&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This code will retrieve the order that has been placed and check whether the payment method is "checkmo", which is the payment method code for the Check / Money Order method. If Check/Money Order has been used as the payment method, then our new static block will be placed on the success page, above the "Continue Shopping" button.&lt;/p&gt;&#10;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/success_message.png" alt="The end result of adding a custom message" /&gt;&#10;&#10;&lt;p&gt;One way to find the payment method code for other payment methods is to inspect the payment method header in the Magento backend with Firebug or simply viewing the page source.&lt;/p&gt;&#10;&#10;&lt;p&gt;To improve the checkout process further, you can modify the details shown in the payment step to state that full payment details will only be made available once the order is placed. This helps ensure that those who prefer non-instantenous payment methods actually complete the entire checkout process.&lt;/p&gt;&#10;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/wysiwyg/blog/payment_step.png" alt="The end result of adding a custom message" /&gt;&#10;&#10;&lt;p&gt;By using the appropriate payment method code you can add customised reminders for any non-instantenous payment method, and your customers will be able to refer to the payment details once the order is placed.&lt;/p&gt;&#10;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento versions:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4, 1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Automatically set Magento customer group</title><link>https://fontis.au/blog/automatically-set-magento-customer-group/</link><pubDate>Tue, 09 Mar 2010 05:18:23 +0000</pubDate><guid>https://fontis.au/blog/automatically-set-magento-customer-group/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;A commonly used Magento feature is the ability to place customers into different customer groups. These customer groups can then be used in a number of ways, such as tiered pricing where each customer group may have different pricing applied. By default, Magento does not include a means of automatically sorting customers into different groups when the customer account is created; instead they must be assigned manually. This post follows on from our &lt;a href=" /blog/know-more-about-your-customers-adding-custom-signup-attributes"&gt;creating custom customer attributes post&lt;/a&gt; and shows how to automate customers being assigned to groups based upon information they have provided when signing up, whether from a custom or default customer attribute.&lt;/p&gt;&#10;&#10;&lt;p&gt;In the previous post, we added a new attribute called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;flavour&lt;/span&gt;&lt;/code&gt; to our customer and made it compulsory. For the purposes of this article, let's say that if a customer's favourite ice-cream flavour is Caramel, we want them to be eligible for discounts across some of our products. The first step is to create the customer group. This can be done from the admin panel by choosing &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Customers&lt;/span&gt;&lt;/code&gt; &amp;rarr; &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt; &lt;span class="nx"&gt;Groups&lt;/span&gt;&lt;/code&gt; and clicking on the 'Add New Customer Group' button. When you do this, take note of the new id assigned to this group, as we are going to need it later.&lt;/p&gt;&#10;&#10;&lt;p&gt;Now, we have to add in our custom module. I am calling my module &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;/code&gt; and it is part of the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Fontis&lt;/span&gt;&lt;/code&gt; group. So, the file should be named &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Fontis_Customer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt;. Add the following code into this file:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;active&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/active&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;codePool&amp;gt;&lt;/span&gt;local&lt;span class="nt"&gt;&amp;lt;/codePool&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, we need to create the code for the module. The idea behind our code is that we are going to create an observer on the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;customer_save_before&lt;/span&gt;&lt;/code&gt; event. Magento has a number of events that we can observe but most are beyond the scope of this article. What is useful is that the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;customer_save_before&lt;/span&gt;&lt;/code&gt; event is called both when a customer is created and when a customer makes changes to their account. This means that the one observer will be able to do the work for both events.&lt;/p&gt;&#10;&#10;&lt;p&gt;All of the code we are writing for our module will be located inside the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Fontis&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directory. The first file is &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt;:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;global&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;events&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;customer_save_before&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;observers&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;fontis_customer_save_observer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;type&amp;gt;&lt;/span&gt;singleton&lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;Fontis_Customer_Model_Customer_Observer&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;method&amp;gt;&lt;/span&gt;customer_save_before&lt;span class="nt"&gt;&amp;lt;/method&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/fontis_customer_save_observer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/observers&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/customer_save_before&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/events&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/global&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The next step is to create the class that we have just told Magento we are going to use, and should be defined in the file &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Observer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Fontis_Customer_Model_Customer_Observer&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Core_Model_Abstract&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/*&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt; * observer for the customer saved event&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cm"&gt; */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;customer_save_before&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$observer&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$customer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$observer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCustomer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;strtolower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$customer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getFlavour&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;caramel&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$customer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;group_id&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Set the new customer group&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$customer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;group_id&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Set to the default customer group&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;Exception&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;customer_save_before observer failed: &amp;#34;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Customers are now automatically assigned to your new group if they supply caramel as their favourite ice cream flavour.&lt;/p&gt;&#10;&#10;&lt;p&gt;I should mention a number of caveats regarding this last snippet. First, it is important to enclose everything in your observers with &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt;&lt;/code&gt; blocks. Without this precaution, if your script causes an exception then the customer's information won't be saved. It is also very important not to call the &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$customer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method. If you do this, it will cause your observer to be called again, which will call the save method again and loop until you run out of memory. The reason that you don't need to call the save method is that the customer object you are working on is the same object that Magento is partway through saving when your observer gets called. Once your observer finishes, the customer object finishes saving (and then the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;customer_save_after&lt;/span&gt;&lt;/code&gt; event is fired).&lt;/p&gt;&#10;&#10;&lt;p&gt;Another thing to mention is the &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;/code&gt; statement in the observer. In the true case, we set the customers group to be ID 5. This is likely the group ID of your new group, if it is the first group that you have created in your Magento install. The else statement handles the case where a customers edits their account and changes their favourite flavour, in which case you may want to set their group back to a default.&lt;/p&gt;&#10;&#10;&lt;p&gt;To conclude, you can use this same method to add observers to a large number of events. You can also use the observer we have used here to change anything about your customers. Remember to enclose anything in an observer with &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt;&lt;/code&gt; statements. &lt;/p&gt;&#10;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento versions:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4, 1.4.0.1&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Extending the Magento web services API</title><link>https://fontis.au/blog/extending-magento-web-services-api/</link><pubDate>Mon, 08 Mar 2010 00:40:00 +0000</pubDate><guid>https://fontis.au/blog/extending-magento-web-services-api/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;First of all, you need to find the Magento core file that provides the API method you want to extend. These are generally in model files called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; or under directories called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Api&lt;/span&gt;&lt;/code&gt;. For example, I recently needed to look up customer orders by their IDs, as opposed to their increment IDs (aka their order numbers, such as '#100000003'). After some searching, I found the file that contains the relevant code at &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Sales&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;, in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;_initOrder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_initOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sales/order&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/* @var $order Mage_Sales_Model_Order */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_fault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;not_exists&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;To override this, we could put a copy of the file in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;/code&gt;, but that would mean copying the whole file and effectively overriding all the methods in it. Unfortunately this approach can be problematic when upgrading, since other modules may depend on new methods in the API model that aren't available due to the override. A better approach would be to only modify the function we are interested in. Create a file called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Example_Webservices&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;/code&gt;, containing:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Example_Webservices&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;active&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/active&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;codePool&amp;gt;&lt;/span&gt;local&lt;span class="nt"&gt;&amp;lt;/codePool&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Example_Webservices&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Create the directory &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Example&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Webservices&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;/code&gt;, and create a file called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; containing:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;global&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;models&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;sales&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;rewrite&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;order_api&amp;gt;&lt;/span&gt;Example_Webservices_Model_Sales_Order_Api&lt;span class="nt"&gt;&amp;lt;/order_api&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/rewrite&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/sales&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/models&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/global&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&#10;&lt;p&gt;This is the usual code for overriding a model. We're rewriting all requests for the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Sales_Model_Order_Api&lt;/span&gt;&lt;/code&gt; class to our own &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Example_Webservices_Model_Sales_Order_Api&lt;/span&gt;&lt;/code&gt; class.&lt;/p&gt;&#10;&lt;p&gt;Finally, we need to actually create our model and override the method we're interested in. Create &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Example&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Webservices&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Sales&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; containing:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Example_Webservices_Model_Sales_Order_Api&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Sales_Model_Order_Api&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_initOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sales/order&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;is_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_fault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;not_exists&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_fault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;not_exists&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&#10;&lt;p&gt;This class overrides the original model class we're overriding - this way, we only change the specific methods we want to change and minimise the chance of interfering with an upgrade. The modifications to the body of the method are quite simple. Instead of always loading by increment ID, we first check if the &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$orderIncrementId&lt;/span&gt;&lt;/code&gt; parameter we are passed is a string. If it's a string, we do an increment ID lookup; if not, we assume it's an ID and look up on that. This works in a similar way to products, where you can use the API to get a product by either ID or SKU.&lt;/p&gt;&#10;&#10;&lt;p&gt;If your Magento store needs to work with another application in a way that Magento doesn't support, this simple example shows how easy it is to extend Magento's web services API's to allow you to achieve the integration that you require.&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Direct SQL queries in Magento</title><link>https://fontis.au/blog/direct-sql-queries-in-magento/</link><pubDate>Fri, 05 Mar 2010 04:00:00 +0000</pubDate><guid>https://fontis.au/blog/direct-sql-queries-in-magento/</guid><description>This quick guide will explain how to properly access the Magento database using custom defined read and write connections following best practice, ensuring maintainability and better performance while future proofing your code.</description></item><item><title>Displaying Magento custom product attributes on the frontend</title><link>https://fontis.au/blog/displaying-magento-custom-attributes-frontend/</link><pubDate>Fri, 12 Feb 2010 06:55:47 +0000</pubDate><guid>https://fontis.au/blog/displaying-magento-custom-attributes-frontend/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The simplest way to display custom attributes is to enable them on product view pages, where they normally show up as a table. Design files can be edited to display custom product attributes elsewhere on the product view page. When a Magento product object gets loaded in a template file, any custom attributes that have been added to products are also accessible. The method used to retrieve the values depends on the type of attribute. For drop-down attributes you can use the following code:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$_product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getAttributeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;’attribute_name’&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;and for all other attribute types:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$_product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getAttributeName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;The above code will only return values on product view pages. If you would like to use these elsewhere, then you will need to make further modifications. Magento provides a backend setting to decide if the attribute is to be made available in product listings, such as category pages. Setting "Used in product listing" to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;yes&lt;/span&gt;&lt;/code&gt; makes the attribute values accessible on category and search pages.&lt;/p&gt;&#10;&#10;&lt;p&gt;To access custom attributes on any other page requires modifications to the way the product collections are loaded. The functions responsible for loading products are:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getItemCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getProductCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt; Which of the two is used will depend on the context. To load a custom attribute you need to modify the above functions to include an &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;test_attribute&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/code&gt; function call. Often Magento code already has &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;addAttributeToSelect&lt;/span&gt;&lt;/code&gt; calls, hence searching for those calls in the relevant module is one way to find which function needs to be modified. For example, if you wanted to use a custom attribute, say &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;recommended_retail_price&lt;/span&gt;&lt;/code&gt;, in the compare products sidebar, you would need to modify &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getItemCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; in:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Helper&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Compare&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;and change the following code:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_itemCollection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;name&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addUrlRewrite&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;to&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_itemCollection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;name&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;recommended_retail_price&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addUrlRewrite&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Only then can you use &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$_product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRecommendedRetailPrice&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/code&gt; in the respective phtml template file to show the value on the compare sidebar.&lt;/p&gt;&#10;&#10;&lt;p&gt;Equipped with this knowledge, it's easy to leverage flexibility of the product attribute system for extended functionality on the Magento frontend.&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Common Magento theming issues</title><link>https://fontis.au/blog/common-magento-theming-issues/</link><pubDate>Thu, 11 Feb 2010 03:02:09 +0000</pubDate><guid>https://fontis.au/blog/common-magento-theming-issues/</guid><description>This post highlights 2 common theming issues in Magento and how to fix them: &lt;strong&gt;Breadcrumb &amp;amp; Page&lt;/strong&gt; titles and &lt;strong&gt;Custom onepage checkout layout&lt;/strong&gt;</description></item><item><title>Australia Day Extension Release</title><link>https://fontis.au/blog/australia-day-2010-extension-release/</link><pubDate>Tue, 26 Jan 2010 11:00:00 +0000</pubDate><guid>https://fontis.au/blog/australia-day-2010-extension-release/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;In addition to the feed generators, there are some incremental improvements to the rest of the extension, most notably in the BPAY and direct deposit functionality, which now have their own order statuses to help administrators determine at a glance which payment method was used to place an order.&lt;/p&gt;&#10;&#10;&lt;p&gt;We hope these changes will continue to provide Australian online retailers with commonly desired functionality for running a Magento website in Australia. We've had great feedback on the extension so far, and are keen to hear any comments or suggestions that members of the community may have for future versions.&lt;/p&gt;&#10;&#10;&lt;p&gt;We should also mention that in true Australia Day tradition, version 2.0 is best enjoyed with a cold beer and a snag fresh off the barbie! Happy Australia Day everyone.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Using jQuery with Magento</title><link>https://fontis.au/blog/using-jquery-with-magento/</link><pubDate>Fri, 22 Jan 2010 08:00:00 +0000</pubDate><guid>https://fontis.au/blog/using-jquery-with-magento/</guid><description>&lt;div class="postContent std"&gt;&lt;h3&gt;Installing jQuery&lt;/h3&gt;&#10;&#10;&lt;p&gt;jQuery can be downloaded from &lt;a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery"&gt;jquery.com&lt;/a&gt; and to install it you need to copy the file to the following directory:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;skin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;frontend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;your_theme&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;To include jQuery you need to edit &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; where you need to add the following to the head block:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="nx"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;addItem&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;skin_js&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;jquery&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Normally, this would be all you need to do, however because Magento also includes Prototype, there is a subtlety we need to deal with. jQuery uses '$' as shorthand for accessing the jQuery library. But Prototype also uses '$' to access itself. This causes a conflict in the global JavaScript namespace of the web browser. Fortunately jQuery provides a solution, the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noConflict&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/code&gt; function defines a new shorthand for jQuery, such as:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;$j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noConflict&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The above code needs to come after the jQuery library code, but before any other JavaScript libraries. You can include the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;noConflict&lt;/span&gt;&lt;/code&gt; call at the bottom of the jQuery file you have copied to the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;/code&gt; directory. Therefore you need make sure that "action method" line we included in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; comes before the code that includes Prototype or any other JavaScript libraries.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Google-hosted jQuery&lt;/h3&gt;&#10;&#10;&lt;p&gt;Another method to use jQuery is to refer to the Google hosted version, by using the following code:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;As the jQuery version is part of the URL, testing a new version is easy. The code should be placed into the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt; design template file (this is necessary as references to external URLs cannot be placed in the layout files of Magento):&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;design&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;frontend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;your_theme&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;templates&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Make sure that you include the code before this line:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCssJsHtml&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Also, remember to include the noConflict definition. Your customised head.phtml file should look something like this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this-&amp;gt;getTitle() ?&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Content-Type&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo $this-&amp;gt;getContentType() ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo htmlspecialchars($this-&amp;gt;getDescription()) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;keywords&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo htmlspecialchars($this-&amp;gt;getKeywords()) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;robots&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo htmlspecialchars($this-&amp;gt;getRobots()) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this-&amp;gt;getChildHtml() ?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;icon&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo $this-&amp;gt;getSkinUrl(&amp;#39;favicon.ico&amp;#39;) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;image/x-icon&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;shortcut icon&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo $this-&amp;gt;getSkinUrl(&amp;#39;favicon.ico&amp;#39;) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;image/x-icon&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;//&amp;lt;![CDATA[&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;BLANK_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;?php echo $this-&amp;gt;helper(&amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;)-&amp;gt;getJsUrl(&amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;blank&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;) ?&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;BLANK_IMG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;?php echo $this-&amp;gt;helper(&amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;)-&amp;gt;getJsUrl(&amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;spacer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gif&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;) ?&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;//]]&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;lt;!-- adding jQuery --&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;//&amp;lt;![CDATA[&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;$j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noConflict&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;//]]&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;lt;!-- ************* --&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this-&amp;gt;getCssJsHtml() ?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this-&amp;gt;helper(&amp;#39;core/js&amp;#39;)-&amp;gt;getTranslatorScript() ?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this-&amp;gt;getIncludes() ?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The benefit of using the Google hosted version is that there might be a performance improvement provided by the HTTP request being fulfilled by a local server that is part of Google's &lt;acronym title="content delivery network"&gt;CDN&lt;/acronym&gt;, and if enough websites follow this approach then this JavaScript will be cached by browsers across these sites, resulting in minimal waiting time for a browser to load the core jQuery library.&lt;/p&gt;&#10;&#10;&lt;p&gt;The benefit of a self-hosted copy is that it can be combined with all the other JavaScript files in use on your site allowing for one single HTTP request to deliver all necessary JavaScript reducing the overhead introduced with individual requests. The other benefit is that there is no external dependence on the availability of the Google hosted version, even though it is unlikely to become unavailable.&lt;/p&gt;&#10;&#10;&lt;h3&gt;jQuery Magento extensions&lt;/h3&gt;&#10;&#10;&lt;p&gt;It should be noted that there is a third method of including jQuery in Magento that involves installing an extension. However, doing so can result in blocks being overwritten, which can potentially conflict with other extensions. As we have demonstrated, installing jQuery is not a difficult process, so it may be just as easy to include manually. &lt;/p&gt;&#10;&#10;&lt;p&gt;While Prototype is a great library in its own right, jQuery has led the pack in terms of performance in the web browser and ease of use. Developing with jQuery can be a faster experience than developing with Prototype, reducing the effort required to develop new JavaScript features for Magento websites.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>How to set up a Magento store for Australia</title><link>https://fontis.au/blog/how-to-set-up-a-magento-store-for-australia/</link><pubDate>Thu, 29 Oct 2009 04:21:15 +0000</pubDate><guid>https://fontis.au/blog/how-to-set-up-a-magento-store-for-australia/</guid><description>&lt;div class="postContent std"&gt;&lt;p class="alert alert-info"&gt;Looking for instructions for Magento 2? Take a look at the new post &lt;a href="https://fontis.au/blog/how-to-set-up-a-magento2-store-for-australia/"&gt;How to set up a Magento 2 store for Australia&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;Running Magento stores in Australia differs very little from any other country, but there are a few things that you need to do for compliance with &lt;abbr title="Australian Taxation Office"&gt;ATO&lt;/abbr&gt; requirements and to ensure that Magento calculates taxes correctly. The following is an outline of the necessary configuration and settings you may need to consider when setting up Magento for an Australian store.&lt;/p&gt;&#10;&#10;&lt;p&gt;First, the basic information for the store must be configured for Australia:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; General&lt;/b&gt;&lt;br /&gt;&#10;&lt;i&gt;Countries options&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Default country = Australia&lt;/li&gt;&#10;&lt;li&gt;Allow countries = ensure Australia is selected&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Locale options&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Timezone = AUS Eastern Standard Time (Australia/Sydney) (as appropriate)&lt;/li&gt;&#10;&lt;li&gt;Locale = English (Australia)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, the currency must be configured for Australian Dollars:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; Currency Setup&lt;/b&gt;&lt;br /&gt;&#10;&#10;&lt;i&gt;Currency Options&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Base currency = Australian Dollar&lt;/li&gt;&#10;&lt;li&gt;Default display currency = Australian Dollar&lt;/li&gt;&#10;&lt;li&gt;Allowed currencies = ensure Australian Dollar is selected&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Shipping settings are important for shipping, and also for tax calculation. You should enter information appropriate for your shipping location, which must be in Australia for shipping and tax calculations to work correctly.&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; Shipping Settings&lt;/b&gt;&lt;br /&gt;&#10;&lt;i&gt;Origin&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Country = Australia&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;To set tax correctly for Australia (prices shown include GST) and to apply discounts correctly, the following should be set:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; Tax&lt;/b&gt;&lt;br /&gt;&#10;&#10;&lt;i&gt;Tax Classes&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tax Class for Shipping = Shipping&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Calculation Settings&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tax Based On = Shipping Address&lt;/li&gt;&#10;&lt;li&gt;Catalog prices include tax = Yes&lt;/li&gt;&#10;&lt;li&gt;Shipping prices include tax = Yes&lt;/li&gt;&#10;&lt;li&gt;Apply Tax After Discount = Yes&lt;/li&gt;&#10;&lt;li&gt;Apply Discount On Prices Including Tax = Yes&lt;/li&gt;&#10;&lt;li&gt;Apply Tax On = Custom price if available&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Default Tax Destination Calculation&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Default Country = Australia&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Display&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Display Cart/Order Prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display full tax summary = No&lt;/li&gt;&#10;&lt;li&gt;Display Shipping Prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display Product Prices = Including tax&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;These settings will instruct Magento that all prices entered into the system already include GST (which is most common for Australian retailers) and that prices displayed to the customer should be displayed &lt;em&gt;including&lt;/em&gt; tax. You may need to adjust the settings for shipping appropriately, depending on whether your chosen shipping method should include GST or not.&lt;/p&gt;&#10;&#10;&lt;p&gt;Please note that the upcoming release has some changes to these settings. For Community Edition 1.4 (and Enterprise Edition 1.6), use the following instead:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; Tax&lt;/b&gt;&lt;br /&gt;&#10;&#10;&lt;i&gt;Tax Classes&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tax Class for Shipping = Shipping&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Calculation Settings&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tax Calculation Method Based On = Total&lt;/li&gt;&#10;&lt;li&gt;Tax Calculation Based On = Shipping Address&lt;/li&gt;&#10;&lt;li&gt;Catalog prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Shipping prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Apply Customer Tax = After Discount&lt;/li&gt;&#10;&lt;li&gt;Apply Discount On Prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Apply Tax On = Custom price if available&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Default Tax Destination Calculation&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Default Country = Australia&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Price Display Settings&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Display Product Prices In Catalog = Including tax&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Shopping Cart Display Settings&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Display Prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display Subtotal = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display Shipping Amount = Including tax&lt;/li&gt;&#10;&lt;li&gt;Include Tax in Grand Total = No&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;i&gt;Order, Invoices, Creditmemos Display Settings&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Display Prices = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display Subtotal = Including tax&lt;/li&gt;&#10;&lt;li&gt;Display Shipping Amount = Including tax&lt;/li&gt;&#10;&lt;li&gt;Include Tax in Grand Total = No&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;The easiest way to meet the ATO requirements for ABN and contact number on invoices is to add these details to your address information:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;System &amp;rarr; Configuration &amp;rarr; Sales&lt;/b&gt;&lt;br /&gt;&#10;&lt;i&gt;Invoice and Packing Slip Design&lt;/i&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Address = your address + ABN and phone number&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;You might also choose to add this information to the transactional email template for invoices. If you want to use the PDF invoices however you will need to alter the address above or modify the PDF rendering, which we may cover in another post.&lt;/p&gt;&#10;&#10;&lt;p&gt;To set up the 10% GST to be applied on products and shipping, Magento requires the addition of an appropriate tax rate and rule:&lt;/p&gt;&#10;&lt;div style="margin-left:1em;"&gt;&#10;&lt;b&gt;Sales &amp;rarr; Tax &amp;rarr; Manage Tax Zones &amp; Rates&lt;/b&gt;&lt;br /&gt;&#10;&lt;p&gt;Here we add a tax rate for GST so that Magento will know how much tax to calculate.&lt;/p&gt;&#10;&lt;p&gt;To add a rate, click &lt;i&gt;Add New Tax Rate&lt;/i&gt; in the top right and fill out the following information:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tax Identifier = GST&lt;/li&gt;&#10;&lt;li&gt;Country = Australia&lt;/li&gt;&#10;&lt;li&gt;State = *&lt;/li&gt;&#10;&lt;li&gt;Zip/Post Code = *&lt;/li&gt;&#10;&lt;li&gt;Rate = 10.00&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Save the rate and proceed to set up a rule for GST.&lt;/p&gt;&#10;&#10;&lt;h4&gt;Sales &amp;rarr; Tax &amp;rarr; Manage Tax Rules&lt;/h4&gt;&#10;&lt;p&gt;Tax rules determines when rates should be applied. In this case we want to set it up to apply GST anywhere in Australia.&lt;/p&gt;&#10;&lt;p&gt;Click &lt;i&gt;Add New Tax Rule&lt;/i&gt; in the top right and fill out the following information:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Name = GST&lt;/li&gt;&#10;&lt;li&gt;Customer Tax Class = Retail Customer&lt;/li&gt;&#10;&lt;li&gt;Product Tax Class = Taxable Goods | Shipping&lt;/li&gt;&#10;&lt;li&gt;Tax Rate = GST&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Save the rule and GST will be completely set up. It's a good idea to remove any other tax rules that are present by default, unless they will also be relevant for you.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h4&gt;Rename Tax to GST&lt;/h4&gt;&#10;&lt;p&gt;Something that is often overlooked is that you must include a line in your invoices specifically indicating the amount of GST that has been applied. This can be done in a few ways but a simple method is to use the translation files included as part of the locale. This allows for easy replication across websites by copying the files from one site to another.&lt;/p&gt;&#10;&lt;p&gt;To modify the translation, creating an &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;en_AU&lt;/span&gt;&lt;/code&gt; directory and copy the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage_Sales&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;csv&lt;/span&gt;&lt;/code&gt; file from the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;en_US&lt;/span&gt;&lt;/code&gt; locale into it. Open this file as a spreadsheet (such as in Excel or OpenOffice.org) and find the line with the word "Tax". Modify the value in the right column to be "GST". This will appropriately change the text that is displayed to the customer.&lt;/p&gt;&#10;&#10;&lt;b&gt;Rename Invoice to Tax Invoice&lt;/b&gt;&lt;br /&gt;&#10;&lt;p&gt;Similar to the above, you can edit the translation files to change the text "Invoice" to "Tax Invoice". This is left as an exercise for the reader.&lt;/p&gt;&#10;&#10;&lt;p&gt;After applying all of these changes you'll have addressed the essentials for running a Magento store in Australia. We recommend also installing our &lt;a href="https://github.com/fontis/fontis_australia"&gt;Magento Australian extension&lt;/a&gt;, which adds Australian regions, Australia Post shipping, direct deposit and BPAY payment methods. Also be sure to watch out for Magento Community Edition 1.4 as it includes several key improvements to the tax system to make working with discounts easier.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Fontis reCAPTCHA 2.0</title><link>https://fontis.au/blog/fontis-recaptcha-20/</link><pubDate>Tue, 20 Oct 2009 04:16:55 +0000</pubDate><guid>https://fontis.au/blog/fontis-recaptcha-20/</guid><description>&lt;div class="postContent std"&gt;&lt;h3&gt;What's New&lt;/h3&gt;&#10;&lt;p&gt;In addition to the usual bug fixes, we have added some great new features, such as:&lt;/p&gt;&#10;&lt;ul&gt;&#10; &lt;li&gt;New backend interface&lt;/li&gt;&#10; &lt;li&gt;reCAPTCHA on Product review form&lt;/li&gt;&#10; &lt;li&gt;New Magento-based reCAPTCHA theme&lt;/li&gt;&#10; &lt;li&gt;Multiple language support&lt;/li&gt;&#10; &lt;li&gt;Controller overriding redeveloped to minimise conflicts between different extensions&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h4&gt;New backend interface&lt;/h4&gt;&#10;&lt;p&gt;In the new version all reCAPTCHA related settings have been grouped into a single configuration area, which can be found in the Recaptcha section under a new Fontis Extensions tab. The screenshot below shows what settings can be adjusted.&lt;/p&gt;&#10; &#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/recaptcha-backend.png" alt="recaptcha backend settings" /&gt;&#10;&#10;&lt;h4&gt;New Magento reCAPTCHA theme&lt;/h4&gt;&#10;&lt;p&gt;The reCAPTCHA service comes with a number of themes. However, the reCAPTCHA block can often stand out too much if the design of the Magento site does not use similar colours. We have added a new Magento reCAPTCHA theme to address this. This theme uses the standard Magento CSS classes, so that the reCAPTCHA block blends in with the site design. The screenshot below shows the contacts form with the new Magento reCAPTCHA theme.&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/recaptcha-frontend.png" alt="recaptcha magento theme" /&gt;&#10;&#10;&lt;p&gt;Furthermore, the design of the reCAPTCHA block is now defined in a single file. If you would like to make changes, you only need to modify the following file:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;fontis&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;recaptcha&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;recaptcha&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;h4&gt;New method for controller overriding&lt;/h4&gt;&#10;&lt;p&gt;Some of the most common issues with the original version of Fontis reCAPTCHA were caused by controller overriding. In order to make the extension more robust and minimise conflicts with other extensions we have re-developed the Fontis reCAPTCHA controllers. In most cases we now only override the relevant action rather than the entire controller. As long as other extensions use the same method, conflicts will be limited only to instances where two extensions are accessing the same action.&lt;/p&gt;&#10;&#10;&lt;p&gt;By adding reCAPTCHA to your website, you can significantly reduce - if not eliminate - spam submissions to these forms. We hope that this new version of Fontis reCAPTCHA makes this process even easier and helps to protect your website. If you want to reduce the spam coming from your website, head over to the &lt;a href="https://github.com/fontis/fontis_recaptcha"&gt;reCAPTCHA extension page&lt;/a&gt; for a download link and set up instructions.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Add product custom options</title><link>https://fontis.au/blog/add-product-custom-options/</link><pubDate>Mon, 19 Oct 2009 07:15:00 +0000</pubDate><guid>https://fontis.au/blog/add-product-custom-options/</guid><description>This quick guide will explain how to properly access the Magento database using custom defined read and write connections following best practice, ensuring maintainability and better performance while future proofing your code.</description></item><item><title>Alternative Magento category tree structure</title><link>https://fontis.au/blog/alternative-magento-category-tree-structure/</link><pubDate>Fri, 16 Oct 2009 04:00:00 +0000</pubDate><guid>https://fontis.au/blog/alternative-magento-category-tree-structure/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The underlying issue is that the 'Default Category' is not easily accessible in code. For example, the default top navigation in Magento uses the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getStoreCategories&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method to access all categories. But that method starts by returning the 'Default Category' child categories and never returns the 'Default Category' itself. A solution to this is to add a subcategory, such as 'Products', under the 'Default Category' so that we can effectively treat the 'Products' category as the root of the category tree. Adding a 'Products' category means that any subsequent categories need to be subcategories of the 'Products' category. With this change the top level navigation will only show the 'Products' category. A sample category tree is shown below.&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/category_tree.png" alt="Sample category tree" /&gt;&#10;&#10;&lt;p&gt;Generally speaking, the primary reason for adding the 'Product' category is to enable direct access to the effective root category in code. One might want to add this flexibility, but still keep the usual behaviour for the top navigation. In that case the use of &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getStoreCategories&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; needs to be somewhat modified in:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;design&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;frontend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;navigation&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Any instance that looks as follows&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStoreCategories&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$_category&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php endforeach ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;needs to be changed to&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStoreCategories&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$default_category&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php if ($default_category-&amp;gt;getUrlKey() != &amp;#39;products&amp;#39;) { continue; } ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php foreach ($default_category-&amp;gt;getChildren() as $_category): ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt; ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php endforeach; ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&amp;lt;?php endforeach ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;With this change whatever code was in place of the ellipsis will still work without modification.&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;strong&gt;A word of caution regarding Magento categories:&lt;/strong&gt; In some circumstances, Magento can lose category associations in the backend - even though existing categories are still stored in the Magento database, the associations to those entries are lost. If this happens the Magento backend shows an empty category tree and the categories need to be added back in from scratch. As the associations are stored in the database, the safest approach is to backup the database before making any major changes to the category tree. If something does go wrong you can always revert to the backup and try again.&lt;/p&gt;&#10;&#10;&lt;p&gt;Using this alternative category layout, you will be able to use all of the relevant store categories for navigation, as well as be able to access them in code. You can also make use of this structure for adding in sibling categories to 'Products' that can be used for featured products, specials, clearance items, and so on. Finally, this approach also makes it possible to browse all products using layered navigation by setting &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;is_anchor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Yes&lt;/span&gt;&lt;/code&gt; on the new root category, something else which isn't possible using the default behaviour.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Melbourne Users Group</title><link>https://fontis.au/blog/magento-melbourne-users-group/</link><pubDate>Wed, 14 Oct 2009 06:00:00 +0000</pubDate><guid>https://fontis.au/blog/magento-melbourne-users-group/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Fontis is pleased to announce the official launch of the &lt;a href="http://magmug.net/"&gt;Magento Melbourne Users Group&lt;/a&gt; - MagMUG - and the inaugural meeting, taking place in two weeks time. MagMUG is an opportunity for anyone in the Melbourne area working with Magento to engage with others in the community.&lt;/p&gt;&#10;&lt;p&gt;Details of the first meeting can be found on the &lt;a href="http://magmug.net/2009/10/inaugural-meeting-oct-27th-7pm/"&gt;MagMUG site&lt;/a&gt;. At this stage, the plan is for meetings to be one hour long and consist of two presentations, followed by general discussion. The event will be informal and open to all, whether you are a store owner, administrator, user or developer, or just want to know more about Magento and the other people using it in the Melbourne area.&lt;/p&gt;&#10;&#10;&lt;p&gt;Fontis will kick off the presentations for the first meeting but we want to ensure MagMUG is inclusive, so we encourage anyone interested to let us know if you'd like to present at future meetings. We would also appreciate feedback and suggestions for topics that you'd like to see covered.&lt;/p&gt;&#10;&#10;&lt;p&gt;If you're planning to attend, let us know via &lt;a href="http://www.facebook.com/event.php?eid=184309646334"&gt;Facebook&lt;/a&gt;, &lt;a href="http://twitter.com/magmug"&gt;Twitter&lt;/a&gt;, or leave a comment on the MagMUG page, and we hope to see you there!&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Accessing product rating summaries</title><link>https://fontis.au/blog/accessing-magento-review-summaries/</link><pubDate>Tue, 13 Oct 2009 07:00:00 +0000</pubDate><guid>https://fontis.au/blog/accessing-magento-review-summaries/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Product ratings are an important tool for gaining credibility and driving sales in any online store, and are yet another powerful feature built-in to the Magento core. Ratings can be a valuable criteria to make visible to people browsing the site, so rather than hide them away on product pages only, it can be desirable to display rating summary data elsewhere, or to use the data in developing other custom functionality. Review summaries work a little differently to other product data, so this post will demonstrate how to access them.&lt;/p&gt;&#10;&lt;p&gt;First of all, load the product using the standard method of loading a model:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Next, we have to populate the product object with the review data as this is not automatically loaded as part of the above step. This is because the review information is a completely separate set of information, which needs to be loaded independently for a particular product.&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$storeId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;review/review&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getEntitySummary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$storeId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Now our product object contains review summary data, which can be accessed in a similar way to other product data:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$ratingSummary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRatingSummary&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;print_r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ratingSummary&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The code above will output something like:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;Array&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;primary_id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;entity_pk_value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;entity_type&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;reviews_count&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;rating_summary&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The most useful fields here are &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;reviews_count&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;rating_summary&lt;/span&gt;&lt;/code&gt;. &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;reviews_count&lt;/span&gt;&lt;/code&gt; is the number of approved reviews; pending reviews aren't counted. &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;rating_summary&lt;/span&gt;&lt;/code&gt; is the average score for all of the star ratings for all of the product's approved reviews. This is shown as a number out of 100, and the scores from pending reviews aren't counted.&lt;/p&gt;&#10;&lt;p&gt;To access these fields directly you can call their get methods:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRatingSummary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getReviewsCount&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRatingSummary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRatingSummary&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;One thing to remember is that the summary data is scoped to the store ID you specify. Reviews can be associated with one or more stores, and reviews that aren't associated with the store you specify won't be included when the summary is calculated.&lt;/p&gt;&#10;&#10;&lt;p&gt;Using the above methods, you should be able to make use of review summaries anywhere you like. For example, you may want to show a star rating on a featured product in a sidebar, or include the data in a customised product export. If you have reviews on a lot of products, also consider adding an option to &lt;a href=""&gt;sort categories by product ratings&lt;/a&gt;. By displaying a quick overview of the reviews for a product you can increase interest in that product and encourage further customer participation.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Oops, you are offline</title><link>https://fontis.au/offline.html</link><pubDate>Tue, 13 Oct 2009 07:00:00 +0000</pubDate><guid>https://fontis.au/offline.html</guid><description>&lt;p&gt;Please check your network connection and try again.&lt;/p&gt;</description></item><item><title>Adding order comments</title><link>https://fontis.au/blog/adding-order-comments/</link><pubDate>Mon, 12 Oct 2009 04:00:00 +0000</pubDate><guid>https://fontis.au/blog/adding-order-comments/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;For all orders, Magento keeps a &lt;i&gt;Comments History&lt;/i&gt; of all activity on that order. This allows an administrator to track changes that have been applied to the order status, as well as to attach comments for internal use or to be sent to the customer. If you are writing a custom extension that modifies orders then it's best to work within this system and to have your code update orders with the results of any processing done on them. This information can be invaluable for debugging and auditing purposes.&lt;/p&gt;&#10;&#10;&lt;p&gt;It's very easy to add comments to an order programmatically. First, you can use the Magento web services API to add a comment to an order:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Connect to the server&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;SoapClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;http://magento.example.com/index.php/api/soap/?wsdl&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;username&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;password&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Increment ID of the order to add the comment to&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrementID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;100000006&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Get the current status of the order&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;sales_order.info&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$orderIncrementID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;status&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Add the comment&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;sales_order.addComment&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;This is a new comment&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The &lt;a href="http://www.magentocommerce.com/wiki/doc/webservices-api/api/sales_order#sales_order.addcomment"&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;sales_order&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addComment&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; method takes four arguments. The first is the increment ID of the order to add the comment to - note that this is the increment ID (visible to the customer, 9 digits), not the internal Magento order ID. The next argument is the status of the order ('pending, 'processing', 'complete', etc). Whatever you set this to will become the order's new status, so be careful with this if you don't want to change it. In the code above, we check what the order's current status is and then supply this value as the status argument. The third argument is the comment text, and the last is a flag that determines whether Magento will email the comment to the customer associated with the order. In this example we don't want the comment sent to the customer, so it is set to false.&lt;/p&gt;&#10;&#10;&lt;p&gt;Comments can also be added from code that uses the internal Magento API directly:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Increment ID of the order to add the comment to&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$orderIncrementID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;100000006&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Get the order - we could also use the internal Magento order ID and the load() method here&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sales/order&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadByIncrementId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orderIncrementID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Add the comment and save the order&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addStatusToHistory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStatus&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Another new comment&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The logic here is very similar to the example using the web services API. Again, the first argument is the order status, and we set it to its existing value to avoid changing it. The second argument is the comment text, and the last controls whether to send an email to the customer.&lt;/p&gt;&#10;&#10;&lt;p&gt;Order comments can record extra information about the status of an order or actions that have been performed on it. An example of where this could be useful is to add a comment to an order when an external accounting or ERP system receives and processes it. They are very easy to add, so it's well worth creating them in your custom code to give administrators a complete history of all actions performed on that order.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Creating Magento products from a script</title><link>https://fontis.au/blog/creating-magento-products-from-a-script/</link><pubDate>Wed, 07 Oct 2009 04:00:00 +0000</pubDate><guid>https://fontis.au/blog/creating-magento-products-from-a-script/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Magento allows several different ways to add products to the catalog, including manual editing, upload via spreadsheet and the web services &lt;a href="http://www.magentocommerce.com/support/magento_core_api"&gt;Magento Core API&lt;/a&gt;. For developers who want to add products through PHP however, there are a few caveats to be aware of for the product to be displayed on the frontend.&lt;/p&gt;&#10;&#10;&lt;p&gt;The basics of adding a new product are trivial - you get a new copy of the appropriate model, fill in the details and call the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; method:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setSku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ABC123&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Type 7 Widget&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setDescription&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;This widget will give you years of trouble-free widgeting.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setShortDescription&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;High-end widget.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setPrice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;70.50&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setTypeId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;simple&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setAttributeSetId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// need to look this up&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setCategoryIds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;20,24&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// need to look these up&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setWeight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setTaxClassId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// taxable goods&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setVisibility&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// catalog, search&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// enabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// assign product to the default website&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setWebsiteIds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getWebsite&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;()));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The example above shows a minimal set of attributes you should be setting on a new product. If you run this code and look under Manage Products on the backend, you should see your new product. However, the real trick is making sure they appear on the frontend.&lt;/p&gt;&#10;&#10;&lt;p&gt;First of all, you need to make sure you set the product's visibility to something that includes 'catalog' (2 is catalog only, 4 is catalog and search results) and the product's status must be set to enabled (1). If you want the product to appear in one or more categories (which you usually do), the product's category IDs must be set correctly. Note that the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setCategoryIds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function takes a comma-separated string of category IDs, not an array. A category's ID can be found by viewing it in the Manage Categories screen on the backend. The product's attribute set ID should also be defined. You can get attribute set IDs by checking the URLs in Manage Attribute Sets (i.e. if the link to edit the 'Default' attribute set is &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;catalog_product_set&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;, then its ID is 4).&lt;/p&gt;&#10;&#10;&lt;p&gt;Even once all these settings are complete, the product will almost certainly not appear on the frontend. One other attribute must be set - the websites the product belongs to. This even has to be set if your Magento installation doesn't use multiple websites. The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setWebsiteIds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; line above assigns the product to the default website, which is sufficient for a single-website setup. Note that this method uses an array, unlike &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;setCategoryIds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;&#10;&#10;&lt;p&gt;The product should now be appearing on the frontend, but it will probably be showing up as 'Out of stock'. A product's inventory and stock options are contained in a separate object, rather than as part of the product itself. Adding the following code somewhere between the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; lines will allow you to set the stock data:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStockData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;qty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;is_in_stock&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;manage_stock&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;use_config_manage_stock&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStockData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$stockData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This code gets the product's stock and inventory options as an array, modifies them and then saves the array back to the object. The options should be self-explanatory - the important one is 'is_in_stock', which controls whether the product is in stock or not. The example above sets the product's 'Manage Stock' attribute to 'Yes' and un-ticks the corresponding 'Use Config Settings' checkbox, so the product will always track stock regardless of the global config setting. This is just an example, so be sure to set values appropriately for your store.&lt;p&gt;&#10;&#10;&lt;p&gt;Creating products from a script is quite easy, and using the internal Magento API can be faster and a lot more flexible than using the web services Magento Core API or an import profile and CSV file.&lt;p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Loading large collections</title><link>https://fontis.au/blog/loading-large-collections/</link><pubDate>Tue, 06 Oct 2009 03:45:00 +0000</pubDate><guid>https://fontis.au/blog/loading-large-collections/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Working with large Magento collections in PHP can often cause problems with memory usage and, to a lesser extent, computational overhead. The common method of loading all objects in the collection quickly becomes problematic as collection size increases. For stores with thousands of products or categories, chances are you'll be running into PHP memory limits more often than not. This post explains how to process collections in a less memory intensive way and should be a starting point for working with any large collection.&lt;/p&gt;&#10;&lt;p&gt;It's easy to tell when memory is becoming an issue as you'll see an error along the lines of:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Fatal error: Allowed memory size of &lt;span class="m"&gt;134217728&lt;/span&gt; bytes exhausted &lt;span class="o"&gt;(&lt;/span&gt;tried to allocate &lt;span class="m"&gt;49&lt;/span&gt; bytes&lt;span class="o"&gt;)&lt;/span&gt; in /var/www/magento/lib/Zend/Db/Statement/Pdo.php on line &lt;span class="m"&gt;294&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Often it is simple enough to increase the value of memory_limit using a &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;htaccess&lt;/span&gt;&lt;/code&gt; file or the system PHP configuration. However, as collection sizes grow, eventually you reach a point where this becomes unreasonable and there is a need to reduce the memory being used instead of trying to allocate more. In the following example I will be loading a product collection and processing each of the products in such a way that it should scale to almost any collection size with a reasonable amount of memory usage. Similar code will work for any kind of collection, such as products, categories, orders and so forth.&lt;/p&gt;&#10;&#10;&lt;p&gt;First, we'll begin by creating a callback function that will process each product and do something with the information. You can find more information about callbacks in the &lt;a href="http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback"&gt;PHP Manual&lt;/a&gt;. For this example I'll simply print out some basic details, along with an extra argument which is passed to the callback function (more on this later).&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;productCallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;row&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;arg1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getSku&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;: &amp;#39;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Note the use of &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;row&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/code&gt; to retrieve the product information. The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;row&lt;/span&gt;&lt;/code&gt; key will, as you would expect, contain the data for each row of the collection. In this case, the data maps to a product, so I have loaded it into a product object for easy processing.&lt;/p&gt;&#10;&#10;&lt;p&gt;Next, we set up the product collection to be processed. This code should be familiar to anyone who has worked with Magento collection objects before. One thing to keep in mind is that the attributes you select are important - only those that are explicitly selected will be available to use in the callback function.&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sku&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttributeToSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;name&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;short_description&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;description&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;price&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;image&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;status&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;manufacturer&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;, &amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;url_path&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;), &amp;#39;&lt;/span&gt;&lt;span class="nx"&gt;inner&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The final piece of code below is the key to reducing memory usage:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getSingleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;core/resource_iterator&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$products&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getSelect&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;productCallback&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;arg1&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;====&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Essentially what it does is steps through the results returned from the database one by one and sends each row to the callback function defined above. This is in contrast to loading all objects in the collection result all at once. Not loading objects individually saves memory by not loading in all the unneeded data, and also on processing time as there's a lot of logic involved in loading most objects.&lt;/p&gt;&#10;&#10;&lt;p&gt;Note that the second two arguments shown above are indirectly mapped to the &lt;a href="http://www.php.net/manual/en/function.call-user-func.php"&gt;call_user_func&lt;/a&gt; function in PHP. The first array is the callback function to use and the second array represents additional arguments to pass to the callback. I have used the example of a simple callback function that has an extra argument of &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;arg1&lt;/span&gt;&lt;/code&gt;. If you're using this code inside a class and want to use a class method for the callback instead of a function, you'll need to change the code to be:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getSingleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;core/resource_iterator&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$products&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getSelect&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;productCallback&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;arg1&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;====&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Excessive memory usage is something that we've run into frequently when working with large collections and I'm sure many others have as well. Hopefully the above code serves as a good starting point for developing your own solutions that minimise memory usage and improve performance.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento Connect 2.0 developer survey</title><link>https://fontis.au/blog/magento-connect-20-developer-survey/</link><pubDate>Mon, 05 Oct 2009 03:00:00 +0000</pubDate><guid>https://fontis.au/blog/magento-connect-20-developer-survey/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The &lt;a href="http://www.magentocommerce.com/magento-connect"&gt;Magento Connect&lt;/a&gt; system is a vital part of the Magento ecosystem and has had a lot of success since it launched a bit more than a year ago. As always, there is room for improvement and hence we were very glad to see Varien provide the community with an opportunity to participate in the future direction of the system by running two &lt;a href="&amp;#10;http://www.magentocommerce.com/blog/take-the-magento-connect-20-survey/"&gt;surveys&lt;/a&gt;, one for extension users, and one for extension developers. At the time of writing, we have fourteen community extensions and one commercial application listed on Connect, and the evolution of this service is something we have quite a few thoughts on. We completed the survey and thought we'd share our ideas on how 2.0 can take Connect to even greater heights. Read on for our suggestions from a developer perspective.&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/magento-connect-20-developer-survey/magentoconnect-20.jpg" alt="Magento Connect 2.0" /&gt;&#10;&#10;&lt;p&gt;One of the more interesting questions in the developer survey is &lt;i&gt;"What can Magento do to help you make more money selling Magento extensions?"&lt;/i&gt;, and one of the possible responses is &lt;i&gt;"Extension Certification"&lt;/i&gt;, which also seems to relate to a later question, &lt;i&gt;"Do you want Magento Connect to work more like the Apple iPhone Store?"&lt;/i&gt;. We're glad to see that moving to a certification model is at least being considered, since this may potentially address a number of problems relating to quality assurance. Developers can always distribute and list their extensions elsewhere, but Connect is (at present) probably the most visible way to get your work out to users, and therefore it's important that it isn't too difficult to get extensions listed. However, a certified model doesn't necessarily need to mean certified extensions only, and a hybrid model could be used whereby extensions could be classified as either certified or uncertified. This might be a good compromise between a way for buyers to purchase certified extensions with more confidence, while also still keeping the bar low for other developers to easily submit uncertified extensions.&lt;/p&gt;&#10;&#10;&lt;p&gt;Somewhat related to the above is the question &lt;i&gt;"Would you like Magento Connect to handle licensing, rights management (DRM), activation, payment transaction at purchase, etc.?"&lt;/i&gt;. I interpret this to be asking whether developers would like Varien to support an end-to-end system for the sale and distribution of extensions (who knows, it might even run on Magento itself!). It's the licensing part of this equation that may be problematic - there have already been a number of &lt;a rel="nofollow" href="http://activecodeline.com/building-magento-business-by-stealing-stuff-asia-connect-com-vn-knows-how/"&gt;copyright and licensing infringement allegations&lt;/a&gt; made relating to Magento extensions, and while it is understandable that Varien is reluctant to take on the role of policing the matter, it seems reasonable to expect there to be some sort of process in place for handling these issues, particularly if any payment was made for commercial listings.&lt;/p&gt;&#10;&#10;&lt;p&gt;As for the actual implementation of the Connect system and website, we'd love to see the following taken into consideration:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Discussion - As a Magento extension maintainer, it's currently very challenging to track discussion around your extensions listed on Connect. To begin with, there are 5 discussion forums created for each extension plus one stream of reviews. The choice of sub-forum categories is sane (bugs, feature requests, patches, documentation, and general discussion) but in practice these forums don't seem to get the traffic to justify the segmentation. While there are RSS feeds for each forum, unfortunately the RSS is invalid while the forum has no threads, and reading six feeds to keep on top of things is harder than it should be anyhow. Having a single discussion forum that is clearly visible on the extension page and provides a single RSS feed would be one way to make it easier for users and maintainers to keep up with the discussion.&lt;/li&gt;&#10;&lt;li&gt;Reviews - If reviews are going to be brought back (they were disabled some time ago), then they should be moderated. They should not be a support channel, and should be used only to review the extension, rather than flame the author, complain about the price, or engage in other behaviours that I'm assuming led to the reviews being closed in the first place. The reviews are positioned quite prominently compared to the forums, which may have been why comments and support requests were posted there instead. Perhaps the reviews should be merged into the general discussion to reduce the temptation for people to try and game the system to get more exposure, or to spuriously vote other's work down (did anyone else ever release an extension only to see it rated one star with no review before it had even been downloaded?).&lt;/li&gt;&#10;&lt;li&gt;Encoding - Some commercial extensions are encoded using ionCube encoder or similar. While I respect those developers choice to do so, it would be helpful to include a flag indicating that the extension contains encoded PHP since some users will require that the source code is available; this is after all one of the key benefits of using Magento in the first place.&lt;/li&gt;&#10;&lt;li&gt;Moderation - Claims of copyright infringement and license violations, or practices such as repackaging a community extension and selling it as a commercial one, are concerning. A process for handling these disputes should be developed along with a way to flag an extension for review and lodge a complaint. It's an unfortunate reality that this problem is unlikely to go away, and it hurts the Magento developer community not to have a way of dealing with it.&lt;/li&gt;&#10;&lt;li&gt;Contributors - Being able to allow multiple contributors for an extension could help reduce fragmentation and the urge for people to fork extensions rather than contribute back to the original. At the moment, the fact that only one author can be recognised as an extension's author is a factor in people choosing to republish modified or updated extensions as their own.&lt;/li&gt;&#10;&lt;li&gt;Direct download - For convenience, it would be useful to have a link to the extension tarball rather than just the key for use with PEAR.&lt;/li&gt;&#10;&lt;li&gt;Versioning - The Magento compatible version field would be more useful if it wasn't free-form text. A standard way of indicating a particular version or range of versions supported could facilitate improved search and browsing criteria. If version compatibility was also tied to each release rather than the extension overall, then it would be possible for users who are behind the latest Magento core release to find and download an older version of an extension from the release archive that is still compatible (though probably unsupported).&lt;/li&gt;&#10;&lt;li&gt;Search - A better search facility for Connect would allow you to specify category, type, stability, version compatibility, whether encoded, etc.&lt;/li&gt;&#10;&lt;li&gt;Update notifications - It would be very useful for extension users to be able to subscribe for notifications of new releases. Some extension developers are using the built-in Magento message notification system to push update notifications, however it would be good to have a less intrusive method that doesn't also rely on the extension being installed and activated.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;They're our thoughts on where we'd like to see Magento Connect headed, but we'd be very interested to hear other people's thoughts too.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Custom Magento error page</title><link>https://fontis.au/blog/custom-magento-error-page/</link><pubDate>Thu, 03 Sep 2009 05:45:50 +0000</pubDate><guid>https://fontis.au/blog/custom-magento-error-page/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Sometimes, the unthinkable happens and an error occurs in your Magento system, causing everything to come grinding to a halt. Magento handles this by displaying a styled error page, which is better looking than a white page full of error text. However, the error page still doesn't look very professional, and potentially discloses information that could be abused by a malicious user. This post details a method for using a custom error page, and outlines some of the benefits of doing so.&lt;/p&gt;&#10;&#10;&lt;p&gt;Here is an example of the standard Magento error page:&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/custom-magento-error-page/standard-error-page.png" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;The method we will use for a customised error page relies on the Apache web servers rewrite rules - if &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;mod_rewrite&lt;/span&gt;&lt;/code&gt; is not enabled then this won't work (see our &lt;a href="https://fontis.au/blog/definitive-installation-guide"&gt;post on installing Magento&lt;/a&gt; for more information about &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;mod_rewrite&lt;/span&gt;&lt;/code&gt; ). The basic idea is to rewrite any URL in the report directory to display a specific error page which you define. This allows you to create a more friendly message for users who have been unfortunate enough to run into an error.&lt;/p&gt;&#10;&#10;&lt;p&gt;First, create a &lt;code class="code-inline language-php"&gt;&lt;span class="mf"&gt;503.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;/code&gt; page in your document root (usually a &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;public_html&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; or &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directory), or some other area the web server has access to, such as the Magento root directory. This should probably be a static HTML page rather than anything dynamic (i.e. PHP) to minimise the chance of the problem also preventing the error page from being served!&lt;/p&gt;&#10;&#10;&lt;p&gt;Next, add the following rule to the start of your Magento .htaccess file:&lt;/p&gt;&#10;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;ErrorDocument&lt;/span&gt; &lt;span class="mi"&gt;503&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;503.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;/code&gt;&#10;&#10;&lt;p&gt;Then, place this rule:&lt;/p&gt;&#10;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;RewriteRule&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;/.*&lt;/span&gt; &lt;span class="mf"&gt;503.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/code&gt;&#10;&#10;&lt;p&gt;into the following code like so:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;############################################&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## you can put here your magento root folder&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## path relative to web root&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;#RewriteBase /magento/&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;############################################&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## rewrite errors to 503 error document&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; RewriteRule ^report/.* 503.html &lt;span class="o"&gt;[&lt;/span&gt;L,R&lt;span class="o"&gt;=&lt;/span&gt;503&lt;span class="o"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;############################################&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## workaround for HTTP authorization&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;## in CGI environment&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This will then redirect any requests for an error report page using a 503 response code (Service Unavailable) and display the &lt;code class="code-inline language-php"&gt;&lt;span class="mf"&gt;503.&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;/code&gt; page in place of the standard Magento page. It should be noted that returning a 503 status code will also tell robots &lt;em&gt;not&lt;/em&gt; to index the page content and to check again later, which means that your search engine rankings won't be affected.&lt;/p&gt;&#10;&#10;&lt;p&gt;The end result is that you can serve any visitor unlucky enough to encounter an error with something more friendly than the default error page, like this:&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/custom-magento-error-page/nice-error-page.png" /&gt;&#10;&#10;&lt;p&gt;For developers that still need to access the error reports, they can still be found in the &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;/code&gt; directory off the Magento root - the filename will correspond with the id value in the error report URL requested. Alternatively, you can set up the system to email you whenever an error occurs by changing the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; file like so:&lt;/p&gt;&#10;&#10;&lt;p&gt;Change:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/code&gt; &#10;&lt;p&gt;to&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/code&gt; &#10;&lt;p&gt;Now add in your email address to&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;email_address&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;email_address&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/code&gt;&#10;&#10;&lt;p&gt;By creating your own custom error page, you can have complete control over what visitors will see should a problem arise, rather than disclosing the internal details of your Magento installation and leaving the visitor with a less professional impression of the site.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Preventing PO Box shipping addresses</title><link>https://fontis.au/blog/preventing-po-box-shipping-addresses/</link><pubDate>Mon, 24 Aug 2009 00:44:20 +0000</pubDate><guid>https://fontis.au/blog/preventing-po-box-shipping-addresses/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Recently, I wrote a blog post about &lt;a href="https://fontis.au/blog/preventing-po-box-customer-addresses"&gt;preventing PO box customer addresses&lt;/a&gt; being registered at checkout. Following on from that post, I was asked a rather sensible question: "is it possible to disallow PO boxes for shipping, but allow them for billing?" The answer is yes, but it does require a few more modifications to Magento.&lt;/p&gt;&#10;&#10;&lt;p&gt;As mentioned in the original post, the if statements with regular expressions required to block PO boxes and locked bags are as follows:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/p\.* *o\.* *box/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot ship to PO boxes.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;and&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/locked *bag/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot ship to locked bags.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Unlike in my original post, we need to add these in a new validation function, which we will only use for validating shipping addresses. In the file:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;Abstract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;simply make a copy of the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function, name it something like &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validate_pobox&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; and insert the above code as before. The result should look something like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;validate_pobox&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;customer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;implodeStreetAddress&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getFirstname&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter first name.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getLastname&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter last name.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter street.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/p\.* *o\.* *box/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot ship to PO boxes.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/locked *bag/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot ship to locked bags.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCity&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter city.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getTelephone&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter telephone.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getPostcode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter zip/postal code.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCountryId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter country.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCountryModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRegionCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getSize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRegionId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter state/province.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Now that we have the necessary validation function, we need to ensure that it is used instead of the default function in the checkout module. The file to be modified is this one:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;In the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file we need to modify three functions:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveBilling&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;saveShipping&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validateOrder&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The first function requires a small block of code to be added, while the last two just need the instance of &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; changed to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validate_pobox&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;. To avoid ambiguities, I have attached the modified &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Onepage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file. Simply download the file and search for 'TODO', as I have wrapped all three of the required changes in comments that start with the word 'TODO'.&lt;/p&gt;&#10;&#10;&lt;p&gt;Finally, the standard warning about modifying core files applies here as well. Rather than directly modifying core files make copies of the affected files before modifying them and place them in the local directory.&lt;/p&gt;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.3&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento version(s):&lt;/td&gt;&#10;&lt;td&gt;1.3.2.3&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Online Retailer Expo &amp; Conference 2009</title><link>https://fontis.au/blog/online-retailer-expo-conference-2009/</link><pubDate>Thu, 30 Jul 2009 03:41:43 +0000</pubDate><guid>https://fontis.au/blog/online-retailer-expo-conference-2009/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Online retailing is a rapidly growing market and it is becoming an increasing necessity for anyone in retail in the 21st century to establish an online presence. Recognising this, National Media, a specialist B2B media and marketing company, are holding the inaugural &lt;a href="http://www.online-retailer.com.au/"&gt;Online Retailer Expo &amp; Conference&lt;/a&gt;, which will focus on the state of eCommerce in Australia. It will also be a chance for retailers and vendors to make connections, share knowledge and ideas, and explore new business opportunities.&lt;/p&gt;&#10;&#10;&lt;p&gt;Fontis is pleased to announce that we will be exhibiting at this event, which will take place at the &lt;a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Sydney+Convention+%26+Exhibition+Centre%E2%80%8E,+Darling+Drv+Darling+Harbour+NSW+2000,+Australia&amp;sll=-33.867912,151.19889&amp;sspn=0.015376,0.033023&amp;ie=UTF8&amp;ll=-33.873052,151.197925&amp;spn=0.00791,0.016512&amp;z=17&amp;iwloc=A"&gt;Sydney Convention &amp; Exhibition Centre&lt;/a&gt; on August 18th and 19th 2009. If you're interested in Magento or any of the other services and solutions we provide, drop by our booth and say hello. We'll have Magento demonstrations and materials available throughout the exhibition, and would be happy to chat about how we can help you grow your business online.&lt;/p&gt;&#10;&#10;&lt;p&gt;A map of the event with the location of the Fontis booth (number 6) can be found below:&lt;/p&gt;&#10;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/online-retailer-expo-conference-2009/or-floorplan.png" /&gt;&#10;&#10;&lt;p&gt;Tickets to the exhibition (not the conference) are free until July 31st, so get in quick for free entry to the event. If you miss out, please &lt;a href="https://fontis.au/contact-us/"&gt;contact us&lt;/a&gt; to organise tickets.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Internet Explorer 6 Browser Sniffing</title><link>https://fontis.au/blog/internet-explorer-6-browser-sniffing/</link><pubDate>Fri, 17 Jul 2009 07:02:19 +0000</pubDate><guid>https://fontis.au/blog/internet-explorer-6-browser-sniffing/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Sometimes to make advances in software one must break backwards compatibility. Nowadays, Internet Explorer 6 (IE6) is a dinosaur of a browser. It's slow, non-standards compliant, lacks features and is a pain to develop for. As web developers, time constraints and other considerations frequently mean it's just not worth putting in the extra development effort to support it. In those cases, we will want to detect those visitors using IE6 as their browser so that we might explain that it is not supported and offer an alternative. Detecting the browser being used is known as "browser sniffing", and there are a number of methods that can be used.&lt;/p&gt;&#10;&#10;&lt;p&gt;Both Facebook and YouTube detect IE6 users. Currently Facebook is warning users that less features and functionality will be available when browsing with IE6. While YouTube warns that their support for IE6 will soon come to an end.&lt;/p&gt;&#10;&#10;&lt;p&gt;When is it appropriate to drop support for IE6? Deciding whether to support it really comes down to demographics. What are the majority of end-users browsing your site with? Larger corporations may still depend upon web applications written specifically for IE6, and may not support a choice of other browsers. So while it won't always be viable, if your demographic is skewed towards more technical or net savvy audiences, then they may be more likely to have a choice in which browser they are using. In this case it may well be appropriate to gently push IE6 users towards adopting a supported browser by redirecting them to a page explaining the circumstances and offering alternatives. &lt;/p&gt;&#10;&#10;&lt;p&gt;This article will examine a couple of ways of achieving that goal.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Server-side Detection&lt;/h3&gt;&#10;&#10;&lt;p&gt;The first option is attempting to detect the user's browser as they access your server. Unfortunately this is not a simple task. &lt;/p&gt;&#10;&#10;&lt;p&gt;Some time ago Microsoft attempted to maintain a database of information to track user agent strings (the signatures of web browsers) being used on the internet to provide a more accurate approach to detecting the end-user's browser. It was called Browscap, and worked via two database files: browscap.dll and browscap.ini. The project was eventually discontinued, but thankfully &lt;a href="http://browsers.garykeith.com/index.asp"&gt;Gary Keith&lt;/a&gt; has taken it upon himself to maintain those database files for everyone's benefit. He does so by accessing the user agent string logs of a variety of web servers on a weekly basis, mashing the information together, with massaging the results into a more comprehensive version of Browscap.&lt;/p&gt;&#10;&#10;&lt;p&gt;We'll be looking at browscap.ini and how it is relevant to PHP and Linux servers. As luck would have it, there is a &lt;a href="http://code.google.com/p/phpbrowscap/"&gt;PHP Browscap Google Code project&lt;/a&gt; to make it a simple stand-alone package. To combine these resources, we can add some "sniffing" to the beginning of an index.php file. This way, users with IE6 can be redirected before the real content of your site begins to load. Here's an example:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/* Detecting IE6 */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Browscap.php&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$bc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Browscap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;browscap_cache&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$bc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;localFile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;php_browscap.ini&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$bc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getBrowser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$browser&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Browser&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;IE&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$browser&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;MajorVer&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/* IE6 Detected! */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Looks like Internet Explorer 6!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="cm"&gt;/* Detecting IE6 */&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;Looks like you&amp;#39;re not stuck in the middle-ages!&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;As you can see, users with Internet Explorer 6 will see the text "Looks like Internet Explorer 6!" - this is just a placeholder, and can be replaced with code to redirect the user to a web page recommending they upgrade their web browser to something more recent such as Mozilla Firefox, Opera, Apple's Safari and so forth.&lt;/p&gt;&#10;&#10;&lt;p&gt;There you have it, a robust server-side detection method for IE6. What if we want to add an extra layer of protection, or an alternative to a server-side check? We can do this too, using JavaScript. Different browsers have different implementations of the JavaScript specification, and thus there are variations that can identify a particular version. If we attempt an action in JavaScript which we know will fail only in a particular implementation, then we can differentiate that browser from others.&lt;/p&gt;&#10;&#10;&lt;h3&gt;Client-side Detection&lt;/h3&gt;&#10;&#10;&lt;p&gt;In JavaScript there is an implicit object called the DOM, which we manipulate to influence the web browser's rendering of the page. That DOM object is what the HTML of the website was interpreted into. Modern browsers recognise that the DOM object, globally recognised in the JavaScript namespace as 'document', has a sub-element 'body', which has a sub-element 'style', which has a sub-element 'maxHeight'. However, IE6 does not implement this sub-element and therefore will fail a test that checks whether that object is "defined". Here's an example:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxHeight&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;undefined&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// IE 7, mozilla, safari, opera 9&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// IE6, older browsers&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;upgrade-your-browser.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;JavaScript's window.location object allows us to redirect the user. In the above case, this is sending a user to a web page called "upgrade-your-browser.html". This page can provide the user with links to other possible browsers.&lt;/p&gt;&#10;&#10;&lt;h3&gt;The Big Picture&lt;/h3&gt;&#10;&#10;&lt;p&gt;The following diagram shows the relationship of the client and server - and where the two different checks are occurring.&lt;/p&gt;&#10;&#10;&lt;p style="text-align: center;"&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/internet-explorer-6-browser-sniffing/server_diagram_0.png" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;Striking a balance in browser detection is very important. It's good to detect users of a browser if your site does not support that browser. However, browser detection can open up another can of worms - false positives. What if your detective work is somehow broken and users of the Mozilla Firefox web browser are being considered Internet Explorer users?&lt;/p&gt;&#10;&#10;&lt;p&gt;Mitigating that risk requires better detection - to contain the risk we should endeavour to provide the user with options:&lt;/p&gt;&#10;&#10;&lt;ul&gt;&#10; &lt;li&gt;Present the user with an option to 'browse the site anyway'. Hence, we allow the user to override the problem.&lt;/li&gt;&#10; &lt;li&gt;Provide the user with a web form to submit to if they believe they have been 'wrongly detected' by our system.&lt;/li&gt;&#10; &lt;li&gt;Provide a contact email if not a web form.&lt;/li&gt;&#10; &lt;li&gt;And, &lt;strong&gt;always&lt;/strong&gt; provide links to alternative web browsers.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;p&gt;Frustrating a user by denying them access and not providing them options is a big mistake. In fact, when writing the text that denies the user access, you could try being light-hearted, as in this example:&lt;/p&gt;&#10;&#10;&lt;p style="text-align: center;"&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/internet-explorer-6-browser-sniffing/browser-denial-page-2.png" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;To help you on your way I've attached a zip file of the Browscap files described in this tutorial, as well as the index.php file. Furthermore, I have added a zip file of some nice glossy web browser icons to help make your 'denial page' a bit prettier (original source of these icons was &lt;a href="http://www.tothepc.com/archives/glossy-web-browser-icons-free-download/"&gt;tothepc.com&lt;/a&gt;)&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento CMS static blocks</title><link>https://fontis.au/blog/magento-cms-static-blocks/</link><pubDate>Tue, 14 Jul 2009 07:42:31 +0000</pubDate><guid>https://fontis.au/blog/magento-cms-static-blocks/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Static blocks in Magento are a useful way of making elements of your site easily configurable by administrators. If you have sidebar blocks, headers or other elements that can change from time to time, using a static block can be easier in the long run than hard-coding them.&lt;/p&gt;&#10;&#10;&lt;p&gt;Static blocks are very simple to create. In the admin backend, just go to the CMS menu and select Static Blocks. Click on the Add New Block button to create a new block. The fields for a static block are also very simple - you can give the block a title (used to distinguish blocks in the backend) and you can select whether it is enabled or not. The Content field is where you can enter your block HTML. You can use Magento template placeholders in this field (i.e. &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fontis&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;com&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;au&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;skin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;frontend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;/...&lt;/span&gt;&lt;/code&gt;).&lt;/p&gt;&#10;&lt;p&gt;The Identifier field assigns the block a name that Magento will use to refer to it. You can also select what store views the block will appear in. You can combine this with the Store Views field to create different versions of a block for different stores. For example, say you have two different store views for two different countries (e.g. Australia and the US), and you have a block containing contact details that vary from country to country (such as phone numbers). If you create a block with the identifier 'contact' and set its store view to the Australian store view, then create a second block that also has the identifier 'contact' but set its store view to the US store, the appropriate block will be used on each store.&lt;/p&gt;&#10;&lt;p&gt;Once you have created a static block, you need to tell Magento to actually put it somewhere. Certain other Magento configuration sections can use static blocks (such as the catalog category properties, as seen in the &lt;a href="http://www.magentocommerce.com/media/screencasts/static-blocks/view"&gt;Magento static blocks screencast&lt;/a&gt;), but you can also include them directly in a number of other ways.&lt;/p&gt;&#10;&lt;p&gt;If you want to include a static block inside another static block or CMS page, you can use a Magento template placeholder (replace '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;IDENTIFIER&lt;/span&gt;&lt;/code&gt;' with the static block identifier):&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;This is some CMS page text. A static block goes below this:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;{{&lt;/span&gt;block &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cms/block&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;block_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;IDENTIFIER&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;More text after the block...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&#10;You can also include a static block from a layout XML file (replace '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;BLOCK_NAME&lt;/span&gt;&lt;/code&gt;' and '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;IDENTIFIER&lt;/span&gt;&lt;/code&gt;' with appropriate values - the block name just needs to be unique). If you open any Magento layout files, you can see where the blocks are defined; you can add your own blocks after the existing ones. The '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;before&lt;/span&gt;&lt;/code&gt;' and '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;after&lt;/span&gt;&lt;/code&gt;' attributes indicates where your static block appears relative to other blocks in the same layout section.&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;block&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;cms/block&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;BLOCK_NAME&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;after=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;cart_sidebar&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;action&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;setBlockId&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;block_id&amp;gt;&lt;/span&gt;IDENTIFIER&lt;span class="nt"&gt;&amp;lt;/block_id&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/action&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/block&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;&#10;Finally, you can include a static block directly from a template PHP file (again, replace '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;IDENTIFIER&lt;/span&gt;&lt;/code&gt;'):&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Template&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getLayout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;createBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;cms/block&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setBlockId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;IDENTIFIER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;toHtml&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;More template text under block...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Magento on the Mac</title><link>https://fontis.au/blog/magento-on-the-mac/</link><pubDate>Mon, 13 Jul 2009 07:07:47 +0000</pubDate><guid>https://fontis.au/blog/magento-on-the-mac/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Magento is a web-based application, and therefore Magento development is thankfully not limited to any particular platform or operating system. As a Mac user I prefer to do my Magento development on my Mac. In setting up my development environment, I discovered that there are very few useful resources out there for other developers looking to do the same. So hopefully this post will serve as a start for others looking to do the same.&lt;/p&gt;&#10;&#10;&lt;p&gt;Even though OS X comes with Apache and PHP, both of those tend to be a little out of date and it is generally easier to just install a MAMP (&lt;a href="http://en.wikipedia.org/wiki/MAMP"&gt;http://en.wikipedia.org/wiki/MAMP&lt;/a&gt;) rather than individually setting up PHP and MySQL. The MAMP package that I have been using can be found here: &lt;a href="http://www.mamp.info"&gt;http://www.mamp.info&lt;/a&gt; (&lt;a href="http://sourceforge.net/projects/mamp/"&gt;download link&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;I found the following benefits in using this particular MAMP package:&#10;&lt;ul&gt;&#10; &lt;li&gt;easy to install and set up&lt;/li&gt;&#10; &lt;li&gt;no system files are changed&lt;/li&gt;&#10; &lt;li&gt;easy to delete since everything is in one directory&lt;/li&gt;&#10; &lt;li&gt;easy to start/stop the Apache and MySQL servers&lt;/li&gt;&#10; &lt;li&gt;meets all Magento pre-requisites&lt;/li&gt;&#10; &lt;li&gt;comes with a couple of PHP caching extensions pre-installed&lt;/li&gt;&#10; &lt;li&gt;phpmyadmin is pre-installed&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;To install, you should simply extract the zip file into the Applications directory. Please note that in order for this MAMP stack to work, it must be located in the Application directory. Once installed, opening the file called 'MAMP' in the MAMP directory will bring up a Preferences Panel.&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/magento-on-the-mac/mamp.png" /&gt;&#10;&lt;p&gt;There you can change the preferences associated with the running of the MAMP package. It also comes with a widget, which allows for quick starting and stopping of Apache and MySQL. By default, Apache runs on port 8888 and MySQL on port 8889. You can change the ports at any time under Preferences &amp;gt; Ports.&lt;/p&gt;&#10;&#10;&lt;p&gt;Before you can install a local copy of Magento, you will need to setup a database. Fortunately, this MAMP package comes with phpmyadmin pre-installed, which makes that task very simple. To get to phpmyadmin, click 'Open start page' either on the widget or in the Preferences Panel. That will take you to this page:&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/magento-on-the-mac/window.png" /&gt;&#10;&lt;p&gt;which you can also reach by entering the following url: &lt;a href="http://localhost:8888/MAMP/"&gt;http://localhost:8888/MAMP/&lt;/a&gt;. However, the apache server must be running in order to do this, so make sure you click 'Start servers' first.&lt;/p&gt;&#10;&lt;p&gt;To create a database for Magento follow these steps:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;On the phpmyadmin start page click &lt;span class="s1"&gt;&amp;#39;Privileges&amp;#39;&lt;/span&gt;.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Click &lt;span class="s1"&gt;&amp;#39;Add a new User&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Fill in the following:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;User name:&lt;span class="s1"&gt;&amp;#39;Use text field:&amp;#39;&lt;/span&gt; magento&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Host: &lt;span class="s1"&gt;&amp;#39;Local&amp;#39;&lt;/span&gt; localhost&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password: &lt;span class="s1"&gt;&amp;#39;Use text field:&amp;#39;&lt;/span&gt; -enter your password-&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Re-type: -enter your password-&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Under &lt;span class="s1"&gt;&amp;#39;Database for user&amp;#39;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Generate database with same name and grant all privileges&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Click &lt;span class="s1"&gt;&amp;#39;Go&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Once you have created a database, you need to &lt;a href="http://www.magentocommerce.com/download/noregister"&gt;download Magento&lt;/a&gt;. Extract the Magento zip file into the following directory:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Applications&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;MAMP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;htdocs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;If you want to use another directory you can set a different 'Document Root' in the Preferences Panel. To install Magento open &lt;a href="http://localhost:8888"&gt;http://localhost:8888/magento&lt;/a&gt;, provided that you are still using the default '8888' port. Just follow the instructions provided by the installation script to complete the installation. When you are entering the database information make sure that you change 'localhost' to 'localhost:8888' or whatever port number you are using. Also enter the database name, mysql user and the mysql user password, all of which you would have created in the phpmyadmin steps above.&lt;p&gt;&#10;&lt;p&gt;Once the installation is completed you will be able to load your local copy of Magento with the following url: &lt;a href="http://127.0.0.1:8888/magento"&gt;http://127.0.0.1:8888/magento&lt;/a&gt;. Note that when it comes to Magento it is important to use '127.0.0.1' instead of 'localhost' when accessing via a browser, since otherwise the Magento admin panel may not load.&lt;/p&gt;&#10;&lt;p&gt;You should now be all set to start developing for Magento on your Mac.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Debugging Magento with Xdebug</title><link>https://fontis.au/blog/debugging-magento-with-xdebug/</link><pubDate>Tue, 07 Jul 2009 07:25:25 +0000</pubDate><guid>https://fontis.au/blog/debugging-magento-with-xdebug/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Diagnostic &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;print_r&lt;/span&gt;&lt;/code&gt; statements and logging might be quick and easy tools for investigating what Magento is doing, but a full debugger offers a lot more power and flexibility. This post demonstrates how to set up the xdebug debugger for use with the vim editor.&lt;/p&gt;&#10;&#10;&lt;p&gt;First of all, I'd like to thank Box.net for their great &lt;a href="http://tech.blog.box.net/2007/06/20/how-to-debug-php-with-vim-and-xdebug-on-linux/"&gt;Xdebug tutorial&lt;/a&gt;. Check it out for a more in-depth look at using Xdebug and vim.&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;To start, install the Xdebug PHP extension on your server. Note that this has to be installed as a Zend extension, not a normal PHP extension. You can obtain the Xdebug extension from &lt;a href="http://www.xdebug.org"&gt;xdebug.org&lt;/a&gt;, or you can install it via your package manager on a Linux system. On a Debian-based system, use:&lt;p&gt;&#10;&lt;code class="code-inline language-bash"&gt;apt-get install php5-xdebug&lt;/code&gt;&#10;&lt;p&gt;Edit your PHP config file and make sure you have the following settings. The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;zend_extension&lt;/span&gt;&lt;/code&gt; line may point to a different location for your system. (If you have installed Xdebug using a package manager they may already be set up for you.)&lt;/p&gt;&#10;&lt;code class="code-inline language-bash"&gt;&lt;span class="nv"&gt;zend_extension&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; /usr/lib/php5/20060613+lfs/xdebug.so&#10;xdebug.remote_enable &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&#10;xdebug.remote_port &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;9000&lt;/span&gt;&#10;xdebug.remote_host &lt;span class="o"&gt;=&lt;/span&gt; localhost&lt;/code&gt;&#10;&lt;p&gt;Restart your web server once Xdebug has been installed.&lt;/p&gt;&#10;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&#10;&#10;&lt;li&gt;&#10;&lt;p&gt;Get the &lt;a href="http://www.vim.org/scripts/script.php?script_id=1929"&gt;DBGp vim script&lt;/a&gt;. This will allow vim to act as a debugging client for anything supporting the DBGp protocol - such as Xdebug. Create a &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vim&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;plugin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directory in your home directory on the server if it doesn't already exist, and extract the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;debugger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;py&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;debugger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vim&lt;/span&gt;&lt;/code&gt; files into it.&lt;/p&gt;&#10;&lt;p&gt;Note that for this to work, your vim installation must be compiled with Python support. If you've installed a standard vim package from a package manager you'll probably already have this; if not, install a 'full' vim package rather than a minimal one. To check, type &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;/code&gt; in vim command mode; you should see &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;python&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;signs&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;These instructions also assume you're running the web server and debug client (vim) on the same machine. If you want to run the debug client on a different machine, you can adjust the xebug.remote_host PHP setting above.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;&#10;&lt;p&gt;If you're using Firefox, get the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/3960"&gt;Xdebug Helper&lt;/a&gt; Firefox extension. This provides you with a small Xdebug icon that lets you turn the Xdebug headers on or off. This appears as an X-in-a-circle logo at the bottom-right of your Firefox window; click on it to turn Xdebug on (the icon will turn yellow-green).&lt;/p&gt;&#10;&lt;p&gt;If you're not using Firefox, you can turn Xdebug on by appending &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;XDEBUG_SESSION_START&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt; as a URL parameter. For example, &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;magentostore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;hats&lt;/span&gt;&lt;/code&gt; would become &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;magentostore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;hats&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="nx"&gt;XDEBUG_SESSION_START&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;&#10;&lt;p&gt;Once you've got Xdebug started in your browser, either by turning it on using the Firefox extension or by appending to the URL, run vim. Press F5 and you should get a notice saying &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;waiting&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;connection&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;9000&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="nx"&gt;seconds&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;/code&gt;. Once you see that, you have five seconds to start a debugging session by sending an Xdebug-enabled request from your browser. Type in the URL you want in your browser, switch to vim, hit F5, then quickly switch to your browser and go to the URL. If you don't get it in time, you'll see a message saying &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Connection&lt;/span&gt; &lt;span class="nx"&gt;closed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;stop&lt;/span&gt; &lt;span class="nx"&gt;debugging&lt;/span&gt;&lt;/code&gt;. If this happens, restart vim and try again. If you do get it, you'll see a number of vim windows open and see a message saying:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;connection&lt;/span&gt; &lt;span class="nx"&gt;from&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;44027&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;span class="nx"&gt;Press&lt;/span&gt; &lt;span class="nx"&gt;ENTER&lt;/span&gt; &lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;command&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;/code&gt;&#10;&lt;/li&gt;&#10;&#10;&lt;li&gt;&#10;&lt;p&gt;Once you have the debugging session up, you can start stepping through the code class="code-default", setting breakpoints, inspecting variables and everything else you would normally do with a debugger. A full description of how to use a debugger is a bit beyond this article, but here's a quick summary:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The current PHP source file is shown on the left; the current line is highlighted in red.&lt;/li&gt;&#10;&lt;li&gt;Use F2 to step into function calls and F3 to step over them.&lt;/li&gt;&#10;&lt;li&gt;Breakpointed lines are shown by being highlighted in green. Use the :Bp command to set a breakpoint on the current line. You can open new source files using the :e command, (i.e. &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;), set a breakpoint in them using :Bp and then press F5 to continue execution until the next breakpoint.&lt;/li&gt;&#10;&lt;li&gt;Use F11 to dump all current context (i.e. function variables) to the window at the top-right. Use F12 to see what's in the PHP variable under the cursor.&lt;/li&gt;&#10;&lt;li&gt;Use Ctrl-W followed by an arrow key to move between the different vim windows. This can be useful for scrolling up in the watch window.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;img class="img-responsive" src="https://fontis.au/media/files/magento_debugger_small_cropped.png" /&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;This debugger is relatively easy to setup and can be very helpful in seeing exactly what's happening as Magento is running. You can debug any action in the Magento frontend or backend, and using breakpoints you can start following execution wherever you want. One very important point to note is that having Xdebug enabled will cause a severe performance hit. &lt;b&gt;Don't forget to disable it when you're done!&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Customised Magento review summary</title><link>https://fontis.au/blog/customised-magento-review-summary/</link><pubDate>Mon, 06 Jul 2009 05:11:48 +0000</pubDate><guid>https://fontis.au/blog/customised-magento-review-summary/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;There is little doubt that product reviews are popular with online shoppers, and are playing an increasingly important role in purchasers' buying decisions. Magento includes a solid feature set for implementing product reviews and can show them on various pages that include product listings. You may find that you want to customise the way these reviews are displayed, but the best way to do this may not be immediately obvious.&lt;/p&gt;&#10;&lt;p&gt;The standard review summary text for products without reviews is:&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/long_review.png" alt="" class="img-responsive" /&gt;&#10;&lt;p&gt;In cases with one or more existing reviews it shows the rating followed by some links, as seen in this example:&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/long_reviewed.png" alt="" class="img-responsive" /&gt;&#10;&lt;p&gt;And if you inspect the relevant phtml files you will find this code, which is responsible for inserting the review summary html:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;getReviewsSummaryHtml($_product, false, true)?&amp;gt;&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;But what if you needed to make changes to this? If you want to change the look for all instances of the review summary you can simple change the review summary phtml file, namely:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;review&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;helper&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;If, on the other hand you would like to have a different looking review summary in some cases, whilst leaving the default look for others, you can indeed do this and it is very easy. Magento actually provides a shorter version of the review summary, but this is not obvious from the existing code. For some reason the second argument in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getReviewsSummaryHtml&lt;/span&gt;&lt;/code&gt; function call is incorrectly set to 'false' when it really isn't a boolean, but is actually a keyword for a review summary template. Magento comes with a shorter version of the review summary which you can access by simply replacing the false in the second argument with "short", like this:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;getReviewsSummaryHtml($_product, &amp;#34;short&amp;#34;, true)?&amp;gt;&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;Now if there is a review for a product it will be appear like this&lt;/p&gt;&#10;&lt;img src="https://fontis.au/media/wysiwyg/blog/short_reviewed.png" alt="" class="img-responsive" /&gt;&#10;&lt;p&gt;and if you want to edit this template, you can find it here&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;review&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;helper&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;summary_short&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;&#10;&#10;&lt;p&gt;You can go a step further and add your custom templates as well. However, to do this you will need to edit one Magento core file and you will need to add your own phtml template.&lt;/p&gt;&#10;&lt;p&gt;First, add your own phtml file in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;review&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;helper&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;directory. Probably the best thing to do here is to make a copy of the existing &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;summary&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt; file and modify it to fit your needs. Let's say you called your new file &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;myreview&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;You need to add a reference to this template (a keyword and the path to your phtml template) in the following core file:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Review&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Helper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;in the &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$_availableTemplates&lt;/span&gt;&lt;/code&gt; array. Once you have added the necessary line, the top of the file should look like this:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Mage_Review_Block_Helper&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Core_Block_Template&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nv"&gt;$_availableTemplates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10; &lt;span class="s1"&gt;&amp;#39;default&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;review/helper/summary.phtml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10; &lt;span class="s1"&gt;&amp;#39;short&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;review/helper/summary_short.phtml&amp;#39;&lt;/span&gt;&#10; &lt;span class="s1"&gt;&amp;#39;myreview&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;review/helper/myreview.phtml&amp;#39;&lt;/span&gt;&#10; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&#10; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getSummaryHtml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$templateType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$displayIfNoReviews&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;span class="o"&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;Note the usual warning that you should not edit the actual Magento core file, but should first copy it to your local directory. The file to edit is:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Review&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Helper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Your template is ready to go. To use it in your html code simply insert the following line:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;getReviewsSummaryHtml($_product, &amp;#34;myreview&amp;#34;, true)?&amp;gt;&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Magento debugging - loading blocks, layouts and config files</title><link>https://fontis.au/blog/magento-debugging-loading-blocks-layouts-and-config-files/</link><pubDate>Wed, 01 Jul 2009 06:22:47 +0000</pubDate><guid>https://fontis.au/blog/magento-debugging-loading-blocks-layouts-and-config-files/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Occasionally I've needed to take a closer look at exactly which block, layout or config file is being loaded by Magento. In this post I will demonstrate a "brute force" approach to checking exactly what is being processed.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; Where possible, we will be using Magento's logging, the output of which will be written to the file &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;system&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;/code&gt;, which also includes the rest of the system logging output. Logging must be enabled for output to be written to this file - you can enable logging in the Magento admin panel by going to System &amp;rarr; Configuration &amp;rarr; Developer &amp;rarr; Log Settings and setting &lt;i&gt;Enabled&lt;/i&gt; to True.&lt;/p&gt;&#10;&lt;h2&gt;Blocks&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;p&gt;The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getBlockClassName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; is responsible for translating block paths (i.e. &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;adminhtml&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;sales_order&lt;/span&gt;&lt;/code&gt;) into a filename (i.e. &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Adminhtml&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Sales&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Grid&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; or a custom block such as &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Fontis&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;CustomModule&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Adminhtml&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Sales&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Grid&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;). To see which block paths are getting mapped to which class files, add a logging statement:&lt;/p&gt;&#10;&lt;p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getBlockClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$blockType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$blockType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$blockType&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// added log statement below&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;$blockType&lt;/span&gt;&lt;span class="s2"&gt; mapped to &amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getGroupedClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;block&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$blockType&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getGroupedClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;block&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$blockType&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;p&gt;The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;_getBlockInstance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; takes a block path or class name and finds the corresponding PHP file to load. Add some logging to this and you can see exactly what's getting loaded. (New lines are &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$orig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/code&gt;.) &lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_getBlockInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$attributes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// added line below&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$orig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;is_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!==&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getBlockClassName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;throwException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;core&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Invalid block type: %s&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mageFindClassFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fileName&lt;/span&gt;&lt;span class="o"&gt;!==&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// added log statement below&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;_getBlockInstance: &lt;/span&gt;&lt;span class="si"&gt;$orig&lt;/span&gt;&lt;span class="s2"&gt; -&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;$fileName&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;include_once&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fileName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$block&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$attributes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$block&lt;/span&gt; &lt;span class="nx"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;Mage_Core_Block_Abstract&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;throwException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;core&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Invalid block type: %s&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2&gt;Layouts&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;p&gt;The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;fetchFileLayoutUpdates&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Layout&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Update&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; is where the XML layout files get loaded. Insert a logging statement to see what's getting processed&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchFileLayoutUpdates&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// ...some lines omitted here...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$updateFiles&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$design&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getLayoutFilename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Loading layout file &lt;/span&gt;&lt;span class="si"&gt;$filename&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;is_readable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// added logging statement below&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Loading layout file &lt;/span&gt;&lt;span class="si"&gt;$filename&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;str_replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_subst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;from&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_subst&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;to&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nv"&gt;$fileStr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileXml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;simplexml_load_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fileStr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$elementClass&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$fileXml&lt;/span&gt; &lt;span class="nx"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;SimpleXMLElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$layoutStr&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="nv"&gt;$fileXml&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;innerXml&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;#$layoutXml-&amp;gt;appendChild($fileXml);&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// ...some lines omitted here...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2&gt;Configuration&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;p&gt;The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;loadFile&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Varien&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Simplexml&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; is what actually loads config XML files. Adding some logging statements in here will show you exactly which XML files are getting loaded, but as it's executed before the built-in Magento logging functionality, we need to use a more basic method. (New lines are between &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;fclose&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; inclusive - remember to change the path to something that makes sense for you.)&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;loadFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filePath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;is_readable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filePath&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;//throw new Exception(&amp;#39;Can not read xml file &amp;#39;.$filePath);&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// new lines added below&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$log&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/var/www/magento/var/log/xml.log&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$log&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Loading XML file: &lt;/span&gt;&lt;span class="si"&gt;$filePath&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;fclose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$log&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// end of new lines&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$fileData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;processFileData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fileData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;loadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fileData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_elementClass&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Instrumenting the core code with logging statements is certainly a down and dirty approach, but sometimes it's useful to check exactly what's getting loaded without going to the effort of firing up a debugger.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Definitive Magento installation guide</title><link>https://fontis.au/blog/definitive-installation-guide/</link><pubDate>Thu, 25 Jun 2009 04:26:15 +0000</pubDate><guid>https://fontis.au/blog/definitive-installation-guide/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;While getting started with Magento some time ago, I thought it would be a good idea to write a post that started at the beginning: how to install it. Reading through the Magento forums, I get the impression that Magento users have extremely varied levels of web development and systems administration experience. That raises the question of the amount of detail to include in a post aimed at Magento newcomers, since experienced web developers will need only the important steps, whilst those new to web development will prefer more info. Here's our take on an install guide that will hopefully prove useful for both audiences.&lt;/p&gt;&#10;&#10;&lt;p&gt;In order to broaden the appeal of this article I have used JavaScript to make things more readable. Below are all the steps necessary to install Magento, and if you are unsure about any of the steps, just click for more details.&#10; &lt;/p&gt;&#10; &lt;p&gt;Installing Magento is similar to installing Drupal or Wordpress. Before we can install Magento we need to configure the environment in which it will run. In this case we'll use Ubuntu as the operating system in our examples, though the instructions are fairly similar for other Linux distributions. You will need &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;sudo&lt;/span&gt;&lt;/code&gt; access in order to complete the steps below.&#10; &lt;/p&gt;&#10; &lt;ol style="list-style-type:upper-alpha;"&gt;&#10; &lt;li&gt;&lt;h3&gt;Configure Ubuntu&lt;/h3&gt;&#10; &lt;ol&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("php5")'&gt;Install php5&lt;/a&gt; including the following modules:&#10; &lt;ul&gt;&#10; &lt;li&gt;mhash&lt;/li&gt;&#10; &lt;li&gt;cli&lt;/li&gt;&#10; &lt;li&gt;mcrypt&lt;/li&gt;&#10; &lt;li&gt;curl&lt;/li&gt;&#10; &lt;li&gt;mysql&lt;/li&gt;&#10; &lt;li&gt;gd&lt;/li&gt;&#10; &lt;/ul&gt;&#10; &lt;div class="details" id="php5" style="display:none;"&gt;&#10; &lt;p&gt;Make sure that your installer is up to date: &lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo aptitude update&lt;/pre&gt;&#10; &lt;p&gt;To install php5 with the necessary modules:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo aptitude install php5 php5-mhash php5-mcrypt php5-curl&#10; php5-cli php5-mysql php5-gd&lt;/pre&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("mysql")'&gt;Install mysql&lt;/a&gt;&#10; &lt;div class="details" id="mysql" style="display:none;"&gt;&#10; &lt;p&gt;If you have not already done so in the install php step, make sure that your installer is up to date: &lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo aptitude update&lt;/pre&gt;&#10; &lt;p&gt;To install mysql with the necessary modules:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo aptitude install mysql-client mysql-server&lt;/pre&gt;&#10; &lt;p&gt;The installation process will ask you to create a root password for mysql. You will need this password in the next step.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("magento-db")'&gt;Create a database for Magento&lt;/a&gt;&#10; &lt;ul id="magento-db" style="display:none"&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("db-cli")'&gt;Using command-line&lt;/a&gt;&#10; &lt;div class="details" id="db-cli" style="display:none;"&gt;&#10; &lt;p&gt;To create a database in mysql type this at the command prompt:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;mysql -u root -p&lt;/pre&gt;&#10; &lt;p&gt;When prompted enter the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;root&lt;/span&gt;&lt;/code&gt; password. At the mysql prompt type the following:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;CREATE DATABASE magento;&lt;/pre&gt;&#10; &lt;p&gt;Create user &lt;var&gt;magento&lt;/var&gt; for the database &lt;var&gt;magento&lt;/var&gt;:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;GRANT USAGE ON *.* TO magento@localhost IDENTIFIED BY 'password'&lt;/pre&gt;&#10; &lt;p&gt;where &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;/code&gt; is a password of your choosing. Make note of this password as you will need it&#10; when you install Magento. You also need to grant the privileges to the new user:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;GRANT ALL PRIVILEGES ON magento.* TO magento@localhost;&lt;/pre&gt;&#10; &lt;p&gt;You can test your setup with:&lt;p&gt;&#10; &lt;pre class="instructions"&gt;mysql -u magento -p'password' magento&lt;/pre&gt;&#10; &lt;p&gt;which should return something like this:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;&#10;Your MySQL connection id is 22&#10;Server version: 5.0.75-0ubuntu10 (Ubuntu)&#10;&#10;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&#10;&#10;mysql&gt;&#10; &lt;/pre&gt;&#10; &lt;p&gt;The database is now completed. You can type &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/code&gt; to quit mysql.&lt;/p&gt;&#10; &lt;/p&gt;&lt;/p&gt;&lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("db-phpmyadmin")'&gt;Using phpmyadmin&lt;/a&gt;&#10; &lt;div class="details" id="db-phpmyadmin" style="display:none;"&gt;&#10; &lt;ol&gt;&#10; &lt;li&gt;On the phpmyadmin start page click 'Privileges'.&lt;/li&gt;&#10; &lt;li&gt;Click 'Add a new User'&lt;/li&gt;&#10; &lt;li&gt;Fill in the following:&#10; &lt;pre&gt;User name:'Use text field:' magento&#10;Host: 'Local' localhost&#10;Password: 'Use text field:' &amp;lt;enter your password&amp;gt;&#10;Re-type: &amp;lt;enter your password&amp;gt;&lt;/pre&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;Under 'Database for user' select 'Generate database with same name and grant all privileges'&lt;/li&gt;&#10; &lt;li&gt;Click 'Go'&lt;/li&gt;&#10; &lt;/ol&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("db-cPanel")'&gt;Using MySQL Databases in cPanel&lt;/a&gt;&#10; &lt;div class="details" id="db-cPanel" style="display:none;"&gt;&#10; &lt;ol&gt;&#10; &lt;li&gt;On the MySQL Databases start page type magento in the 'New Database:' box and click 'Create Database'.&lt;/li&gt;&#10; &lt;li&gt;Under 'Add New User' type in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Username&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;/code&gt; and choose a password. Click 'Create User'.&lt;/li&gt;&#10; &lt;li&gt;Under 'Add User To Database' match the user you created to the database you created and click 'Add'.&lt;/li&gt;&#10; &lt;li&gt;&lt;strong&gt;Note:&lt;/strong&gt; The database name as well as database user will be given a prefix. That means that when you &#10; install Magento you need to use the full database name and full user name as set here!&lt;/li&gt;&#10; &lt;/ol&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;/ul&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("php-ini")'&gt;Increase memory limit in &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;php5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;apache2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ini&lt;/span&gt;&lt;/code&gt; to 64MB&lt;/a&gt;&#10; &lt;div class="details" id="php-ini" style="display:none;"&gt;&#10; &lt;p&gt;In order to use Magento the memory limit needs to be increased in the php.ini file. This file can usually be found in the&#10; &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;php5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;apache2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directory. A simple editor like &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;vi&lt;/span&gt;&lt;/code&gt; will suffice to change the necessary value:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo vi /etc/php5/apache2/php.ini&lt;/pre&gt;&#10; &lt;p&gt;To find the line that needs to be changed simply type &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;memory&lt;/span&gt;&lt;/code&gt; and press Enter. Change the memory limit&#10; from 16MB to 64MB by pressing &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;/code&gt; and then editing the line. To save the file press Escape, type &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;wq&lt;/span&gt;&lt;/code&gt;&#10; and press Enter&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;Increase memory limit in &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;php5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;cli&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ini&lt;/span&gt;&lt;/code&gt; to 64MB&lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("rewrite")'&gt;Enable server rewrites&lt;/a&gt;&#10; &lt;div class="details" id="rewrite" style="display:none;"&gt;&#10; &lt;p&gt;If you know that server rewrites are enabled you can skip this step. Enabling server rewrites allows for &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&#10; to be removed from all urls. To check or to enable server rewrites open the apache default configuration file:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo vi /etc/apache2/sites-available/default&lt;/pre&gt;&#10; &lt;p&gt;Make sure that AllowOverride is set to All and not None for &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; portion of the code, which should look like this:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;&amp;lt;Directory /var/www/&amp;gt;&#10; Options Indexes FollowSymLinks MultiViews&#10; AllowOverride &lt;span style="color:red; font-weight:bold;"&gt;All&lt;/span&gt;&#10; Order allow,deny&#10; allow from all&#10;&amp;lt;/Directory&amp;gt;&lt;/pre&gt;&#10; &lt;p&gt;Next you also need to make sure that the rewrite module is actually enabled. To check, list the content of&#10; &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;apache2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mods&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;enabled&lt;/span&gt;&lt;/code&gt;, where if you don't find a link called &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;rewrite&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;load&lt;/span&gt;&lt;/code&gt; you then&#10; need to create one. To create it, type:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;cd /etc/apache2/mods-enabled&lt;/pre&gt;&#10; &lt;pre class="instructions"&gt;sudo ln -s ../mods-available/rewrite.load&lt;/pre&gt;&#10; &lt;p&gt;You will now need to restart Apache for all of these changes to take effect.&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo /etc/init.d/apache2 restart&lt;/pre&gt;&#10; &lt;p&gt;Server rewrites should now be enabled. The final step is to tell Magento to use server rewrites. This is done&#10; at the Magento installation (see 'Install Magento' below).&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;/ol&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;h3&gt;Download Magento&lt;/h3&gt;&#10; &lt;ol&gt;&#10; &lt;li&gt;&lt;a href='http://www.magentocommerce.com/download/noregister'&gt;Follow this link to the download page&lt;/a&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;Download the &lt;strong&gt;Full Release&lt;/strong&gt; in your favourite format. If you are not sure which format to choose download zip.&lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("zip")'&gt;Uncompress the file&lt;/a&gt;&#10; &lt;div class="details" id="zip" style="display:none;"&gt;&#10; &lt;p&gt;If you have downloaded a zip file, to unzip:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;unzip magento-x.x.x.zip&lt;/pre&gt;&#10; &lt;p&gt;where the x's stand for the current version number.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("www")'&gt;Move the Magento directory to your web accessible directory&lt;/a&gt;&#10; &lt;div class="details" id="www" style="display:none;"&gt;&#10; &lt;p&gt;If you are using a standard Ubuntu install you need to move the Magento directory to &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;sudo mv magento /var/www/&lt;/pre&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("chmod")'&gt;Make &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;/code&gt;, &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;/code&gt; world-writable&lt;/a&gt;&#10; &lt;div class="details" id="chmod" style="display:none;"&gt;&#10; &lt;p&gt;To change the directory permissions go to the Magento base directory:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;cd /var/www/magento&lt;/pre&gt;&#10; &lt;p&gt;and enter&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;chmod 777 app/etc/&lt;/pre&gt;&#10; &lt;p&gt;All of the subdirectories of the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directories must also be world-writable, hence&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;chmod -R 777 media/ var/&lt;/pre&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;/ol&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;h3&gt;Install sample data for Magento&lt;/h3&gt;&lt;a href='javascript:toggle("opt-sample")'&gt;(Optional - click here for details)&lt;/a&gt;&lt;br /&gt;&#10; &lt;div id="opt-sample" style="display:none;"&gt;&#10; &lt;span style="color:red; font-weight:bold;"&gt;If you want to install the sample data you MUST do so before installing Magento.&lt;/span&gt;&#10; &lt;ol&gt;&#10; &lt;li&gt;&lt;a href='http://www.magentocommerce.com/download/noregister'&gt;Follow this link to the download page&lt;/a&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;Download the &lt;strong&gt;Sample Data&lt;/strong&gt; in your favourite format. If you are not sure which format to choose download zip.&lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("zip-sample")'&gt;Uncompress the file&lt;/a&gt;&#10; &lt;div class="details" id="zip-sample" style="display:none;"&gt;&#10; &lt;p&gt;If you have downloaded a zip file, to unzip:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;unzip magento-sample-data-x.x.x&lt;/pre&gt;&#10; &lt;p&gt;where the x's stand for the current version number.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;Copy &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;catalog&lt;/span&gt;&lt;/code&gt; directory in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;/code&gt; to &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;www&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;media&lt;/span&gt;&lt;/code&gt; and ensure it is world-writable.&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;a href='javascript:toggle("import-sample")'&gt;Import the sample .sql file into your previously created mysql database&lt;/a&gt;&#10; &lt;div class="details" id="import-sample" style="display:none;"&gt;&#10; &lt;p&gt;To import an .sql file into a database simply type the following on the command line:&lt;/p&gt;&#10; &lt;pre class="instructions"&gt;mysql -u root -p &lt;var&gt;magento&lt;/var&gt; &amp;lt; &lt;var&gt;magento_sample_data_for_x.x.x.sql&lt;/var&gt; &lt;/pre&gt;&#10; &lt;p&gt;where &lt;var&gt;magento&lt;/var&gt; is the name of the database we created earlier and &lt;var&gt;magento_sample_data_for_x.x.x.sql&lt;/var&gt;&#10; is the name of the .sql file that came in the sample data zip file.&lt;/p&gt;&#10; &lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;If you encounter difficulties with importing the sample data consult this&#10; &lt;a href='http://www.magentocommerce.com/boards/viewthread/11739/'&gt;forum thread&lt;/a&gt;&lt;/li&gt;&#10; &lt;/ol&gt;&#10; &lt;/div&gt;</description></item><item><title>API product IDs vs SKUs</title><link>https://fontis.au/blog/api-product-ids-vs-skus/</link><pubDate>Wed, 24 Jun 2009 07:57:48 +0000</pubDate><guid>https://fontis.au/blog/api-product-ids-vs-skus/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;The Magento web services API is quite flexible - a lot of the time, it can either take an ID (like a product ID) or a more human-readable identifier (like a product SKU). Unfortunately, the downside of this is that in certain circumstances these can be mixed up, in which case the the wrong product will be affected.&lt;/p&gt;&#10;&#10;&lt;p&gt;In theory, to fetch information on a product based on its ID, the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;catalog_product&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;/code&gt; method should be used with with an integer argument:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;catalog_product.info&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;124&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;If you wanted to fetch by SKU on the other hand, you would provide a string argument:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;catalog_product.info&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;big-hat&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;But a problem can occur if you're using products with numeric SKUs that are &lt;em&gt;also&lt;/em&gt; valid product ID numbers. For example, if you have a product with the SKU '120' (as a string), and you also have an existing product with the ID 120, there's the potential for confusion. The core code that actually gets the product when you make any of the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;catalog_product&lt;/span&gt;&lt;/code&gt; web services API calls is (from &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Resource&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;):&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_getProduct&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;is_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$idBySku&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getIdBySku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$idBySku&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$productId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$idBySku&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStoreId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_getStoreId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;The issue is that if this function is passed a string as its &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;/code&gt; argument, it will first try to find the product with a SKU matching that string. If it fails, though, it doesn't return with an error that it couldn't find anything - it tries to find a product with that string as an ID. In the above example, if a product is already in the system with ID 120, and you want to know if a product with the SKU '120' exists, you would try:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sessionId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;catalog_product.info&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;120&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Note that we're passing '120' as a string. This should search for any products with the SKU '120', and since there aren't any it should return an error. However, since there is a product with the ID 120, and since '120' is the same as 120 if you cast it to an integer, you'll instead get the details for this product back instead.&lt;p&gt;&#10;&lt;p&gt;This isn't too bad if we're just trying to get information on a product - we can always test manually whether the SKU in the array returned by &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;catalog_product&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;/code&gt; is the same as the SKU we searched for. But if we are instead performing an update operation, the result can be subtle yet very severe. If you try to update a product with the SKU '120' and it doesn't exist, you should get an error. Instead, if there happens to be a product with the ID 120, that will be updated instead, which may well go unnoticed should IDs and SKUs only occasionally match up. Nasty.&lt;/p&gt;&#10;&lt;p&gt;One solution to this problem is to override the block code above with a version that doesn't fall back to searching on ID if it can't find a match on SKU:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_getProduct&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;getModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog/product&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStoreId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_getStoreId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;is_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$idBySku&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getIdBySku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$idBySku&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$idBySku&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$productId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Another option is just to be extremely defensive and double-check everything. When using &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;catalog_product&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;/code&gt;, check that what you get back really is what you're looking for, and don't do any updates until you've confirmed they will affect the right product.&lt;/p&gt;&#10;&lt;p&gt;&lt;i&gt;Update: Moved return statement as suggested by Anton. We have also received word that this issue won't be fixed in upcoming Magento core releases for now, since an API overhaul is apparently already in development. The expectation is that the new API included with a future major release will support either separate methods of getting products by SKU or by ID, or a way of explicitly specifying how to treat the productId argument.&lt;/i&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Web services API filter operators</title><link>https://fontis.au/blog/web-services-api-filter-operators/</link><pubDate>Tue, 23 Jun 2009 07:49:29 +0000</pubDate><guid>https://fontis.au/blog/web-services-api-filter-operators/</guid><description>Many of the Magento web services API methods facilitate listing certain types of data - customers, products, orders, etc. However, when using these methods we rarely want to retrieve every record. Luckily there are a number of filter operators that can be used to narrow the result set that will be returned.</description></item><item><title>Preventing PO box customer addresses</title><link>https://fontis.au/blog/preventing-po-box-customer-addresses/</link><pubDate>Mon, 22 Jun 2009 04:13:02 +0000</pubDate><guid>https://fontis.au/blog/preventing-po-box-customer-addresses/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;It's often undesirable to mail items to customers who provide post office boxes or locked bags for their delivery address when placing an order on a Magento site. Most commonly this is a requirement for fraud prevention or shipping reasons. Unfortunately, simply stating that PO boxes cannot be accepted somewhere on the site is often not enough to stop some customers from still placing an order with one. Rather then be left with orders that either require a followup or can't be fulfilled, an easy solution is to add validation code to prevent PO boxes and/or locked bags from being entered in the first place.&lt;/p&gt;&#10;&#10;&lt;p&gt;Thankfully, the code we need to add only needs to be added to one file.&lt;/p&gt;&#10;&#10;&lt;p&gt;The code to be added to block PO boxes is as follows:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/p\.* *o\.* *box/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot deliver to PO boxes.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The code to block locked bags is as follows:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/locked *bag/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot deliver to locked bags.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;The above code needs to be added to the following file: &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;Abstract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function which can be found towards the end of the file. Once added, the function should look something like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;customer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;implodeStreetAddress&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getFirstname&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter first name.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getLastname&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter last name.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter street.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/p\.* *o\.* *box/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot deliver to PO boxes.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/locked *bag/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getStreet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;We cannot deliver to locked bags.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCity&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter city.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getTelephone&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter telephone.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getPostcode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter zip/postal code.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCountryId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter country.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCountryModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRegionCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getSize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getRegionId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter state/province.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;As usual, please note that it is not wise to make changes in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;/code&gt; directory. The best option is to copy the affected file to the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;/code&gt; directory, under the same directory structure as before i.e. the edited file should be located here: &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;Abstract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;&lt;i&gt;Update: Follow-up post detailing how to &lt;a href="https://fontis.au/blog/preventing-po-box-shipping-addresses"&gt;prevent PO boxes only for shipping address at checkout&lt;/a&gt;, as opposed to disallowing PO boxes for any customer address.&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Custom controllers</title><link>https://fontis.au/blog/custom-controllers/</link><pubDate>Tue, 16 Jun 2009 08:58:02 +0000</pubDate><guid>https://fontis.au/blog/custom-controllers/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Here are a few notes on creating your own controllers and actions in Magento modules. This example shows how to create a controller called 'subscriber' for a module called 'MailingList'.&lt;/p&gt;&#10;&#10;&lt;p&gt;One scenario in which a custom controller is useful is when there is a need to allow other applications to interact with Magento. For example, we might want to be able to take action on subscribers being added or removed from an external mailing list, which is in fact exactly what our &lt;a href="https://github.com/campaignmonitor/magento-extension"&gt;Campaign Monitor extension&lt;/a&gt; does.&lt;/p&gt;&#10;&#10;&lt;ol&gt;&#10; &lt;li&gt;&lt;p&gt;Add a &lt;code class="code-inline language-xml"&gt;&lt;span class="nt"&gt;&amp;lt;frontend&amp;gt;&lt;/span&gt;&lt;/code&gt; section to your module's etc/config.xml file:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;frontend&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;routers&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;mailinglist&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;use&amp;gt;&lt;/span&gt;standard&lt;span class="nt"&gt;&amp;lt;/use&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;args&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;module&amp;gt;&lt;/span&gt;MailingList&lt;span class="nt"&gt;&amp;lt;/module&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;frontName&amp;gt;&lt;/span&gt;mailing&lt;span class="nt"&gt;&amp;lt;/frontName&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/args&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/mailinglist&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/routers&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/frontend&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &#10; &lt;p&gt;The contents of &lt;code class="code-inline language-xml"&gt;&lt;span class="nt"&gt;&amp;lt;frontName&amp;gt;&lt;/span&gt;&lt;/code&gt; is the first part of the URL for accessing any controllers in the module.&lt;/p&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;p&gt;Create a 'controllers' directory underneath your module's directory.&lt;/p&gt;&lt;/li&gt;&#10; &lt;li&gt;&lt;p&gt;To actually create a controller, you can take a look at the existing controllers in Magento core for examples. A basic implementation would look something like this:&lt;/p&gt;&#10; &#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MailingList_SubscriberController&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Core_Controller_Front_Action&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;indexAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;newAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &#10; &lt;p&gt;The code above would be the contents of a file called '&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;SubscriberController&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;'. The name of the controller will be the second component of the URL used to access it ('subscriber', in this case).&lt;/p&gt;&#10; &lt;/li&gt; &#10; &lt;li&gt;&lt;p&gt;The &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;indexAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function will now be called from the URL &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;magento&lt;/span&gt; &lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mailing&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;subscriber&lt;/span&gt;&lt;/code&gt;, as this is the default action, so to run the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;newAction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt; function, the URL would be &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;magento&lt;/span&gt; &lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;mailing&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;subscriber&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt;&lt;/code&gt;. We can see that the components of the URL are the module's 'front name', controller name, and then action name. Access any URL parameters (the standard '&lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="nx"&gt;blah&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;cat&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;yes&lt;/span&gt;&lt;/code&gt;' variety) using the traditional PHP &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;/code&gt; and &lt;code class="code-inline language-php"&gt;&lt;span class="nv"&gt;$_POST&lt;/span&gt;&lt;/code&gt; superglobals.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</description></item><item><title>Know More About Your Customers - Adding Custom Signup Attributes</title><link>https://fontis.au/blog/know-more-about-your-customers-adding-custom-signup-attributes/</link><pubDate>Mon, 15 Jun 2009 02:50:00 +0000</pubDate><guid>https://fontis.au/blog/know-more-about-your-customers-adding-custom-signup-attributes/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Magento provides a simple user account signup page. However, some online stores might want to collect relevant customer information for more targeted and personal interactions with their customers. Some examples of details that could be collected include shoe size, clothing size or favourite colour.&lt;/p&gt;&#10;&#10;&lt;p&gt;Adding your custom fields on the signup form is not difficult, but it is not trivial either, since one cannot use the Magento backend for the task. As an example of how it can be done, I will demonstrate the addition of a new custom field to the signup form asking new users to enter their favourite ice cream flavour.&lt;p&gt;&#10;&#10; &lt;ol&gt;&#10; &lt;li&gt;&lt;p&gt;We need to make a module to extend the functionality of the customer model. Start by adding the module xml file to the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;/code&gt; directory. You need to decide on a module name. In this example we will use the Fontis scope, and call the module 'Customer'. Therefore we need to create a file named &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Fontis_Customer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt; and add the following content:&lt;/p&gt;&#10; &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;active&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/active&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;codePool&amp;gt;&lt;/span&gt;local&lt;span class="nt"&gt;&amp;lt;/codePool&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Fontis_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&lt;p&gt;Adding the above file means that Magento is now aware of a new custom module. Now, we need to create the module itself, which must be located in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Fontis&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;/code&gt; directory. Inside this directory, create an &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;/code&gt; directory and copying the following file inside:&lt;/p&gt;&#10; &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xml&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;Edit the file and change :&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Mage_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;x.x.x&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Mage_Customer&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/modules&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt; to: &lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Fontis_Customer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;Fontis_Customer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;p&gt;This file contains two different &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;fieldsets&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; - one in &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; and one in &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;global&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;. At the end of the second one, in the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;global&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;fieldsets&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;customer_account&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; scope, add:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;flavour&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;create&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/create&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;update&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/update&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/flavour&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10; &lt;p&gt;In this example &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;flavour&lt;/span&gt;&lt;/code&gt; is the chosen attribute code. The attribute code that you choose here will be important in all the following steps.&lt;/p&gt; &#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;p&gt;Now we need to add the attribute to the Customer Entity Setup Model. To do this, copy the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;getDefaultEntities&lt;/span&gt;&lt;/code&gt; method from &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Entity&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Setup&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file to a new file, &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Entity&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Setup&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; in our module. Put the method inside the following class:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Fontis_Customer_Model_Entity_Setup&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Customer_Model_Entity_Setup&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;p&gt;Then add the following code at the end of the attributes array inside the customer arrray: &lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;&amp;#39;flavour&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;label&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Ice Cream Flavour&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;visible&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;required&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;p&gt;In this case the new attribute is set as compulsory by adding &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;&amp;#39;required&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; to the end of that array. If you want the attribute to be optional, remove the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;required&lt;/span&gt;&lt;/code&gt; lines.&lt;/p&gt;&#10; &lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;p&gt;The new attribute needs to be added to the Magento database. The best way to do this is to tell Magento to insert it for you. You can either create your own script that uses the Magento code or you can just drop the following code into one of your template files:&#10; &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$setup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Mage_Eav_Model_Entity_Setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;core_setup&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$setup&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;customer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;flavour&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;label&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Ice Cream Flavour&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;type&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;varchar&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;input&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;text&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;visible&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;required&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;position&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10; &lt;p&gt;A handy place to add the above code is the &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;/&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;register&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; file since it needs to be edited to add a custom field for the new attribute. Make sure the above code is enclosed with&lt;/p&gt;&#10; &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;To add the attribute (ie. run this code) view the register new customer page. Once you have viewed the page this code can be removed.&lt;/p&gt;&#10;&#10; &lt;p&gt;In this example the attribute type is set to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;varchar&lt;/span&gt;&lt;/code&gt; and the input is set to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;/code&gt;. This needs to be modified to match the requirements of each specific attribute.&lt;/p&gt;&#10; &lt;/p&gt;&lt;/li&gt;&#10; &lt;li&gt;&#10; &lt;p&gt;At this point, the attribute is installed and it will show up in the backend. We need to modify the frontend, so that the customers can enter values for the custom attribute. There are two fairly similar phtml files:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;theme&amp;gt;&lt;/span&gt;/template/customer/form/register.phtml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;theme&amp;gt;&lt;/span&gt;/template/customer/form/edit.phtml&lt;span class="nt"&gt;&amp;lt;/theme&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/theme&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;p&gt;As a minimum, you need to add a new text box in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;register&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt; file, since that is what customers see on the register page. You can add the same text box in the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt; file so that customers can make changes to the original entry that they have made on sign-up. Make sure that the ID and name of the new input text box match the attribute code chosen in step 3. In this case it is 'flavour'. The following shows the sample code that adds a new text box with a label:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;input-box&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt; &lt;span class="na"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;flavour&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;?php echo $this- ?&amp;gt;&lt;/span&gt;__(&amp;#39;Favourite Ice Cream Flavour&amp;#39;) ?&amp;gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;required&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;*&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;br&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;flavour&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;flavour&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo $this-&amp;gt;htmlEscape($this-&amp;gt;getFormData()-&amp;gt;getFlavour()) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;lt;?php echo $this-&amp;gt;__(&amp;#39;Flavour&amp;#39;) ?&amp;gt;&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;required-entry input-text&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10; &lt;/li&gt;&#10; &lt;/ol&gt;&#10;&#10;&lt;br /&gt;&#10;&lt;h3&gt;Address details&lt;/h3&gt;&#10;&lt;br /&gt;&#10;&lt;p&gt;If you only want to add fields for address details you are in luck. Those fields are already setup in &#10;the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;register&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phtml&lt;/span&gt;&lt;/code&gt; file, but they are disabled by an inactive &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;/code&gt; statement that so far has not actually been linked to anything else in Magento. Therefore to enable the address related fields you simply need to comment out or delete the following statements:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;getShowAddressFields()): ?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;and&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Note that there are two occurrences of this &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;/code&gt; statement. One is around the area where the customer actually inputs their data and the other is at the bottom of the file. The first statement shows all the areas for the customer to enter their data and the second statement is around some JavaScript code that sets up the State/Province select.&lt;/p&gt;&#10;&#10;&#10;&lt;br /&gt;&#10;&lt;h3&gt;Removing phone number field&lt;/h3&gt; &#10;&lt;br /&gt;&#10;&lt;p&gt;One final issue relates to the telephone number field. By default it is considered a required field and that is hard-coded in the input validation function. If you do not want the telephone field to be mandatory (or any other field for that matter), you need to remove the relevant statement from:&lt;/p&gt;&#10;&lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;Abstract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&#10;&lt;p&gt;This is the code that needs to be removed from &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Zend_Validate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getTelephone&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;NotEmpty&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$helper&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Please enter telephone.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;In order to make sure that your Magento installation still works properly after you do an upgrade, rather than changing the core file, the safest option is to copy the above file into the following file structure:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;magento&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;Abstract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;Since files in &lt;code class="code-inline language-php"&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;/code&gt; don't get affected when you run upgrades, it means your signup form will work as expected after an upgrade. &lt;/p&gt;&#10;&#10;&lt;hr /&gt;&#10;&lt;h4&gt;Magento Compatibility&lt;/h4&gt;&#10;&lt;table border="1"&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Post originally written for Magento version:&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;Tested with Magento version(s):&lt;/td&gt;&#10;&lt;td&gt;1.3.2.4&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&#10;&lt;p&gt;&lt;i&gt;Update: Due to a change in core Magento files the technique for adding custom customer attributes had to be modified. This blog post has been updated accordingly, and current instructions have been tested with Magento 1.3.2.4 -- 16/10/2009&lt;/i&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Fontis M2M Sync released</title><link>https://fontis.au/blog/fontis-m2m-sync-released/</link><pubDate>Wed, 10 Jun 2009 03:52:07 +0000</pubDate><guid>https://fontis.au/blog/fontis-m2m-sync-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the immediate availability of &lt;a href="https://www.fontis.com.au/m2m-magento-myob-sync"&gt;Fontis M2M Sync&lt;/a&gt; for synchronising customers, products and orders between Magento and MYOB. Using our software will allow you to speed up your sales and accounting processes and eliminate the errors associated with manual transfer of the same information.&lt;/p&gt;&#10;&#10;&lt;p&gt;This is a Windows application that runs on your local computer with MYOB installed, and connects remotely to your Magento store. We are providing the software on a yearly subscription basis, which includes comprehensive documentation, support, upgrades, and a 30-day money back guarantee.&lt;/p&gt;&#10;&#10;&lt;p&gt;M2M Sync has been in development for some time now, and we've made sure that it works on all the current versions of Magento, MYOB and Windows, as well as ensuring compatibility with future versions of these platforms (namely Windows 7 and MYOB versions for the 09-10 financial year).&lt;/p&gt;&#10;&#10;&lt;p&gt;As an added bonus for early adopters and the end of the financial year, we’re currently offering the first year’s subscription for only $399, a saving of 20%. This offer will only be available until the end of June so get in quick! Use the promotional code “FINYEAR09” during checkout to receive your discount.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Drop-down admin config arrays</title><link>https://fontis.au/blog/drop-down-admin-config-arrays/</link><pubDate>Fri, 29 May 2009 07:45:43 +0000</pubDate><guid>https://fontis.au/blog/drop-down-admin-config-arrays/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;I recently needed to create custom 'arrays' within Magento's admin panel to support drop-down lists rather than just text fields. This can be a much more convenient means of configuring more complicated backend settings.&lt;/p&gt;&#10;&#10;&lt;p&gt;When I say 'arrays', I'm talking about the type of interface element you can see if you go to System -&gt; Configuration -&gt; General -&gt; Design -&gt; Themes in the Magento admin interface and click one of the 'Add Exception' buttons. Each time you click the 'Add Exception' button, you'll be presented with a pair of text fields. You can add news rows and delete existing ones, and they'll still be there when you save the config settings.&lt;/p&gt;&#10;&#10;&lt;p&gt;The extension I was working on (&lt;a href="https://github.com/campaignmonitor/magento-extension"&gt;Campaign Monitor integration&lt;/a&gt;) needed an interface which would let you specify a Magento customer attribute and a corresponding Campaign Monitor subscriber attribute, so it could synchronise data between the two systems. Text fields would have worked, but drop-down list boxes pre-populated with all the available attributes are a lot easier to use. Here's a screenshot from the Campaign Monitor extension (this uses one drop-down and one normal text field, as opposed to two drop-downs as used in the example to follow):&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://fontis.au/media/wysiwyg/blog/drop-down-admin-config-arrays/magento-custom-dropdowns.png" /&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;So, let's consider an example. Create a new module located at &lt;code class="code-inline language-html"&gt;app/code/local/examplemodule&lt;/code&gt;, and open the &lt;code class="code-inline language-html"&gt;system.xml&lt;/code&gt; file for editing. You need to add a section that looks something like this:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;config&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;sections&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;general&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;groups&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;examplemodule&lt;/span&gt; &lt;span class="na"&gt;translate=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;label&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Example Module Settings&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;frontend_type&amp;gt;&lt;/span&gt;text&lt;span class="nt"&gt;&amp;lt;/frontend_type&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;sort_order&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/sort_order&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_default&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_default&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_website&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_website&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_store&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_store&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;fields&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;example_array_field&lt;/span&gt; &lt;span class="na"&gt;translate=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;comment&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Example array field&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;frontend_model&amp;gt;&lt;/span&gt;examplemodule_block_customarray&lt;span class="nt"&gt;&amp;lt;/frontend_model&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;backend_model&amp;gt;&lt;/span&gt;adminhtml/system_config_backend_serialized_array&lt;span class="nt"&gt;&amp;lt;/backend_model&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;sort_order&amp;gt;&lt;/span&gt;25&lt;span class="nt"&gt;&amp;lt;/sort_order&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_default&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_default&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_website&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_website&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;show_in_store&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/show_in_store&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/example_array_field&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/fields&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/examplemodule&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/groups&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/general&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/sections&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/config&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This defines a configuration field for the module, which is set to show up in the 'General' section of the Magento configuration page. The important part is the &lt;code class="code-inline language-html"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;frontend_model&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt; element. That needs to be set to point to a custom block inside the module. The contents ('examplemodule_block_customarray' here) will make Magento look for &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;examplemodule&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Customarray&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&#10;&#10;&lt;p&gt;Moving along to Customarray.php, which needs to contain:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Examplemodule_Block_Customarray&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$magentoAttributes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="fm"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;animal&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;label&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;adminhtml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Animal&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;size&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;colour&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;label&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;adminhtml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Colour&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;size&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_addAfter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_addButtonLabel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;adminhtml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Add new coloured animal&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;example/array_dropdown.phtml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;_renderCellTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$columnName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_columns&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$columnName&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Wrong column name specified.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$column&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;_columns&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$columnName&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$inputName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getElement&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[#][&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$columnName&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;select name=&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;$inputName&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#34;&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$columnName&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;animal&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;cat&amp;#34;&amp;gt;Cat&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;dog&amp;#34;&amp;gt;Dog&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;monkey&amp;#34;&amp;gt;Monkey&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;rabbit&amp;#34;&amp;gt;Rabbit&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;red&amp;#34;&amp;gt;Red&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;blue&amp;#34;&amp;gt;Blue&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;yellow&amp;#34;&amp;gt;Yellow&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;option value=&amp;#34;green&amp;#34;&amp;gt;Green&amp;lt;/option&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt; &lt;span class="o"&gt;.=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;/select&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$rendered&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;As you can see, this overrides the impressively-named &lt;code class="code-inline language-html"&gt;Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract&lt;/code&gt; class. This is responsible for rendering the individual rows in our config array. (Actually, it renders part of a &lt;i&gt;template&lt;/i&gt; for an array row, but we'll get to that later.) We only need to override two functions. The constructor adds two columns to our array, giving each one a name and a size (the size is only really useful for text fields). Importantly, it also sets the path to the template the block will use to render itself.&lt;/p&gt;&#10;&#10;&lt;p&gt;The &lt;code class="code-inline language-html"&gt;_renderCellTemplate()&lt;/code&gt; function is what actually gets called to create the HTML that forms the array rows. It is called with a column name as an argument, which we use to determine which options we output. In the example above, the 'animal' column will generate a drop-down list of animals, while 'colour' will generate a list of colours (I'll leave it to your imagination as to exactly what this is configuring.)&lt;/p&gt;&#10;&#10;&lt;p&gt;The template path we gave above gets appended to &lt;code class="code-inline language-html"&gt;app/design/adminhtml/default/default/template&lt;/code&gt; to produce a full path of &lt;code class="code-inline language-html"&gt;app/design/adminhtml/default/default/template/example/array_dropdown.phtml&lt;/code&gt;. This file is based on &lt;code class="code-inline language-html"&gt;app/design/adminhtml/default/default/template/system/config/form/field/array.phtml&lt;/code&gt;, which is quite large and so won't be included here. The important part of the file is the JavaScript at the bottom. This uses the simple template feature of Prototype to create a template that gets filled out whenever a new array row is created. Part of the template is hard-coded, and the rest of it is generated by the &lt;code class="code-inline language-html"&gt;_renderCellTemplate()&lt;/code&gt; function in &lt;code class="code-inline language-html"&gt;Customarray.php&lt;/code&gt;. Once the template has been created, it gets used to show any previously saved rows and to generate new ones when you click the 'Add' button.&lt;/p&gt;&#10;&#10;&lt;p&gt;As it stands, the stock array.phtml would almost work - it will happily print out our drop-down list HTML. What it won't do, however, is set the selected attribute so we know which options we saved previously.&lt;/p&gt;&#10;&#10;&lt;p&gt;First off, on line 70, change:&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;td&amp;gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;to:&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;td class=&amp;#34;#-&amp;lt;?php echo $columnName; ?&amp;gt;&amp;#34;&amp;gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This will give each of our cells containing a drop-down a class we can use to identify them later.&lt;/p&gt;&#10;&#10;&lt;p&gt;Next, add the following code at line 110 (some existing code included so you can see where the new code goes):&lt;/p&gt;&#10;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// insert after specified row&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Insertion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;After&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;insertAfterId&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;templateData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// NEW CODE&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// set the selected drop-down list item&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="nx"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;_columns&lt;/span&gt; &lt;span class="nx"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;$columnName&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;$column&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;td.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;templateData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;-&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;lt;?php echo $columnname? ?&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39; option&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;option&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;option&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;templateData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="nx"&gt;echo&lt;/span&gt; &lt;span class="nx"&gt;$columnName&lt;/span&gt;&lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;option&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="nx"&gt;endforeach&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// END NEW CODE&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;_addAfter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;addAfterBtn&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;templateData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;click&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;templateData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt; &lt;span class="nx"&gt;endif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;This creates some JavaScript for each column in our array that finds all the option elements for each select element, checks their values and adds the selected attribute to the one that matches our saved value.&lt;/p&gt;&#10;&#10;&lt;p&gt;And that's all there is to it; you should now have a new configuration array consisting of drop-down lists. For a working example, install our Campaign Monitor extension and take a look at the files installed. The method used for this type of interface element takes a bit of getting used to, but is quite powerful - this example can be adapted to use pretty much any mix of HTML form elements.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Sort products by rating</title><link>https://fontis.au/blog/sort-products-rating/</link><pubDate>Thu, 28 May 2009 07:07:16 +0000</pubDate><guid>https://fontis.au/blog/sort-products-rating/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;If your Magento site supports reviews and ratings for products, as many do, then adding a way to sort by product rating is a feature that your customers may appreciate. The following is a quick way to add in "Rating" as a valid sort selection in category toolbars.&lt;/p&gt;&#10;&#10;&lt;p&gt;First we shall alter the way products are retrieved from the database, to include the overall rating (shown as the number of stars on the product) along with the rest of the product attributes. Copy the file &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Block&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; and open it for editing.&lt;/p&gt;&#10;&#10;&lt;p&gt;In the new &lt;code class="code-inline language-php"&gt;&lt;span class="k"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file find the following line (around line 86):&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;_productCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$layer&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;getProductCollection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;After this add the following:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;_productCollection&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;joinField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;rating_summary&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;review_entity_summary&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rating_summary&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;entity_pk_value=entity_id&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;entity_type&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;store_id&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;getStore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;left&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;p&gt;Now we need to add in an option so that the customer can select "Rating" as an attribute to sort by. Copy the file &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;core&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Catalog&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; and edit.&lt;/p&gt;&#10;&#10;&lt;p&gt;In the new &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt; file find the following code (which should start around line 298):&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;position&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Position&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;Replace with code with:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;position&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Position&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;rating_summary&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;catalog&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Rating&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;Now when viewing categories on your website you should have an option of "Rating" in addition to the others. Note that the sort order defaults to ascending so the lowest rated products will be displayed first. The sort order can be changed by the customer by clicking the arrow next to the drop-down box. Aside from this caveat the new sort is fairly easy to implement and extends the usefulness of the ratings.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>reCAPTCHA Extension Released</title><link>https://fontis.au/blog/recaptcha-extension-released/</link><pubDate>Mon, 20 Apr 2009 04:42:35 +0000</pubDate><guid>https://fontis.au/blog/recaptcha-extension-released/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We are pleased to announce the release of our latest Magento extension, Fontis reCAPTCHA, which adds in &lt;acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart"&gt;CAPTCHA&lt;/acronym&gt; elements to the "Send to a Friend", "Contact Us" and customer registration forms, increasing the difficulty for spammers to misuse your forms and send &lt;acronym title="Unsolicited Commercial Email"&gt;UCE&lt;/acronym&gt;.&#10;&#10;The extension was developed after observing the "send to friend" form (in particular) being abused on a number of live Magento sites. This is a popular feature, and rather than disabling it, using the reCAPTCHA system can substantially reduce spam submissions without overly inconveniencing legitimate human users.&lt;/p&gt;&#10;&#10;&lt;p&gt;Development of this extension was led by one of our newer team members, Denis, and is a more complex extension which includes customised controllers, configuration and templates.&lt;/p&gt;&#10;&#10;&lt;p&gt;Further information and instructions for use are provided on &lt;a href="https://github.com/fontis/fontis_recaptcha"&gt;the extension page&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Automatically add sub-stores in Magento</title><link>https://fontis.au/blog/automatically-add-sub-stores/</link><pubDate>Fri, 06 Mar 2009 06:52:19 +0000</pubDate><guid>https://fontis.au/blog/automatically-add-sub-stores/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;We have a client who has created a number of sub-stores under their main Magento website, so that each of these stores has its own Magento skin, logo and so forth. However, they also have associated subdomains, which normally must be manually specified in the main &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;file so that Magento can be told to run the appropriate store in place of the default. This post details a way to automate the process and make it easier for the user to add additional sub-stores themselves.&lt;/p&gt;&#10;&#10;&lt;p&gt;Normally, the relevant part of &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;would look something like the following:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;explode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$_SERVER&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HTTP_HOST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;other.example.com&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;other&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;default&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;store&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;As mentioned, the major flaw in this is that it requires manually editing the switch statement every time you want to add one of these sub-stores. Fine if you only ever have two or three, but once you start adding more it can quickly add up to a significant amount of time and effort. Moreover, if it's something that needs to be maintained by site administrators who aren't familiar with PHP, you run the risk of having incorrect code and breaking the whole site.&lt;/p&gt;&#10;&#10;&lt;p&gt;Because of these issues I set about creating a way to have these values retrieved from the database, rather than requiring modifications to &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&lt;/code&gt;every time. The URLs are stored in the database table &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;core_config_data&lt;/span&gt;&lt;/code&gt;with the path value &lt;code class="code-inline language-php"&gt;&lt;span class="s2"&gt;&amp;#34;web/unsecure/base_url&amp;#34;&lt;/span&gt;&lt;/code&gt;. For individual store views the scope must be restricted to just "stores". By joining these results with the store codes from the &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;core_stores&lt;/span&gt;&lt;/code&gt;table we have all the values we need. Once we have collected all these results we can enter them into a associative array with the domain as the key and the code as the value.&lt;/p&gt;&#10;&#10;&lt;p&gt;From there we do things in a similar fashion to before, but we do a lookup in our array for the store code instead of using a switch. Here is the complete code:&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$sites&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file_exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;app/etc/local.xml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$xml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;simplexml_load_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;app/etc/local.xml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;default_setup&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;default_setup&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;default_setup&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$dbname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;default_setup&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;dbname&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mysql_connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;mysql_select_db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$dbname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$db&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mysql_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SELECT * FROM core_config_data&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; INNER JOIN core_store ON core_store.store_id = core_config_data.scope_id&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; WHERE scope LIKE \&amp;#39;stores\&amp;#39; &#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt; AND path LIKE \&amp;#39;web/unsecure/base_url\&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mysql_fetch_assoc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$sites&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;code&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;mysql_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$db&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;explode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$_SERVER&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HTTP_HOST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sites&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$sites&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;default&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;store&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&lt;/p&gt;&#10;&#10;&lt;p&gt;Assuming you are only using store views (confusingly referred to as stores internally) then this code will be usable as is. It can be modified fairly easily to work for websites - change scope to be "website", join with the core_website table, use 'website' in &lt;code class="code-inline language-php"&gt;&lt;span class="nx"&gt;Mage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;/code&gt;. I'm sure it could be expanded upon further to allow for using either websites or store views. Since this method requires an extra database query every time index.php is called, but the data changes less frequently, it could also be extended to add some sort of caching for performance optimisation.&lt;/p&gt;&lt;/div&gt;</description></item><item><title>WYSIWYG 7th "Most Downloaded"</title><link>https://fontis.au/blog/wysiwyg-7th-most-downloaded/</link><pubDate>Mon, 02 Mar 2009 06:53:50 +0000</pubDate><guid>https://fontis.au/blog/wysiwyg-7th-most-downloaded/</guid><description>&lt;div class="postContent std"&gt;&lt;p&gt;Our WYSIWYG Editor extension is now the 7th most downloaded extension on Magento Connect! With over 9000 downloads and counting, it's great to see how many members of the Magento community have found the extension useful.&lt;/p&gt;&#10;&#10;&lt;p&gt;As one of the most requested features for inclusion in Magento, demand for a WYSIWYG editor is unlikely to go away any time soon, so we're happy to have been able to provide an easy-to-install solution. We have a number of ideas on how to keep improving the extension, so be sure to check back for future updates on &lt;a href="https://github.com/fontis/fontis_wysiwyg"&gt;the extension page&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description></item></channel></rss>