Exemplo n.º 1
0
 /**
  * Load product tier prices
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
  * @return array
  */
 public function loadProductPrices($product, $attribute)
 {
     $select = $this->_getReadAdapter()->select()->from($this->getMainTable(), array('website_id', 'all_groups', 'cust_group' => 'customer_group_id', 'price_qty' => 'qty', 'price' => 'value'))->where('entity_id=?', $product->getId())->order('qty');
     if ($attribute->isScopeGlobal()) {
         $select->where('website_id=?', 0);
     } else {
         if ($storeId = $product->getStoreId()) {
             $select->where('website_id IN (?)', array(0, Mage::app()->getStore($storeId)->getWebsiteId()));
         }
     }
     return $this->_getReadAdapter()->fetchAll($select);
 }
Exemplo n.º 2
0
 /**
  * Delete product tier price data from storage
  *
  * @deprecated since 1.3.2.3
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
  * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice
  */
 public function deleteProductPrices($product, $attribute)
 {
     $websiteId = null;
     if (!$attribute->isScopeGlobal()) {
         $storeId = $product->getProductId();
         if ($storeId) {
             $websiteId = Mage::app()->getStore($storeId)->getWebsiteId();
         }
     }
     $this->deletePriceData($product->getId(), $websiteId);
     return $this;
 }