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

Triggered by Shop_Product
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onBeforeProductFileAdded(Shop_Product $product, Db_File $file)
$product Shop_Product specifies the product object.
$file Db_File specifies the added file object.
Triggered before a file is added to a product on the Product Details page. Inside the event handler you can validate the uploaded file and trigger an exception if it is needed. Please read this article to learn about implementing the file upload support on the product details page. Example:
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onAfterProductFileAdded', $this, 'before_file_added');
}

public function before_file_added($product, $new_file)
{
  if ($product->list_uploaded_files()->count >= 3)
    throw new Phpr_ApplicationException('You cannot add more then 3 files');
}