Welcome!

Tags: Drupal, Drush, Python

I've been writing a few Python-based Drupal utilities to make automated backups and update reports simple. These utilities will be especially useful to people who manage many sites.

Tags: Commerce, Database API, Drupal 7, hook_form_alter

In this example I'm showing how to improve the Add to Cart button for Drupal Commerce products to show differently based on whether or not users have already purchased a product, or whether the product is already in their cart.

Tags: Commerce, Drupal 7

Drupal Commerce is amazing. On a recent project I had the pleasure of working with it for the first time. I understood the link between products and product displays, but there were a few things that bothered me about the relationship. This example demonstrates a simple administrative UI modification to make it easier to edit a product display node's referenced product.

Tags: Drupal 7

Here's a simple way to remove the Read more link at the module level (in Drupal 7).
Sometimes this is preferred over doing it at the theme level (because maybe we don't want the link to appear no matter what theme is being used).

Tags: Drupal, hook_form_alter, 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.

Tags: Drupal, PHP, Ubercart

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]).

Tags: Drupal, Drupal 6, PHP, Ubercart

This tutorial is for Ubercart versions later than version 2.3. If you're using an older version of Ubercart, you'll want to see this example. This example is very similar, but accommodates the changes made to the template system in Ubercart.

Tags: Drupal, lightbox, theming

This is a pretty simple example that illustrates the use of Lightbox2's slideshow feature. In the example, we have an imagefield that allows an unlimited number of images. We only want to render an imagecache version of the first image which, when clicked, will provide a slideshow with the rest of the images in the field. In the example, our field is called "field_product_images".

Tags: Drupal, Drupal 6, hook_form_alter

Using hook_form_alter one can easily add a "Reset" button to a Drupal form.

Here's a simple example:

Tags: Drupal, Drupal 6, hook_form_alter, i18n, taxonomy, Views

I've been working on a multilingual site that has a product finder. We have 3 exposed filters that allow a user to select an Activity, IP Category, or Industry. All of these filters are Taxonomy Term filters. Some of the terms throughout those vocabularies have a specific language set, and should only show when that language is active.

Pages