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

Triggered by Shop_Product
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendProductForm(Shop_Product $product, string $context)
$product Shop_Product specifies the product object.
$context string specifies the execution context.
Allows to add new fields to the Create/Edit Product form in the Administration Area. Usually this event is used together with the shop:onExtendProductModel event. To add new fields to the product form, call the add_form_field() method of the product object.
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendProductModel', $this, 'extend_product_model');
  Backend::$events->addEvent('shop:onExtendProductForm', $this, 'extend_product_form');
}

public function extend_product_model($product)
{
  $product->define_column('x_extra_description', 'Extra description');
}

public function extend_product_form($product, $context)
{
  $product->add_form_field('x_extra_description')->tab('Product');
}