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

Triggered by /modules/shop/controllers/shop_products.php
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onPrepareProductListData(Shop_Products $controller)
$controller Shop_Products specifies the controller object.
Allows to alter the list of products on the Shop/Products page in the Administration Area. The event handler accepts the back-end controller object and should return a configured Shop_Product object. The following example modifies the product list in such a way that only enabled products are displayed.
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onPrepareProductListData', $this, 'prepare_products_data');
}

public function prepare_products_data($controller)
{
  $product = Shop_Product::create()->apply_visibility(); // Hide disabled products
  $controller->filterApplyToModel($product, 'product_list'); // Apply list filters
  return $product->where('grouped is null'); // Hide grouped products
}
Note that the Product list page has filters, and the controller's filterApplyToModel() method should be called in order to apply them to the product model. Also, the list should not display grouped products.