With 4.7, E-Commerce includes functionality for creating and working with parent and child products through the Subproducts module, produced by CivicSpace Labs and sponsored by GoodStorm.

Subproducts are a feature of certain product-type modules. At present, subproducts are implemented by the Apparel and Custom modules, both found in the ecommerce/contrib directory.

Two different types of subproducts are implemented in the Subproducts module. In 'variation'-type subproducts, a parent product's children have a combination of different attributes. For example, a "Unisex T-shirt" might come in both grey and green and both small and large. Subproducts of the parent shirt might then include (a) grey small, (b) grey large, (c) green small, and (d) green large. Any product that comes in different qualities, sizes, colors, compositions, etc. can be handled as variation-type subproducts.

For the other type of subproducts, called a 'base'-type, each subproduct is based on an existing product. A practical example would be a design that's to be printed on a shirt. In this case, the design (say, a logo) is associated with a parent product. A child product might be the logo printed on a large, green unisex t-shirt. Base-type subproducts don't themselves have variations (size, color, etc.), but the products they're based on do. (Does that sound complicated? Don't worry, there are some simple instructions below.)

Working with variation-type subproducts

When you enable or update product.module, it should create a ec_product table with the correct 'pparent' field to the ec_product table (this has been added to the product.install file).

The following steps should get you started.

  • Enable the apparel and subproducts modules.
  • You need to create some variations (e.g., 'size', color') and attributes (e.g., for size, 'small', 'medium', 'large'). Do this at administer > store > settings > product variations.. (The interface is like what you'd see for forum module's 'containers' and 'forums').
  • Create a new apparel product; this will be your 'parent' product.
  • When the product has been created, click the 'subproducts' tab. Here's a sample of what you'll see:
    Parameter Surcharge # in stock

    color

    green 0.00
    pink 0.00

    size

    large 0.00
    small 0.00

    Choose which attributes you want subproducts of, optionally set their stock amounts, and click the "review options" button.

  • On the next page, you'll get a list of subproducts to generate. Example:
    color size Price Stock
    green large 12
    green small 12

    pink large 12
    pink small 12

    Uncheck any products you don't wish to create, optionally adjust their stock amounts, then click the "generate" button. You should now see a "list" option under the subproducts tab, which lists the newly-created subproducts.

Working with base-type subproducts

The following steps should get you started.

  • Enable the apparel, custom, and subproducts modules, and follow the instructions above for creating an apparel node with subproducts.
  • As with variation-type products, create a custom product (this will be your parent product) and click the "subproducts" tab to generate subproducts.
  • Follow the instructions, selecting the apparel products to use as bases and your desired variations.