You are here

function uc_stock_is_active in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_stock/uc_stock.module \uc_stock_is_active()
  2. 6.2 uc_stock/uc_stock.module \uc_stock_is_active()

Checks if a SKU has an active stock record.

Parameters

$sku: The Ubercart product SKU to check

Return value

Boolean indicating whether or not the sku has an active stock record.

2 calls to uc_stock_is_active()
UbercartStockTestCase::testProductStock in uc_stock/tests/uc_stock.test
uc_stock_adjust_product_stock in uc_stock/uc_stock.module
Decrement a product's stock.

File

uc_stock/uc_stock.module, line 200
Allow ubercart products to have stock levels associated with their SKU

Code

function uc_stock_is_active($sku) {
  return (bool) db_query("SELECT active FROM {uc_product_stock} WHERE sku = :sku", array(
    ':sku' => $sku,
  ))
    ->fetchField();
}