Back to PhocacartAttribute class

Method getCombinationsPriceByKey

public static
getCombinationsPriceByKey
(mixed $productKey)

Method getCombinationsPriceByKey - Source code

public static function getCombinationsPriceByKey($productKey)
{
    $db = Factory::getDBO();
    $query = 'SELECT price' . ' FROM #__phocacart_product_stock' . ' WHERE product_key = ' . $db->quote($productKey) . ' ORDER BY product_key' . ' LIMIT 1';
    $db->setQuery($query);
    $price = $db->loadResult();
    if (isset($price) && $price > 0) {
        return $price;
    }
    return 0;
}