• Development

    Webform for Campaign Monitor

    Webform is an amazing module. Thankfully, you can extend it to make it even more helpful. We’ve had a lot of clients that offer a “Join Our Mailing List” type of functionality on their sites. These forms are typically one or two fields (email and name, usually) and are for anonymous users. We use Campaign Monitor for most clients.

    There is a Campaign Monitor module, but I prefer the following method, for various reasons.

  • Development

    Vim in 10 Minutes

    This week at my local PHP user group we were speaking about IDEs. There were four of us who prepared to speak to attendees. I wasn’t sure what kind of time I’d be allotted, so I didn’t prepare as I usually do. I figured I’d just give an off-the-cuff introduction to some of the niceties of Vim. It didn’t work out as well as I’d hoped.

    About a year ago I did a two-hour Vim talk. I spent a significant amount of time preparing for the talk. The presentation was well-received and, I’d like to think, resulted in a few new Vim users. Why do I mention this? It makes me feel better about the crummy introduction to Vim that I gave last night.

    So I’m just throwing this out there… make sure you have more than 10 minutes if you want to introduce someone to Vim. If you have less than 10 minutes, I suggest grabbing a really messy file and cleaning it up using Vim power. This may be enough to spark some interest. Also you may find it beneficial to just point your audience to a YouTube video of a Vim power user working his/her magic. Vim Tutor is another approach.

  • Development

    Disable Specific States in Ubercart

    Here’s a quick example that illustrates how to remove a few State/Province options from the billing and shipping panes of the Ubercart checkout form, as well as the order edit/create form. Please understand there are other ways to do this (like altering the united_states_840_1.cif file and re-importing). The ​hook_form_alter() method seems less permanent, so I favor it.

  • Development

    Get the Value of the Cheapest Option for an Ubercart Product

    This is just a quick code example. Imaging you have an Ubercart attribute that has several options and you’d like to show an “As low as $X.XX” price on the frontend. Here’s a simple solution. Note that if you wanted the lowest price across ALL attributes you could loop through each attribute too (instead of just looking at attributes[1]).