protected static function getDbConnection() { if (self::$_connection === null) { self::$_connection = self::getDbResource()->getConnection('core_read'); } return self::$_connection; }
public function getCustomOptionId($productId = null) { if (null === $productId) { $productId = $this->getDummyProductId(); } if (!isset(self::$_customOptionIds[$productId])) { self::$_customOptionIds[$productId] = (int) Vikont_Wholesale_Helper_Db::getTableValue('catalog/product_option', 'option_id', 'product_id=' . $productId); if (!self::$_customOptionIds[$productId]) { Mage::throwException('Cannot find wholesale product custom option'); } } return self::$_customOptionIds[$productId]; }