/** * Is this products stock quantity overbookable? * If this product does not have overbookablility set the general setting of * the config object is choosen. * If stock management is deactivated true will be returned. * * @return boolean is the product overbookable? * * @author Roland Lehmann <*****@*****.**>, Sebastian Diel <*****@*****.**> * @since 26.11.2012 */ public function isStockQuantityOverbookable() { if (is_null($this->isStockQuantityOverbookable)) { $overbookable = true; if (SilvercartConfig::EnableStockManagement()) { if (!SilvercartConfig::isStockManagementOverbookable() && !$this->StockQuantityOverbookable) { $overbookable = false; } } $this->isStockQuantityOverbookable = $overbookable; } return $this->isStockQuantityOverbookable; }
/** * May a products stock quantity be below zero? * * @return bool is stock management overbookable? * * @author Roland Lehmann <*****@*****.**> * @since 17.7.2011 */ public static function isStockManagementOverbookable() { if (is_null(self::$isStockManagementOverbookable)) { self::$isStockManagementOverbookable = self::getConfig()->isStockManagementOverbookable; } return self::$isStockManagementOverbookable; }