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

<channel>
	<title>Adrian&#039;s Web Log &#187; Magento</title>
	<atom:link href="http://blog.inceweb.com/adrian/tag/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.inceweb.com/adrian</link>
	<description>Adrian&#039;s second brain.</description>
	<lastBuildDate>Sun, 29 Jan 2012 21:50:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Editing Magento&#8217;s Invoice &amp; Despatch PDF Layouts</title>
		<link>http://blog.inceweb.com/adrian/2011/11/24/editing-magentos-invoice-despatch-pdf-layouts/</link>
		<comments>http://blog.inceweb.com/adrian/2011/11/24/editing-magentos-invoice-despatch-pdf-layouts/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 17:01:08 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[credit]]></category>
		<category><![CDATA[despatch]]></category>
		<category><![CDATA[invoice]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[shipping]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=364</guid>
		<description><![CDATA[Magento Invoice and Shipping (Despatch) PDF files are delivered with a reasonable layout, already suited toA4 printing, but benefit from some layout improvements, increasing font sizes, and lightening the greyscale boxes in the interests of readability. Take a copy of the relevant core files and place them in: /app/code/local/Mage/Sales/Model/Order/Pdf The relevant files are Invoice.php &#38; [...]]]></description>
			<content:encoded><![CDATA[<p>Magento Invoice and Shipping (Despatch) PDF files are delivered with a reasonable layout, already suited toA4 printing, but benefit from some layout improvements, increasing font sizes, and lightening the greyscale boxes in the interests of readability.<br />
Take a copy of the relevant core files and place them in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>code<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>Mage<span style="color: #000000; font-weight: bold;">/</span>Sales<span style="color: #000000; font-weight: bold;">/</span>Model<span style="color: #000000; font-weight: bold;">/</span>Order<span style="color: #000000; font-weight: bold;">/</span>Pdf</pre></div></div>

<p>The relevant files are Invoice.php &amp; Shipment.php, but Abstract.php contains functions common to both, and the subdirectory Items contains formatting for the line items of each document type.<br />
The following snippet can be used to format database values as currency values:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$formattedPrice</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>currency<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Price</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2011/11/24/editing-magentos-invoice-despatch-pdf-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento claims it is in Maintenance Mode (and it isn&#8217;t)</title>
		<link>http://blog.inceweb.com/adrian/2011/08/28/magento-claims-it-is-in-mainteance-mode/</link>
		<comments>http://blog.inceweb.com/adrian/2011/08/28/magento-claims-it-is-in-mainteance-mode/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 10:49:07 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[503]]></category>
		<category><![CDATA[flag]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[mode]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=357</guid>
		<description><![CDATA[Assuming that Magento is not actually in maintenance mode (i.e. downloader is not being used) then the following error is the result of a lock file not being removed, probably as the result of an ungraceful exit from the downloader: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance [...]]]></description>
			<content:encoded><![CDATA[<p>Assuming that Magento is not actually in maintenance mode (i.e. downloader is not being used) then the following error is the result of a lock file not being removed, probably as the result of an ungraceful exit from the downloader:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</pre></div></div>

<p>To take Magento out of maintenance mode, just delete the file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">maintenance.flag</pre></div></div>

<p>from the Magento root.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2011/08/28/magento-claims-it-is-in-mainteance-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento 1.3 to 1.5 upgrade notes</title>
		<link>http://blog.inceweb.com/adrian/2011/04/07/magento-1-3-to-1-5-upgrade-notes/</link>
		<comments>http://blog.inceweb.com/adrian/2011/04/07/magento-1-3-to-1-5-upgrade-notes/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 15:06:06 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[1.3]]></category>
		<category><![CDATA[1.5]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mage]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=326</guid>
		<description><![CDATA[The upgrade to 1.5 has a number of &#8220;gotchas&#8221; so while I am debugging the process on the test / staging instance, here are a few notes. Basic process Empty some or all of the log tables as they are potentially huge and are not needed: TRUNCATE `log_customer`; TRUNCATE `log_quote`; TRUNCATE `log_summary`; TRUNCATE `log_url`; TRUNCATE [...]]]></description>
			<content:encoded><![CDATA[<p>The upgrade to 1.5 has a number of &#8220;gotchas&#8221; so while I am debugging the process on the test / staging instance, here are a few notes.</p>
<h3>Basic process</h3>
<p>Empty some or all of the log tables as they are potentially huge and are not needed:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_customer`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_quote`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_summary`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_url`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_url_info`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_visitor`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_visitor_info`</span>;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #ff0000;">`log_visitor_online`</span>;</pre></div></div>

<p>Backup the 1.3 instance using Magento&#8217;s built in backup.</p>
<p>Edit the resulting .sql file and uncomment the FOREIGN_KEY controls at the top and bottom of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> @OLD_FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@@FOREIGN_KEY_CHECKS<span style="color: #66cc66;">,</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>;
<span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@OLD_FOREIGN_KEY_CHECKS;</pre></div></div>

<p>If the domain or subdomain is changing, do a search &amp; replace e.g. replace www.myshop.com with test5.myshop.com</p>
<p>Create the new database instance, and execute the SQL from the previous step. Make sure it doesn&#8217;t time out, last table created is normally &#8220;wishlist_item&#8221;</p>
<p>Yoast Metarobots breaks product maintenance in Magento 1.4+, so remove relevant fields:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`core_resource`</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`core_resource`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`code`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'metarobots_setup'</span>;
<span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`eav_attribute`</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`eav_attribute`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`attribute_code`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'meta_robots'</span>;
<span style="color: #993333; font-weight: bold;">UPDATE</span> eav_entity_type <span style="color: #993333; font-weight: bold;">SET</span> additional_attribute_table<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'catalog/eav_attribute'</span><span style="color: #66cc66;">,</span>entity_attribute_collection<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'catalog/product_attribute_collection'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> entity_type_id<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">4</span>;</pre></div></div>

<p>Now FTP the Magento downloader.php onto the target site, check file permissions and execute it with http://test5.myshop.com/downloader.php</p>
<p>Follow the setup process including specifying the correct database name, user and password.</p>
<p>Use the same encryption key from the original site &#8211; find it in /app/etc/local.xml</p>
<p>If there are problems with the setup not accepting the admin user / password combination, simply re-run the installer by pointing your web browser at http://test5.myshop.com</p>
<p>Remember that the original admin user already exists in the database export, so create a temporary one and delete it later.</p>
<h3>Fixing problems</h3>
<h4>Can&#8217;t access the admin site, gives 404 error</h4>
<p>The database import will have incorrectly sequenced the sites, so run the following:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> @OLD_FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@@FOREIGN_KEY_CHECKS<span style="color: #66cc66;">,</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>;
<span style="color: #993333; font-weight: bold;">UPDATE</span> core_website <span style="color: #993333; font-weight: bold;">SET</span> website_id<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> core_website<span style="color: #66cc66;">.</span>code<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;admin&quot;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span>;
<span style="color: #993333; font-weight: bold;">UPDATE</span> core_store <span style="color: #993333; font-weight: bold;">SET</span> store_id<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> core_store<span style="color: #66cc66;">.</span>code<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;admin&quot;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span>;
<span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@OLD_FOREIGN_KEY_CHECKS;</pre></div></div>

<h4>Admin site is &#8220;white&#8221; i.e. CSS not working and plain HTML is displayed</h4>
<p>Delete contents of /var/cache/</p>
<h4>&#8220;There are no products matching the selection&#8221; when browsing front end</h4>
<p>Wrong customer group ID for users that are no logged in. Execute the following SQL:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> @OLD_FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@@FOREIGN_KEY_CHECKS<span style="color: #66cc66;">,</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>;
<span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`customer_group`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`customer_group_id`</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`customer_group_code`</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'NOT LOGGED IN'</span>;
<span style="color: #993333; font-weight: bold;">SET</span> FOREIGN_KEY_CHECKS<span style="color: #66cc66;">=</span>@OLD_FOREIGN_KEY_CHECKS;</pre></div></div>

<h4>No product images</h4>
<p>Check correct permissions and then copy the images directory structure from the source site eg:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>subdomains<span style="color: #000000; font-weight: bold;">/</span>test5<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now login to admin site and run a  re-index on everything, and update all of the caches.</p>
<h4>Error File does not exist: &#8230; media/catalog/product/no_selection</h4>
<p>Review the System Configuration and under Catalogue / Catalogue / Product Image Placeholders and add the missing placeholders. Add back in the watermarks too in General / Design / Product Image Watermarks. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2011/04/07/magento-1-3-to-1-5-upgrade-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy or move Magento to another instance</title>
		<link>http://blog.inceweb.com/adrian/2010/01/30/copy-or-move-magento-to-another-instance/</link>
		<comments>http://blog.inceweb.com/adrian/2010/01/30/copy-or-move-magento-to-another-instance/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 22:52:25 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[instance]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[move]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=135</guid>
		<description><![CDATA[A quick how-to if you want to copy or move Magento to another database instance, e.g. to create a test site, or move test to live. (1) Backup Magento using the built in backup tool. Download and uncompress the resulting SQL script. If changing the server or domain, search and replace &#8220;old.mysite.com&#8221; with &#8220;new.yoursite.com&#8221; Execute [...]]]></description>
			<content:encoded><![CDATA[<p>A quick how-to if you want to copy or move Magento to another database instance, e.g. to create a test site, or move test to live.</p>
<p>(1) Backup Magento using the built in backup tool. Download and uncompress the resulting SQL script. If changing the server or domain, search and replace &#8220;old.mysite.com&#8221; with &#8220;new.yoursite.com&#8221; Execute it to populate the new database instance.</p>
<p>(2) Copy all Magento files with the exception of the contents of the var/ directory.</p>
<p>(3) Edit app/etc/local.xml on the target instance and change the database, user and password, but not the encryption key. Also edit downloader/pearlib/pear.ini to correct the absolute paths it contains; no reason why these shouldn&#8217;t be relative to the Magento root directory, e.g. &#8220;./downloader/pearlib&#8221;.</p>
<p>(4) Execute the following SQL to prevent those nasty &#8220;Integrity constraint violation: 1062 Duplicate entry&#8221; errors from the log files when adding to the basket:</p>
<blockquote><p>TRUNCATE `log_customer` ;<br />
TRUNCATE `log_quote` ;<br />
TRUNCATE `log_summary` ;<br />
TRUNCATE `log_url` ;<br />
TRUNCATE `log_url_info` ;<br />
TRUNCATE `log_visitor` ;<br />
TRUNCATE `log_visitor_info` ;<br />
TRUNCATE `log_visitor_online` ;</p></blockquote>
<p>Now tidy up permissions:</p>
<blockquote><p>
chmod o+w var var/.htaccess app/etc<br />
chmod -R o+w media</p></blockquote>
<p>That should be it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2010/01/30/copy-or-move-magento-to-another-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reCAPTCHA for Magento</title>
		<link>http://blog.inceweb.com/adrian/2009/07/31/recaptcha-for-magento/</link>
		<comments>http://blog.inceweb.com/adrian/2009/07/31/recaptcha-for-magento/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 21:42:44 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[recaptcha]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=83</guid>
		<description><![CDATA[Well done Fontis for integrating reCAPTCHA into Magento to prevent SPAM through the contact form and &#8220;social&#8221; pages. About time! Well though-out and integrated beautifully into admin. Keys are required from reCAPTCHA andthe extension can be installed through Magento Connect using the extention key on the Magento Extention page.]]></description>
			<content:encoded><![CDATA[<p>Well done Fontis for integrating reCAPTCHA into Magento to prevent SPAM through the contact form and &#8220;social&#8221; pages. About time!<br />
Well though-out and integrated beautifully into admin.<br />
Keys are required from <a title="reCAPTCHA home page" href="http://recpatcha.net">reCAPTCHA</a> andthe extension can be installed through Magento Connect using the extention key on the <a title="reCAPTCHA extention on Magento Connect" href="http://www.magentocommerce.com/extension/1169">Magento Extention</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2009/07/31/recaptcha-for-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento</title>
		<link>http://blog.inceweb.com/adrian/2008/08/07/magento/</link>
		<comments>http://blog.inceweb.com/adrian/2008/08/07/magento/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 15:27:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[OSCommerce]]></category>

		<guid isPermaLink="false">http://blog.inceweb.com/adrian/?p=62</guid>
		<description><![CDATA[Since I last looked (around 9 months ago, I think) the Magento web store project seems to have shaped up nicely. It is certainly prettier than OSCommerce, but more importantly they have kept the code and the presentation separate using &#8211; of course &#8211; CSS. It is written in PHP, and has a growing collection [...]]]></description>
			<content:encoded><![CDATA[<p>Since I last looked (around 9 months ago, I think) the <a title="Magento Comemrce" href="http://www.magentocommerce.com">Magento</a> web store project seems to have shaped up nicely. It is certainly prettier than OSCommerce, but more importantly they have kept the code and the presentation separate using &#8211; of course &#8211; CSS.</p>
<p>It is written in PHP, and has a growing collection of add-ins, so I&#8217;ll be seriously evaluating it as an alternative to OSC for the <a title="Oriental Food Shop" href="http://www.orientalfoodshop.com">Oriental Food Shop</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inceweb.com/adrian/2008/08/07/magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

