Søren Møller Hansen

Some words from a system developer and music lover

Spotify

Har lige fået øjnene op for Spotify. Fantastisk koncept fra vores svenske naboer!

For 49 svenske kroner (hvilket i skrivende stund svarer til ca. 38 danske kr.) om måneden får man et stort online musik bibliotek, som er tilgængelig til ubegrænset live streaming. For 99 SEK pr. md. får man et premium abonnement, som giver nogle ekstra features og så slipper man for reklamerne. Har man en iPhone (eller en anden Smartphone) kan dette klart anbefales, da der medfølger en applikation, der gør Spotify musik tilgængelig på mobilen – også offline.

Eneste problem er bare, at Spotify ikke er tilgængelig i Danmark endnu… Eller er det? Slå et smut ind forbi denne blog, for at få en udførlig guide til hvordan du, igennem et lille smuthul, også kan blive Spotify bruger.

E-commerce – Creating a Magento payment module

A lot of people have been asking me lately, if I could help them out with getting a webshop up and running. It’s been quite some time since I set up my last webshop and that was an e-commerce solution developed by own company, which is no longer maintained. So I decided to take a look at what solutions are available on the market today. There sure are a lot of solutions to chose from, but I decided to go with, what seems to be the biggest and most promising open source solution out there, Magento Commerce. The feature list is long and the demo solution is very convincing. The system is modular and there’s a lot of open source and commercial extensions available on the Magento website.

So Magento Commerce has all the features I need for the solution I’m setting up… Almost. I wasn’t able to find a module that integrates Navision C5 and since it’s going to be serving danish customers, it also should accept danish credit cards. There are a 2 or 3 modules for danish payment gateways, but one of them was not stable and all of the modules was for the competitors payment gateways. I would very much like the payments to be served by a reliable payment host: Wannafind.dk – the place where I work :-)
So I searched the Internet for documentation on how you create your own modules and I ended up with one single source of documentation from the Magento Wiki. Not much documentation on that subject, but i followed the guide and got my first experiences as a Magento developer. Luckily Magento is very extensible and everything in it is a actually designed as a module, so the project didn’t seem too difficult.

I was happy to discover that the system was built on top of Zend Framework, which I work with every day. This opens up for namespacing, MVC structure and all of the out-of-the-box code from the ZF developers. But I quickly noticed that the Magento developers haven’t followed the default design patterns for ZF application. My guess is that development of this application started out before ZF designed these patterns and got ready for use in production environments. Although it’s probably not gonna happen, I hope the developers of Magento redesign the application structure in the next major version to follow the default ZF structure. For instance it would be nice if we were able to configure the application ressources, routes etc. from an INI file like you do in an ordinary ZF application.

Getting the basic payment module up and running was actually quite simple. As you might have read in the wiki article, it was only a matter of creating a few XML files and then the basic module is ready. Of course there is much more to it than that and I soon realized that the configuration which seemed so easy, actually was the biggest hurdle towards getting the module done – because the configuration parameters aren’t documented anywhere.

Sure there are books available about Magento Commerce, but it doesn’t say anywhere if the books cover this particular subject and books on this kind of stuff gets outdated in very few months. So spending $80 on a book really isn’t an option.

If you want to get to know the Magento API, it seems that there is only one way: The hard way. Dive into the code, step through the thousands of methods, deeper into the system and log debug data in the Magento log.

To make this step-through programming easier, I set up a PHP debugger – the DBG extension. DBG is integrated into PHPEd, which I’m using to write all of my PHP code. Because Magento apparrently only runs on a Linux platform, I had to set up a SSH tunnel for the debugger to work on my development server. But this is a completely different story, which will be the subject for a later blog post. Another problem which also came up, was Windows file sharing, how do I set up this across the internet to my development server? I’ll also drop a few words about this issue in that blog post.

For you curious Magento users out there, wondering if the module ever got finished: I’ll post an update, when the project is done. In the meantime, if anyone knows about a module for integrating Navision C5 in Magento, please drop me a line.

Ved verdens ende

As i wrote in my last post, I went to the movies to see the danish movie “Ved verdens ende”. It was one of the best cinematric experiences for quite some time.

Below is the trailer for the movie:

The movie has that twisted humour known from “Blinkende lygter” and “I Kina spiser de hunde”. It has some alright action scenes and it surprised me a few times. Nice to see a movie, where the story isn’t to obvious.

I’m rating it: 8 of 10.

Go see it if you haven’t already.

So I got myself a blog…

…And no It’s not just because everyone else has one. No I actually got a lot on my mind from time to time, which I want to share with you guys out there :-)

My primary interests are computers and music, thus the posts are probably going to revolve around these topics.

Enjoy, I hope some of this stuff is going to be of someones interest :-)

I’m off to the cinema now, I’m going to watch a danish movie called “Ved verdens ende”… So my first post won’t be until later this evening or tomorrow.