You are here

function hook_uc_stock_adjusted in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_stock/uc_stock.api.php \hook_uc_stock_adjusted()
  2. 6.2 docs/hooks.php \hook_uc_stock_adjusted()

Allows modules to take action when a stock level is changed.

Parameters

$sku: The SKU whose stock level is being changed.

$stock: The stock level before the adjustment.

$qty: The amount by which the stock level was changed.

1 invocation of hook_uc_stock_adjusted()
uc_stock_adjust in uc_stock/uc_stock.module
Adjusts the product stock level by a set amount.

File

uc_stock/uc_stock.api.php, line 23
Hooks provided by the Stock module.

Code

function hook_uc_stock_adjusted($sku, $stock, $qty) {
  $params = array(
    'sku' => $sku,
    'stock' => $stock,
    'qty' => $qty,
  );
  drupal_mail('uc_stock_notify', 'stock-adjusted', uc_store_email_from(), language_default(), $params);
}