Until very recently, this website was powered by Drupal. Now although Drupal’s great in a whole raft of situations, there are times when either it’s overkill for something small, or just doesn’t fit into one’s workflow. I came to realise that both of these applied to this site, so when it came to re-developing, I decided to abandon Drupal for the site altogether.
In the end, I decided to rebuild the site using Jekyll, along with a few other tools along the way.
This post explains the motivations behind the decision, what I did next and some of the challenges I faced along the way.
The Need for Re-development
There were several aspects that made re-developing my site something of a priority.
First, it wasn’t mobile-friendly. I may have been able to get away with that some years ago when I first drafted the site, but now that’s just not acceptable. After weighing the pros and cons of a responsive vs a separate mobile site, I decided on the former — and the only way to do that would be to start the front end build again from scratch.
There isn’t really an out-of-the-box solution for gift certificates in Drupal Commerce; there’s no module (at time of writing) you can simply download, enable and forget about. Being Drupal, there are many ways to skin a cat, so to speak, so in this post I’m going to outline how I got them working on a site I built.
Of course, the way your gift certificates work may well differ from site-to-site; I had a way I wanted it to work, but your requirements might be subtly different, but hopefully whatever your requirements, some of what follows is of some use.
To outline, here’s what I wanted to achieve:
- Gift certificates available as products, which a customer can purchase
- A range of values (Â£5, Â£10, Â£20 etc) available
- A product display page that differed from “conventional” products — there are less fields required, so the layout was likely to be different
- I wanted a customer to be able to specify a recipient for the gift certificate
- The customer needed to supply an email address for the recipient, so we can send it to them via email
- I wanted the customer to be able to specify the recipient’s name, to personalise the email
- The customer ought to be able to enter their name as they wished it to appear on the email; the billing name on the order might well be too formal
- There ought to be an optional text field to add a personal message
- The gift certificate needed to be sent out via email when the order was completed, and paid for