Skip to content
Aug 19 09

post magento construction notes

by Alex

Below are a few issues I had whilst recently developing an ecommerce site using Magento.

Functionality Issues:

  • The option in the Site Configuration to “Disable One Page checkout” actually disables the checkout entirely (Disable One Page checkout).
  • You have to install an extension to be able to edit email templates, without them being replaced when you upgrade the Magento Core (CLS Upgrade-proof Email Templates).
  • I installed an upgrade to an extension (Securepay integration) via the Magento connector, and due to an sql issue, the whole site died with debug info on the homepage. I ended up having to restore my backup and then not upgrade to the bad version of the plugin.
  • Page loads are really really slow although it appears to have been improved in the latest 1.3.2.3.

General Magento website issues:

  • You can’t actually download the magento package directly (via another machine) from the link issued when visiting their website! They have some sort of cookie check – which means when you want to download the package to a server, you have to open up lynx and go through a bunch of pages rather then a simple wget command.
  • The handbook for developers and designers on their website is really small and outdated. Most of the help online can only be found in their forums, which if your lucky enough, sometimes a Magento developer will actually reply with the ‘best practice’ way of solving something otherwise it’s hacks all the way.

Templating issues:

  • The directory structure can be really really long, i.e. to edit the templates, you have to copy the existing themes, and then you’re editing files here: public_html\app\design\frontend\<theme name>\default\template\page\html\.
  • If you want to make sense of what the contents of variables being echoed in template files you have to refer to the really ugly code located in another random place. @OliveChi notes Magento’s source code commenting hasn’t been properly written to support phpdoc, so you can say good bye to auto suggest/auto complete is ZDE.

On the plus side:

  • The ‘Magento Connect’ feature of Magento allows anyone with the plugin key (obtained from their website) to download and install the plugin without any technical knowlege. There’s no downloading/uploading/untarring/running sql updates/update scripts – something you’d normally have to do for something like Drupal or Zencart.
  • The sales & profit reports in the administration area provide all sorts of pretty charts.
  • (this could also be a bad thing), but just about every facet of the magento ecommerce system can be configured via the Administration Area. i.e. you can have all sorts of product configurations/types.
  • Multi-site/multi-store support.
  • Out of box support for Paypal, and support for heaps of different payment gateways.

Feel free to comment if I’ve got something wrong!

Jul 5 09

Upgrading a Drupal 4.7.x site to 5.x

by Alex

I recently had the potentially very painful task of upgrading a site from a hacked up version of Drupal 4.7.2 to the latest version of 5.x. Whilst I doubt theres many D4 sites still out there, I thought I’d share my notes and tips below as the whole process was quite interesting and perhaps it can at least save someone a bit of time. (Note: on the same site, I’ll be doing the D5 to D6 upgrade in the next few weeks too, so I’ll do a separate post for that here).

The first thing to always do, is to make backups repeatedly throughout the upgrade process. I had the following commands handy and ran them right before I did anything serious:

tar -czvf site-backup-`date '+%y%m%d-%H%M%S'`.tar.gz public_html
mysqldump -u sitedb_primary -p sitedb_primary > \
`date '+%y%m%d-%H%M%S'`.sql

The other thing to do before you start,  is to do all your upgrading on a staging or development version of the site first. This is because, theres a high chance you won’t be able to do this whole process straight off the bat, and you probably don’t want to leave your site in maitenance mode over night while you recover for another attempt.

The following guides/screencasts are what I followed to perform a successful upgrade, plus a few notes, I made that weren’t covered:

1. Converting custom content types from Flexinode to CCK: http://docs.indymedia.be/node/1

  • Make sure your flexinode fields all have unique names from one another. I had to rename a few of my flexinode body fields before flexiconvert would convert things successfully.
  • Keep notes on all your original flexinode names and field names. This is so that when it comes to your themes you can easily update them to the new field names.
  • When creating new content types, you must add the add/edit/delete privileges for each new content type before you can access this section.

2. Screencast for upgrading from D4.x to D5.x: http://drupal.org/videocasts/upgrading-to-5

  • Disabling any custom theme or custom modules are some of the preparations recommended in the screencast. Before you do this though, make sure you don’t have any php code used for block visibility that might use functions in these custom themes or modules. You can either update them with a function_exists(), or re-write them to work out the condition another way.
  • Before running update.php, it might help to do run the following commands on the database “DELETE FROM `variable` WHERE `name` = ‘cache_inc’; TRUNCATE TABLE `themonth_monthlydb`.`cache`;”. I read somewhere that the D4 caching options were different in D5, and if you tried accessing the site after the upgrade without doing this, it would cause your site to die.
  • If your going to leave your site in maintenance mode for an hour whilst you conduct the upgrade, and don’t want the default Drupal Alien logo to show up, simply update the public_html/misc/maintenance.css body tag not to reference ‘druplicon.png’. This might be particularly important if you have a popular site and don’t want to scare people!
  • For views, if you use the filter by ‘Distinct’, make sure its the first filter in your list, otherwise it doesn’t seem to let you save it.

3. For converting your custom themes and modules to D5: http://drupal.org/node/64279

  • For a custom nice_menu’s css file, you can now specify the css filepath via Admin->Themes->Global Settings->Path to custom css file.
  • Put all your custom modules in their own folder within public_html/sites/all/custom/
  • Where possible try to keep your drupal install on the upgrade path by overriding things, or creating custom modules, rather then touching core or contributed php/theme code .
  • When upgrading custom modules, if your in the process of doing things like updating modulename_settings – make sure you disable and then re-enable the module, otherwise, you’ll get some whacky side effects like double admin menu items, etc.

That’s it!

If you are doing an upgrade, I wish you all the luck and patience in the world! And for those that believe in doing a site rebuild over the upgrade, I recommend you try the upgrade first and exhaust all possibilities before giving up, because either re-entering all your sites content, or hacking up a content copy script is more work then it seems.

Jul 5 09

New URL, etc

by Alex

As you can now see, I’ve moved my blog from blog.akb.com.au to www.akb.id.au. If it isn’t obvious, the id.au domain name space is for identities of those is Australia.You can grab them for around $30 from any good registry, Jumba, TPP Internet, etc.

Basically, the reason for changing, is because subdomains (like blog.akb.com.au) carry less weight in google indexes then TLD’s or Country Second Level domains. The other reason was for my personal preference not to use subdomains, as they just seem a bit too tedious.

Another change I made here, is install this handy Twitter Widget Wordpress plugin which automatically updates this site with my tweets! I’m a bit of a Twitter noob – only opened an account a few weeks back for fun, so feel free to follow me, and I’ll follow you back ;)

Jun 20 09

When was my old seagate drive manufactured

by Alex

I recently had my 1TB hard drive (of which was +750GB full) die on me last weekend, after only 12 months of use. I decided to therefore go through all my old hard drives, that I had copied everything from originally, to see what data might have been left on them. I needed to know when I bought them though, and looking at the label on the drives showned something called a ‘Date Code’ for which there was a 5 digit number?

Anyway, the number is calculated on the financial year, then week number of that year, and the day. It’s all explained on this page, along with a handy date code to real date calculator: Seagate date code.