Holiday Schedule
Posted December 22, 2011Our office will be closed from Dec 26 through Dec 30, in observance of Christmas and New Year's. We will return January 2, 2012.
Email support will be available.
Have a happy and safe holidays!
40 Clean and Well Crafted E-commerce Website Designs for Inspiration
Posted November 05, 2011Design Beep has a great collection of e-commerce website design inspiration. Many of them are from fashion and apparel. Even farms and snack websites appreciate good design.



Web Designs for the Food Industry
Posted November 05, 2011designm.ag has a great gallery of 26 web designs for the food industry taken from well known companies like McDonald's and Red Robin. If you're looking ideas for great looking restaurant website design, that would be a great place to start.
Restricting Shipping States in Ubercart, Drupal 6
Posted November 02, 2011
We recently had to do some work for a client where they were only allowed to ship to certain states due to alcohol license shipping restrictions. Our needs were pretty simple and we didn't want unnecessary overhead to affect performance, so we rolled our own solution with a custom module.
This example is a very simple case, where users can purchase from anywhere, but only ship within California. To accomplish this, we used Drupal hook_form_alter to modify a form element only on the shipping panel:
function custom_label_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'uc_cart_checkout_form') {
unset($form['panes']['delivery']['delivery_zone']['#options']);
$form['panes']['delivery']['delivery_zone']['#options'] = array('90' => 'California');
}
What we did here was remove the states that Ubercart generates for us, which by default matches the billing panel's list, and added just the one(s) we wanted back into the array. You'll need the proper key/value pairs in the array for it work properly. To get the list, you could print out the available options by adding the following line before the unset() function:
print_r($form['panes']['delivery']['delivery_zone']['#options']);
Node checkout with quantities
Posted November 01, 2011The Node Checkout module is a great way to allow users to customize a product with a Drupal + Ubercart setup. However, one of the flaws is that it doesn't allow you to change the quantity of the item in the cart after it's been added.
For example, you may use node checkout to customize a greeting card design for the holidays. After customizing the product, you really like the design and now you want to order a few more. With the default method, you won't be able to edit the quantity. The visitor would have to delete the item from the cart, then start all over. Obviously, that's not ideal and the user may get frustrated and leave the shopping cart.
Problem: Users can't change the quantity after adding a node checkout customized item to the cart.
Solution: Use CCK and a custom Drupal module to move the quantity field to the node checkout page.
Tested on: Drupal 6.22 + Ubercart 2.4
The default behavior in Ubercart is put the quantity and attribute selections on the "product" page. Normally you could add a product, then go back and edit the quantity after adding it to your cart. After creating a node with node checkout, Ubercart does not let you return to the product page and the text field for the quantity is disabled on the cart page. However, it does generate a link so you can edit the node_checkout node as many time as you'd like.
The workaround, and perhaps an even better workflow, is to "move" the quantity field to the node checkout page, so that all options are on a single page. To do this, simply create a CCK field for "quantity" in the content type you're using for node checkout.
The trick now is how to tell Ubercart to set the quantity of the item to this CCK field. To do that, we use a simple custom module using hook_cart_item. Replace [module_name] with the name of your own module.
function [module_name]_cart_item($op, &$item) {
switch ($op) {
case 'load':
// load the node data from the node_checkout node
$item_info = node_load($item->data['node_checkout_nid']);
// set the cart quantity equal to the field value
$item->qty = $item_info->field_quantity[0]['value'];
break;
}
}
hook_cart_item can be used to do a number of other useful things, like setting the price of a product based on quantity entered. Use cases would be tiered pricing based on quantity or another cck value, like a custom sign maker that charges by the number of number of letters. In this example, the price is adjusted based on the quantity, with discounts for larger quantities:
function [module_name]_cart_item($op, &$item) {
switch ($op) {
case 'load':
// load the node data from the node_checkout node
$item_info = node_load($item->data['node_checkout_nid']);
// set the cart quantity equal to the field value
$item->qty = $item_info->field_quantity[0]['value'];
// quantities of 10 or more have a 10% discount
if ($item->qty >= '10') {
$item->price = $item->price * .9;
}
}
}
- 1 of 13
- ››

