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

Triggered by Shop_Product
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onAfterProductFileAdded(Shop_Product $product, Db_File $file)
$product Shop_Product specifies the product object.
$file Db_File specifies the added file object.
Triggered after a file is added to a product on the Product Details page. 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, 'after_file_added');
}

public function after_file_added($product, $new_file)
{
  // Replace existing files with the new one
  $files = $product->list_uploaded_files();
  foreach ($files as $file)
  {
    if ($file->id != $new_file->id)
      $file->delete();
  }
}