Experiences with Drupal E-Commerce And Coupons
So I’ve taken on a challenge that must be executed to exact precision. Designing a coupon system for the Drupal E-Commerce CMS. Why? Because I’ve found the stock contributed module for Drupal which does coupons is poor.
Not to take anything away from the tremendous effort to design a free module, but the design doesn’t fit a real e-commerce solution. The coupon system is limited to single custom coupons without any concept of “promotional codes.” This limits the usefulness to handing out coupons when we want a customer to buy from us and only want them to receive a discount, in-store credit for video game trade-ins and a few other limited areas.
A real coupon system needs to have promotional code support along with the ability to add custom code names (i.e. “MAY07SALE”) or a partnership with another company whom you wish to use their name (i.e. GoDaddy’s “digg” promocode for diggnation). The coupon system lacks expirations dates– they last forever, not really great for promotions. Lastly, a coupon must be able to work on one or more products but not your entire inventory. For example, “10% off copies of Need for Speed Carbon this week.”
The core of my custom module was to take the existing coupon system an advance it into something more powerful. I designed a new record for my coupon that held the ability to create a coupon based solely on “free shipping,” the expiration date concept and limiting the items to a subset of our inventory.
Sound easy? Well, for a programmer it may seem easy, but initial testing was fairly difficult. First, you need to be able to destroy coupons that you accidental made but limit users from destroying coupons that have actually been used (losing record of them). Second, you have to test the heck out of the system to make sure it cannot be exploited. Not allowing the coupon to be used twice, used after its value has expired or used in other malicious manners.
That means thinking like a schemer, how can you take advantage of the system? In the process I also found that the original coupon system had a bug… if you gave a user a % off coupon, say 10% off your order, it would work for every item in your cart EXCEPT for those that had quantities above 1. If you had a product with 10% a 59.99 item but that item had a quantity of 2, you only receive 5.99 off because it saw that as a single item - not a single item with a quantity of 2.
Now I face the next challenge, allowing “free shipping” to be regulated to the lowest type of shipping, UPS Ground, and USPS Priority Mail. Allowing free shipping without such restrictions will get scheming customers shipping products overnight on your dime. Not cool.
So far so good, the system is up and stable in all test scenarios and much of it is live. Still to come, free shipping feature and a user account management system which will show users how many coupons they have, when they’ll expire and how much they’ve spent on their coupons (since remaining balance carries over on non-promotional coupons).
This will, hopefully, allow my site, www.techdiversions.com to run newsletter and podcast promotions to push products we want to get off the shelves and into customers hands for a lower price. Of course, customers must listen to our podcast and receive our newsletter to gain the advantage but heck–that’s marketing!
Leave a Reply
You must be logged in to post a comment.

Posted in Development, Our Projects