Skip to main content

Drupal 6.x

Drupal for E-Commerce

Using Drupal for E-Commerce

So, you're using Drupal to run your site. You'd like to sell products to site visitors. What are your options? This page provides an overview of some of the available solutions.

Drupal and Paypal

You can 'roll-your-own' integration, or use the LM_Paypal module.

The LM_Paypal module is not intended to be a full e-commerce solution, but it does provide some types of built-in PayPal payment notifications, and when payment is completed, LM_Paypal module receives and records the notification. It allows for very simple automated donations, subscriptions, and paid advertisements. You should evaluate this module to see if it meets your needs. There are some significant limitations, so be sure to read the issues queue to ensure that the module does what you want it to do.

Drupal and E-Junkie

E-Junkie is a lightweight online shopping cart and fulfillment system. This blurb, taken from their home page, describes the system.

E-junkie provides shopping cart and buy now buttons to let you sell downloads and tangible goods on your website, eBay, MySpace, Google Base, CraigsList and other websites using PayPal Standard, PayPal Pro, Google Checkout, Authorize.Net, TrialPay, ClickBank and 2CheckOut.

For merchants selling downloads, we automate and secure the digital delivery of files and codes. If you are selling tangible goods, we automate the shipping calculation and inventory management. Our shopping cart has a built in sales tax, VAT, packaging and shipping cost calculator.

E-Junkie Drupal Integration

That sounds great, but how do I integrate E-Junkie with Drupal? At present, I have not found any third-party Drupal modules offering E-Junkie and Drupal integration.

There are integration examples and how-to posts floating around on the web, however:

Drupal and Ubercart

Ubercart is an extensible e-commerce system that provides native product and shopping cart management within Drupal. Configuration can be somewhat complicated, but it does offer a complete solution with numerous add-in modules. You should plan for significant configuration, customization, and theming effort if the standard appearance and features are not close to what you want.

Extension modules of varying quality are available, and these may help you implement the features you want–be sure to set up a test site and verify all functionality before "going live".

Drupal PHP Snippet: Delete users with no nodes

Here's a handy PHP snippet to purge user accounts for all users who haven't created any nodes on your site. It's useful when you have a lot of users who have signed but haven't created any nodes.

<?php
  // Get a list of all users in the site who have not created any nodes, AND uid > 1
  $sql = "SELECT u.uid FROM {users} u WHERE u.uid NOT IN (SELECT DISTINCT n.uid FROM {node} n) AND u.uid > 1 ORDER BY uid";
  $result = db_query($sql);
  while($row = db_fetch_object($result)) {
  // delete the user account
  user_delete(array(), $row->uid);
}
?>

Drupal 6.x Sub-Theme Development Troubleshooting Checklist

The Drupal Sub-Theme system is a welcome addition to the Drupal system. There are a few gotchas that can trip up the unwary. Here's a quick troubleshooting list to check when you are creating a sub-theme based on an existing Drupal theme.

  1. Disable Drupal's CSS and JavaScript caching in your site's admin settings/performance page: example.com/admin/settings/performance
  2. Be sure to define at least one style sheet in your .info file. Base theme style sheets are not inherited unless you define at least one style sheet for your sub-theme
  3. Avoid Frustration: Some changes won't take effect right away. Rebuild the Drupal theme cache by visiting your site's admin/build/themes page (hit the browser reload button just to be certain!)
  4. White Screen Of Death?: If you override one of the base theme's template files, then later delete it, you may fall victim to the dreaded WSOD, and will be unable to access the site. Solution: the theme cache may need to be cleared.
    • If you can't access your site due to a WSOD, use a SQL query to delete the theme cache entry from the {cache} table: delete from cache where cid like 'theme_registry%'; then reload your site's page. For more information, see Clearing the Theme Cache.

Useful Drupal Administrative SQL Queries

Quite often, it is necessary to perform batch operations on a drupal-based site - operations on multiple users, or multiple nodes, for example, and the administrative interfaces don't support the desired operation.

I've put together a list of my favorite queries on this page. I'll update these as time permits.

Syndicate content