Drupal Commerce checkout pane validation

Submitted by swim on Tue, 02/11/2014 - 04:24

This article will contain a super brief summary of some of the gotchas when adding custom validation to checkout panes. Commerce checkout panes handle validation on an element level, validation handlers should be attached to the button. However this is not always possible.

For example, say you have embeded a custom form into one of your checkout panes. Validation for this form must be declared in hook_commerce_checkout_pane_info or hook_commerce_checkout_pane_info_alter

Drupal Field Importance, how to arbitrarily score entities

Submitted by swim on Fri, 01/10/2014 - 04:16

Before I dive into the method behind this module let me explain the use case. Our client had very little time and required at first a simple way to attribute a score (numeric value) per entity type field instance. The total score for the submitted entity is then calculated from each field score where a value has been entered. Finally these are displayed in an administrative view with a comparison to the total amount of points possible for that entity.

Drupal Commerce extending reorder module

Submitted by swim on Tue, 11/05/2013 - 04:09

Below is a very simple bit of code which extends Drupal Commerce reorder module. The code places an AJAX form on all commerce order entities allowing users to reorder from the order details page. This form functions exactly like the module button but with no redirect after the reorder has been triggered. One could easily add this in with a $form_state['redirect'].

Editr HTML, CSS, JS Playground for Drupal

Submitted by swim on Thu, 09/05/2013 - 03:57

Editr is an online code playground editor built with ace.js by Idered (Kasper Mikiewicz). Editr is a fantastic way to demonstrate code providing syntax highlighting, code tips & previews. Further Editr can be hosted locally allowing easy extension. Integrating Editr into Drupal was tedious at first with the jQuery requirements set fairly high; thank you maintainers of the jQuery update module, your awesome. As it stands this is only a proof of concept and should not be used on a live production site etc.

Drupal, Programmatically create registration entity

Submitted by swim on Wed, 09/04/2013 - 04:05

Recently we required a simple method for allowing users to register to the site and an event through a single form. We are using the Entity Registration (1.x) module in conjunction with Commerce Entity Registration. The form was available for each event on the corresponding node pages. Essentially the user required an account to attend an event as follow up & post event information was needed.


Omega 4.x & matchMedia

Submitted by swim on Fri, 08/16/2013 - 04:08

I love Omega; even more so after recently developing a number of sites using 4.x. While the changes from 3.x have left many site builders unhappy; developers should be ecstatic. Ultimately Omega doesn't make as many assumptions & in turn provides a much blanker canvas than before. One of these freedoms is allowing devs to set their own (breakpoints) media queries. Not like you couldn't override those already setup in 3.x; most people just used the predefined ones as it served an easy win.

Drupal defining and theming custom blocks

Submitted by swim on Sat, 07/27/2013 - 04:11

Being able to provide custom markup through theming is important on a number of levels. It allows developers & themers alike the ability to implement their own structure with predefined variables which can often even differ on a block to block basis; some requiring complex tables or forms others a simple markup area.

This article will provide a quick tutorial on how to theme custom block content & how to implement your own markup in block theme files.

Subscribe to