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:onExtendProductTypeForm event

Triggered by Shop_ProductType
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendProductTypeForm(Shop_ProductType $product_type, string $context)
$product_type Shop_ProductType specifies the product type object.
$context string specifies the execution context.
Allows to add new fields to the Create/Edit Product Type form in the Administration Area. Usually this event is used together with the shop:onExtendProductTypeModel event. To add new fields to the product type form, call the add_form_field() method of the product type object.
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');
}