Back to PhocacartAttribute class

Method getCombinationsStockById

public static
getCombinationsStockById
(mixed $productId, mixed $returnArray = 0)

Method getCombinationsStockById - Source code

public static function getCombinationsStockById($productId, $returnArray = 0)
{
    $db = Factory::getDBO();
    $query = 'SELECT a.id, a.product_id, a.product_key, a.stock, a.attributes' . ' FROM #__phocacart_product_stock AS a' . ' WHERE a.product_id = ' . (int) $productId . ' ORDER BY a.id';
    $db->setQuery($query);
    if ($returnArray) {
        $items = $db->loadAssocList();
    } else {
        $items = $db->loadObjectList();
    }
    return $items;
}