uc_stock.api.php 657 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the Stock module.
  5. */
  6. /**
  7. * @addtogroup hooks
  8. * @{
  9. */
  10. /**
  11. * Allows modules to take action when a stock level is changed.
  12. *
  13. * @param $sku
  14. * The SKU whose stock level is being changed.
  15. * @param $stock
  16. * The stock level before the adjustment.
  17. * @param $qty
  18. * The amount by which the stock level was changed.
  19. */
  20. function hook_uc_stock_adjusted($sku, $stock, $qty) {
  21. $params = array(
  22. 'sku' => $sku,
  23. 'stock' => $stock,
  24. 'qty' => $qty,
  25. );
  26. drupal_mail('uc_stock_notify', 'stock-adjusted', uc_store_email_from(), language_default(), $params);
  27. }
  28. /**
  29. * @} End of "addtogroup hooks".
  30. */