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

Triggered by Shop_ProductProperty
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendAttributeModel(Shop_ProductProperty $attribute, string $context)
$attribute Shop_ProductProperty specifies the product attribute object.
$context string specifies the execution context.
Allows to define new columns in the product attribute model. The event handler should accept two parameters - the product attribute object and the form execution context string. To add new columns to the attribute model, call the define_column() method of the attribute object. Before you add new columns to the model, you should add them to the database (the shop_product_properties table).
public function subscribeEvents()
{
   Backend::$events->addEvent('shop:onExtendAttributeModel', $this, 'extend_attribute_model');
   Backend::$events->addEvent('shop:onExtendAttributeForm', $this, 'extend_attribute_form');
}

public function extend_attribute_model($attribute, $context)
{
   $attribute->define_column('x_extra_description', 'Extra description');
}

public function extend_attribute_form($attribute, $context)
{
   $attribute->add_form_field('x_extra_description');
}