Example #1
0
 protected static function getDbConnection()
 {
     if (self::$_connection === null) {
         self::$_connection = self::getDbResource()->getConnection('core_read');
     }
     return self::$_connection;
 }
Example #2
0
 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];
 }