Skip navigation
Help

hook_uc_stock_adjusted

6 hooks.php hook_uc_stock_adjusted($sku, $stock, $qty)
7 uc_stock.api.php hook_uc_stock_adjusted($sku, $stock, $qty)

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.

Related topics

1 invocation of hook_uc_stock_adjusted()

File

ubercart/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);
}