This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:onExtendProductTypeModel event

Triggered by Shop_ProductType
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendProductTypeModel(Shop_ProductType $product_type)
$product_type Shop_ProductType specifies the product type object.
Allows to define new columns in the product type model. The event handler should accept a single parameter - the product type object. To add new columns to the product type model, call the define_column() method of the product type object. Before you add new columns to the model, you should add them to the database (the shop_product_types table).
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendProductTypeModel', $this, 'extend_product_type_model');
  Backend::$events->addEvent('shop:onExtendProductTypeForm', $this, 'extend_product_type_model');
}

public function extend_product_type_model($product_type)
{
  $product_type->define_column('x_custom_column', 'A custom column');
}

public function extend_product_type_form($product_type, $context)
{
  $product_type->add_form_field('x_custom_column')->tab('Product Type');
}