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

Triggered by Shop_ProductProperty
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendAttributeForm(Shop_ProductProperty $attribute, string $context)
$attribute Shop_ProductProperty specifies the product attribute object.
$context string specifies the execution context.
Allows to add new fields to the Add/Edit attribute section of the Add/Edit Product form in the Administration Area. Usually this event is used together with the shop:onExtendAttributeModel event. To add new fields to the attribute form, call the add_form_field() method of the attribute object.
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');
}