LemonStand Documentation

shop:onExtendManufacturerForm event

This event allows to add new fields to the Create/Edit Manufacturer form in the Administration Area. Usually this event is used together with the shop:onExtendManufacturerModel event. The event handler should accept two parameters - the manufacturer object (Shop_Manufacturer) and the form execution context string. To add new fields to the manufacturer form, please call the add_form_field() method of the manufacturer object. Please read the Extending existing models article to learn more about extending the manufacturer form.

Example of the event handler:

public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onExtendManufacturerModel', $this, 'extend_manufacturer_model');
  Backend::$events->addEvent('shop:onExtendManufacturerForm', $this, 'extend_manufacturer_form');
}

public function extend_manufacturer_model($manufacturer, $context)
{
  $manufacturer->define_column('x_extra_description', 'Extra description');
}
    
public function extend_manufacturer_form($manufacturer, $context)
{
  $manufacturer->add_form_field('x_extra_description')->tab('Name and Description');
}

Next: shop:onExtendOrderModel event
Previous: shop:onExtendManufacturerModel event
Return to Handling LemonStand events