diff --git a/classes/stock/Stock.php b/classes/stock/Stock.php index de5c3a094..bb2642413 100644 --- a/classes/stock/Stock.php +++ b/classes/stock/Stock.php @@ -26,6 +26,7 @@ */ /** + * This represents the physical stock * @since 1.5.0 */ class StockCore extends ObjectModel @@ -71,4 +72,17 @@ class StockCore extends ObjectModel $fields['price_te'] = (float)$this->price_te; return $fields; } + + /** + * @TODO + */ + public static function getStockId($id_product, $id_product_attribute, $id_shop) + { + $sql = 'SELECT id_stock + FROM '._DB_PREFIX_.'stock + WHERE id_product = '.(int)$id_product.' + AND id_product_attribute = '.(int)$id_product_attribute.' + AND id_shop = '.(int)$id_shop; + return (int)Db::getInstance()->getValue($sql); + } } \ No newline at end of file