Drupal Commerce

I posted on Optaros website (EN | DE). Here is the copy of the post:

Drupal has always been good piece of open source software for content management. We use it at Optaros as one of the core components of OCentric. However, Drupal could never stand its ground as a solid e-commerce platform. With the new Commerce module Drupal is moving that direction.

Background

It hasn’t been long since online businesses realized that there are a couple of buzzwords to stick to: social media and SEO. Indeed, social sites are very good place to be and engage with (potential) customers, not mentioning that these sites enable word of mouth (aka viral marketing). Search engine optimization helps to save money and still allow showing up high in Web search results; normally it goes hand in hand with quality content to please not only Web crawlers but (potential) customers as well.

Actually, what this implies is that e-shop owners have very special needs that go something like this:

“I want to create a website where I want to display my products. There I’ll have discount campaigns. The information about them should be sent to customers, but not intrusively (otherwise it goes to spam) rather in a friendly fashion, e.g. somebody tells to friends about it. Then we can introduce some sort of reward system for those customers who brought other customers. Also we want people to come to our website often, therefore we’ll have a blog and a lot of information about products and the field in general. People should have their profile page and see what their friends are buying. We also expect that the shop is something like Amazon.com where you have ratings, comments, and recommendations.” And so on, and so on.

I come across similar business requirements very often. What it comes down to, as far as technology is concerned, is the following:

  • Shopping cart
  • Content management system
  • Social stuff (integration to social networks or local features)

In Optaros parlance it rounds up to the triple of Community, Content, and Commerce (aka C3C). In fact that’s what gave birth to OCentric.

Drupal 6.x and Ubercart

Drupal is a content management system that allows creating community oriented sites very easily. The last piece of the puzzle – commerce – for quite some time was the Ubercart module. I don’t understand why it got so popular. Even for the simplest shop there was something missing.

Ubercart is almost a framework on its own: you need to learn it and live with its limitations (or hacks). My overall impression about Ubercart is that it has many features you normally expect from an e-commerce platform, but as soon as you start working with it you realize that it is a big work around.

Ubercart’s approach is – sell nodes. A node (before Drupal 7.x) is a basic content type. Ubercart is implemented in a way that products are node types, but it’s very unnatural to treat a product as a content type. This is probably the biggest flaw of Ubercart’s architecture (not sure if this has been somehow addressed in Ubercart 3.x).

While in many cases Ubercart does the thing – you can sell stuff on your Drupal site – I stumbled on so many problems that I almost lost hope to have a cool e-shop with Drupal. Just to list a few:

  • It’s nearly impossible to customize the checkout page without hacking Ubercart’s core.
  • Internationalization doesn’t work, because in Drupal a new node is created as a translation, which means a new product gets created as well.
  • Presentation is not well decoupled from data model, therefore theming any part of frontend is very tedious.

Drupal 7.x and Commerce

Drupal 7.x introduced a lot of enhancements both for module and UX developers. The most famous one is the Field API. Having realized the benefits that Drupal 7.x brings Ryan Szrama, the creator of Ubercart, has launched the Drupal Commerce project.

Drupal Commerce is the reimplementation of Ubercart’s featureset on Drupal 7.x. It’s not a port of Ubercart 2.x but literally a reimplementation. You can see the video of Ryan presenting his work on the module at DrupalCon 2010 in Copenhagen.

The Commerce module heavily relies on native Drupal 7.x features, therefore there’s barely any risk that it will become a framework on its own. While Drupal 7.x remains a content management system, it allows for more generic entities than just content. For example, products, order, order line items can all be first class citizens in Drupal 7.x. Therefore the Commerce module is architected in a way that e-shop owners can sell products, without pretending that a node content type is a product. Moreover, the data model is decoupled from presentation, and multilingual shop is no longer an issue as it was in Ubercart.

What makes the Commerce module even more powerful and flexible is that it depends on several great modules (Address Field, Entity API, Rules, Views). For example, Views – almost everything visible in Drupal Commerce is a view. That means you can switch it on/off or customize easily. This is invaluable for checkout and shopping cart pages.

Summary

In version 7.x Drupal has become quite a generic framework, sort of entity management system, that has built-in content and community features. The Commerce module plugs in very nicely into this framework and solves a lot of issues of its predecessor Ubercart. Given that many businesses need to have content, community and commerce in one, Drupal 7.x may become an option as it matures.

DrupalCon, Copenhagen 2010. Impressions

I won’t hide, the most interesting and relevant session at DrupalCon for me was on Drupal Commerce. Ryan Szrama is doing amazing job with reingineering Ubercart, and I’m really happy to have been able to talk to him in person.

The reason why I’m interested in the Drupal Commerce module is that I worked on Magento and Drupal integration for OCentric at my previous company (Optaros) and I’ve seen how difficult it is to have content, community and commerce mix in one solution. Therefore Drupal 7 + Drupal Commerce mix looks really promising. Just think about having a piece of content and adding a “product field” to it, formatted with “Add to cart” button; or the opposite – take a product page and add a piece of content to it as a field, which can have its own comments, ratings, etc. Really flexible and powerful!

One sentence by Ryan got imprinted in my brain:

“Ubercart was the first PHP and MySQL project in my career, so you guys are pretty brave to use it in production”

Another session that stood out was the keynote by Rasmus Lerdorf, the creator of PHP. It really corrected the way I look at PHP. He also showed some tricks for debugging and tracing the performance problems for Drupal. It was pretty impressive how in 15 minutes he spotted that the bottleneck in Drupal is the rendering engine which he suggested to rewrite in C/C++.

One sentence by Rasmus that imprinted in my brain (with some distortion):

“PHP has always been a templating language. All the heavy coding must be done in C”

The session on Varnish was probably the geekiest of the ones I attended, but Paul-Henning Kamp (the creator) made his point – you have to use Varnish!

And I was totally impressed with Aegir, how come I’ve never stumbled upon it? There is no doubt that this tool combined with drush_make will save the world from the Drupal deployment hell.

All in all, there was quite some buzz about Drupal 7 during the conference, many serious modules are developed directly for 7.x. This is mostly due to the fact that 7.x has this concept of entity (a field) as opposed to nodes/comments, which solves a lot of problems. I’m really looking forward to Drupal 7 and all the goodies that’ll come with it.

This was my first DrupalCon, and I must say that the crowd was really amazing. A bunch of friendly and easygoing people.

DrupalCon Copenhagen 2010 participants

Understanding the Service Oriented Architecture (SOA)

It’s a pretty old term this SOA. A software engineer (or systems integrator) normally associates it to the interface based software design. Just take a bunch of components, define interfaces between them and implement those interfaces. Then each component suddenly can be called a “service”.

Intuitively a service is something that you have an interface to and something that you don’t care about how it’s implemented.

There is a trend on the Web that websites expose their APIs to the outside world. E.g. YouTube, GCalendar, Twitter, etc. So suddenly those webapps become “services”.

Consequently the Internet is a platform for running a huge application called “Web” that is designed in SOA way, where each site is (should be) a service.

Unfortunately we are still not building our webapps to support this. We’re stuck with our software engineering mentality while we actually need to switch to Web engineering.

I think every feature of any webapp should be a service. Why coding and implementing your own contact form, your own blog, your own newsletter subscription module, your own user profile pages, etc.? Even if you have those features in your software package out of the box…

Looks like I’m trying to promote mashups, but that’s only the tip of an iceberg. Imagine that you have a website that you properly Web-engineered. Say you built the contact form feature as a service and it’s hosted on the cloud. And this feature is integrated into your CMS. There is a cool outcome at this point: you provide yourself with a SaaS solution. So you can actually start renting it to others as well. Ok maybe renting SaaS contact forms is not your core business… so what about doing it with the core business features? E.g. social graph, status updates, shopping cart, etc.?

Probably not everyone will go this way but just look at the beauty of this all, we’ve got services like getsatisfaction.com for feedback collection, discuss.com for comments, gravatar for a personal picture, openID for login, etc. etc. etc. The more a service is specialized the more useful it is.

For instance, a business model for Twitter could be renting their status updating feature to various social networks. Anyway every one of them are reimplementing it: LinkedIn, Facebook, MySpace, etc. Such a waste of time.


Posted from my Android

You Know, “running a business…”

As soon as I tell somebody that I’m starting a business with several friends – I get a question: “what kind of business”. And here a difficult part starts… At this early stage of 101senses it’s pretty difficult to explain what we’re trying to do, what we’ll be in 1-3 years, what motivates us, etc. In fact, when I take a moment and think about it then things become quite straightforward and clear. So let me describe what 101senses is all about.

We are currently 5 guys in the team and we want to do fun stuff. The current job is a bit disappointing: you get on a project, you talk to clients, you start building a solution hoping that the client will have guts to go with something fancy and innovative. But then you end up in this quality vs. time vs. money triangle, and you just do what you have to do, not always what you want to. Well, that’s IT consulting.

From several e-commerce projects I learned one thing: e-commerce is a good business. It’s much better than building e-commerce solutions for others. For instance, a private sales module for Magento community edition costs 110$, and guess what’s the revenue of a private sales e-shop…

But doing commerce is tough, and it’s totally different from what me (and most of the 101senses team) is used to, because a big part of the business (at least in the beginning) is not virtual. One has to look for products that sell, people that buy, models that generate cash. All in all, totally new challenges from the ones in the IT world. So now we have the saying “IT part is easy”. It’s a lot of fun to observe how five guys are struggling with product sourcing and otaku searching – the two things that people have been doing for ages.

As a start we decided to sell stockings for girls. Besides the fact that for guys it’s very exciting to deal with this kind of a product on a daily basis, there is real business rationale behind: stockings have a nice margin, take little space, and are easy to ship. So why not? Also if you look around the Web it’s crammed ugly and difficult to use e-shops. In the times of the person-centric Internet this does not make sense and is an area for healthy competition. It’s obvious that an e-shop that provides great user experience but the same products will win. We set an objective for 101senses to strive for the best customer experience in our e-shops. Prettify is going to be our first attempt.

Nowadays it’s quite easy to implement an e-commerce solution we decided to work on 2 shops in parallel. We call them ShopA and ShopB. Prettify is currently our ShopA. The goal of it is to be able to test our process, i.e. get a product, sell it, and deliver it to the customer – no other requirements. ShopB is going to be based on a concept. It could happen that it will be an evolution of the ShopA but it’s not excluded that it can become a totally different shop from Prettify. We’re working on that by reading about exciting commerce and following various twitterers. We’re also running from one conference to another, from one meet-up to another (check our calendar) and we’re keeping an eye on fashion in general. It’s getting more and more interesting everyday.

Most importantly we’ve got culture of openness and sharing at 101senses. There’s no point in hiding what we do and how we do it. I believe it builds trust in the virtual reality – the Internet – the same way honesty does it in real life.

To summarize:

  • we’re 101senses and we want to learn and do fun stuff
  • our first product is stockings on Prettify
  • at the core we’ve got the culture of openness and sharing
  • we like to engage into a public conversation online
  • we strive for technological innovation and great user experience on our e-shop

Some Experience With Google Wave

For my personal projects I’ve got Trac setup (OForge to be more precise). Recently with several friends we started working on a new project – 101senses.ch – and for it we adopted Google Wave as a collaboration tool.

Actually we started with the wiki on Trac. But after jumping on the wave wiki naturally became obsolete, old fashioned, inconvenient.

Some observations about GWave:

It reminds a wiki in some sense, just that collaboration happens real-time. You don’t have to browse through versions and diffs just to see recent updates.

The functionality of folders is ua bit cumbersome or sometimes even useless. At least I was not able to find any good use for them. The only thing I do is to apply a label “Meeting” with the saved search feature.

I start to fear that as the number of waves increases it will be quite a mess. Even now with 20 waves we already have duplicates. And there is no way to unshare a wave or delete it for everyone.

I really need workspaces. I’m working with different teams on different projects and mixing all the waves in the same pile just makes me loose an overview.

Widgets are cool but where do I find them? Would be great to have some kind of an app market on the web.

It’s really great that GWave is open. Because I can extend it with my apps or change it with my own UI. I think it makes a lot of sense. If eventually GWave is adopted as a collaboration platform then we can expect many nice SaaS solutions showing up on the web. The competitive advantage will be determined by a set of features and the user experience, and we won’t need to care about data portability.

- posted from my Android

“Liepsnojantis ledas” (“HotIce”) ir Šiaip Pamąstymai

Šiauliai, 2009-12-27, “Liepsnojantis ledas” – renginys, kurio džiaugiuosi nepraleidęs. Ir ne vien dėl to, kad ant jo neįtikėtinas figūras raitė įvairiausi čempionai, bet ir todėl, kad kažkuriuo momentu supratau, kaip visa tai yra gražu.

Grožis yra sudėtingas dalykas ir man, savamoksliškai besigilinant į meną, jis ne visuomet apsireiškia. Pavyzdžiui, galiu klausytis Mocarto ausis pastatęs, bet kažkaip nepasiekia jis manęs, o va išgirdus Debussy, iš karto užlieja gerumo banga.

O kas ten dėjosi! Moterys sukdamosi skraidė. Vyrai jas kilnojo ir mėtė į viršų. Broliai mindė viens kitą su pačiūžomis ir vartėsi kūlvirsčia. Vieni krito, po to kėlėsi, po to greitai, kaip vilkelis, sukosi. Kiti ne tik kojų, bet rankų ir net kaklo vikrumu vertė publiką aikčioti. Stuburo lankstumas, špagatai, salto… Jergutėliau, ir tai ant ledo, su pačiūžomis!

Ačiū Povilui Vanagui ir Margaritai Drobiazko už jų Dailųjį Čiuožimą! Už tą romantišką plaukiantį šokį, kuris nuteikia taip pat gerai, kaip atlikus ar bent susiruošus atlikti kokį nors gerą darbą. Tai taurina, moko pajusti, gerbti ir didžiuotis vertybėmis.

Turi žmogus, matyt, kažin kokį receptorių, apie kurį per biologijos pamokas nemokina, nes jį nelengva įsprausti į trijų eilučių apibrėžimą. Pas kiekvieną jis sudirginamas vis kitaip ir pasireiškia savaip. Pavyzdžiui, jeigu nugara nubėga šiurpuliukas, reiškia kažkas buvo pasakyta, sušokta, pamatyta, perskaityta, patirta… negi ne? F. Dostojevskis sakė, kad Grožis išgelbės pasaulį. Aš juo tikiu.

Linkiu daug šiurpuliukų ir užliejančių bangų ateinančiais metais.

Šiauliai, 2009-12-27, “Liepsnojantis ledas” – renginys, kurio džiaugiuosi nepraleidęs. Ir ne vien dėl to, kad ant jo neįtikėtinas figūras raitė įvairiausi čempionai, bet ir todėl, kad kažkuriuo momentu supratau, kaip visa tai yra gražu.

Grožis yra sudėtingas dalykas ir man, savamoksliškai besigilinant į meną, jis ne visuomet apsireiškia. Pavyzdžiui, galiu klausytis Mocarto ausis pastatęs, bet kažkaip nepasiekia jis manęs, o va išgirdus De Bussy, iš karto užlieja gerumo banga.

O kas ten dėjosi! Moterys sukdamosi skraidė. Vyrai jas kilnojo ir mėtė į viršų. Broliai mindė viens kitą su pačiūžomis ir vartėsi kūlvirsčia. Vieni krito, po to kėlėsi, po to greitai, kaip vilkelis, sukosi. Kiti ne tik kojų, bet rankų ir net kaklo vikrumu vertė publiką aikčioti. Stuburo lankstumas, špagatai, salto… Jergutėliau, ir tai ant ledo, su pačiūžomis!

Ačiū Povilui Vanagui ir Margaritai Drobiasko už jų Dailųjį Čiuožimą! Už tą romantišką plaukiantį šokį, kuris nuteikia taip pat gerai, kaip atlikus ar bent susiruošus atlikti kokį nors gerą darbą. Tai taurina, moko pajusti, gerbti ir didžiuotis vertybėmis.

Turi žmogus, matyt, kažin kokį receptorių, apie kurį per biologijos pamokas nemokina, nes jį nelengva įsprausti į trijų eilučių apibrėžimą. Pas kiekvieną jis sudirginamas vis kitaip ir pasireiškia savaip. Pavyzdžiui, jeigu nugara nubėga šiurpuliukas, reiškia kažkas buvo pasakyta, sušokta, pamatyta, perskaityta, patirta… negi ne? F. Dostojevskis sakė, kad Grožis išgelbės pasaulį. Aš juo tikiu.

Linkiu daug šiurpuliukų ir užliejančių bangų ateinančiais metais.

Arrange Fields in Trac Tickets

I was struggling one day to organize fields in the order I want when I create tickets in Trac.

  1. Copy templates/ticket.html into trac/myproject/templates/ticket.html
  2. Insert the following code snippet to the beginning of the template:
  3. <?python
      # define the order
      field_types = ["type", "priority", "milestone",  "keywords", "cc",  "component"]
    
      # Sorting function
      def sort_nicely(field1, field2):
        try:
            idx1 = field_types.index(field1['name'])
        except ValueError:
            idx1 = 1000 # no match, push to the end
    
        try:
            idx2 = field_types.index(field2['name'])
        except ValueError:
            idx2 = 1000 # no match, push to the end
    
        return cmp(idx1, idx2)
    
      fields.sort(cmp=sort_nicely)
    ?>
    

That's it, if you have any custom fields and you want them ordered, put them into the field_types list.

Follow

Get every new post delivered to your Inbox.