01. Installation and setup


Installing the module will create a single table in the database that holds associations of node types to products in your catalog. In order to use this module, you will need to setup a node type that customers will be able to checkout. You can setup the node form however you want to guide your customers through creating the node. In most cases, it makes sense to default this node type to unpublished so that it can be processed and published if necessary after checkout.

Once you have configured the node type, you will also need to make an associated product. The product will be added to the user's shopping cart when they create an associated node. The module will respect the node price and default add to cart quantity. For this version, the add to cart button on the product will be useless, as it will add a product to the cart without an associated node. You should consider unpublishing this product and linking customers directly to the node add form or altering the add to cart form for this product so that it directs the customer to the node add form instead of adding the product to the cart.

For the purposes of this documentation, the node type created is called Registration for a special Ubercart conference. The product is One Day UberEvent. We'll be using the node form as a registration form for the conference. This means we'll be able to view all the registrants in a simple administrative View.

Associating node types with products

After you have created both the node type and product, browse to Administer > Store administration > Configuration > Node checkout settings. Here you will be confronted with the following overview page:

node-checkout-overview

Click the edit link for the product type you want to associate with a product. This will bring up a simple settings form that looks like the following:

node-type-association-settings

As you can see here, you first must enter the node ID of the product that will be added to the cart when a user creates a node of this type. The field works on autocomplete based on the node title, so as you start to type in a product's title it will show a list of available products. Selecting one will add the node ID to the textfield automatically.

The other settings deal with what will be visible on the node add form. The preview button is disabled by default, but you can uncheck the setting to make it available. You can optionally restrict any other CCK fields from normal users so you can have administrative fields that the customer cannot see. In this case, we'll check the box by "Payment status" as it will be used for internal tracking.

*Please note that the permission edit any node_type content only applies to Drupal 6. In Drupal 5, the syntax for the comparable permission is edit node_type content.

Testing the association

Now that this is done, you should see the association on the node checkout overview page. You can test out the association by creating a new node of the associated node type. The associated product should be added to the cart with the node reference. Removing the product from the cart should delete the node, and conversely deleting the node should remove the item from the cart. You can go all the way through checkout now, but without a bit more work nothing will happen to the nodes you have purchased.