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

Triggered by Shop_Product
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendProductModel(Shop_Product $product)
$product Shop_Product specifies the product object.
Allows to define new columns in the product model. You can download a module template extending the product model in Module Templates documentation section. The event handler should accept a single parameter - the product object. To add new columns to the product model, call the define_column() method of the product object. Before you add new columns to the model, you should add them to the database (the shop_products table).
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');
}