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

Triggered by Shop_Customer
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendCustomerModel(Shop_Customer $customer, string $context)
$customer Shop_Customer specifies the customer object.
$context string specifies the execution context.
Allows to define new columns in the customer model. The event handler should accept two parameters - the customer object and the form execution context string. To add new columns to the customer model, call the define_column() method of the customer object. Before you add new columns to the model, you should add them to the database (the shop_customers table).
public function subscribeEvents()
{
   Backend::$events->addEvent('shop:onExtendCustomerModel', $this, 'extend_customer_model');
   Backend::$events->addEvent('shop:onExtendCustomerForm', $this, 'extend_customer_form');
}

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

public function extend_customer_form($customer, $context)
{
   $customer->add_form_field('x_extra_description')->tab('Customer');
}